feat(golang): Go AST helper functions and parser scaffold (PR-02)#521
Merged
Conversation
SafeDep Report SummaryNo dependency changes detected. Nothing to scan. This report is generated by SafeDep Github App |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #521 +/- ##
==========================================
+ Coverage 82.78% 82.82% +0.03%
==========================================
Files 122 124 +2
Lines 14345 14462 +117
==========================================
+ Hits 11876 11978 +102
- Misses 2021 2031 +10
- Partials 448 453 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Owner
Author
This was referenced Feb 15, 2026
Owner
Author
Merge activity
|
Create graph/golang/ package with 8 shared utility functions and GoParams struct for parameter extraction across all declaration parsers (PR-03 through PR-06). Helpers: - ExtractParameters: handles grouped params (a, b int), variadic, unnamed - ExtractReturnType: single, multi, named returns - ExtractReceiverType: strips pointer (*Server → "Server") - ExtractStructFields: named fields + embedded types - ExtractInterfaceMethods: method specs + embedded interfaces - DetermineVisibility: Go capitalization convention (public/private) - IsInitFunction: detect init() special semantics - IsGoKeyword: 25 keywords + predeclared identifiers/types + 18 builtins Also adds parser_golang.go empty dispatcher shell with setGoSourceLocation helper for consistent byte-range tracking on every node. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2ac41d1 to
b072f16
Compare
Code Pathfinder Security ScanNo security issues detected.
Powered by Code Pathfinder |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Summary
graph/golang/package with 8 shared utility functionsGoParamsstruct for parameter extraction across all declaration parserssetGoSourceLocationhelper inparser_golang.gofor consistent byte-range trackingparser_golang.godispatcher shellTest plan
ExtractParametershandles grouped params:a, b intcorrectlyExtractParametershandles variadic params:args ...stringcorrectlyExtractParametershandles unnamed params:func(int, string)correctlyExtractReturnTypehandles single, multi, named, and empty returnsExtractReceiverTypestrips pointer from*Server→"Server"ExtractReceiverTypegracefully returns "" for generic receivers (*Stack[T])ExtractStructFieldsextracts named fields + embedded typesExtractInterfaceMethodsextracts methods + embedded interfaces (type_elem)DetermineVisibilitydistinguishes exported vs unexported namesIsInitFunction("init")→ true;IsInitFunction("main")→ falseIsGoKeywordcovers all 25 keywords + predeclared types + 18 builtins +any/comparablesetGoSourceLocationsets File/StartByte/EndByte on nodesgo build ./...compiles without errorsgo test ./graph/golang/...passes all tests (94.1% coverage; remaining 5.9% is defensive guards unreachable by tree-sitter)go vet ./...reports zero findings🤖 Generated with Claude Code