Documentation
¶
Index ¶
- func JavaLanguage() *sitter.Language
- type Parser
- func (p *Parser) ListJavaComments(ctx context.Context, fsys fs.FS, path string) ([]parser.JavaComment, error)
- func (p *Parser) ListJavaFields(ctx context.Context, fsys fs.FS, path string) (model.JavaFileSummary, error)
- func (p *Parser) ParseJavaFile(ctx context.Context, fsys fs.FS, path string) (model.JavaFileSummary, error)
- type Walker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JavaLanguage ¶
JavaLanguage returns the singleton Tree-sitter Java language.
Types ¶
type Parser ¶
type Parser struct{}
Parser implements ParseJavaFilePort.
func (*Parser) ListJavaComments ¶
func (p *Parser) ListJavaComments(ctx context.Context, fsys fs.FS, path string) ([]parser.JavaComment, error)
ListJavaComments satisfies ListJavaCommentsPort. It parses the given Java file and returns every line_comment and block_comment node found anywhere in the syntax tree — at file scope, inside class bodies, inside method bodies, and inside nested types.
The same *Parser struct satisfies ParseJavaFilePort, ListJavaFieldsPort, and ListJavaCommentsPort (one collaborator, multiple ISP ports) without any shared mutable state.
Partial parses: when the tree contains ERROR or MISSING nodes the method still returns all comments collected up to that point, wrapped together with domerr.ErrPartialParse — mirroring the behaviour of ParseJavaFile.
func (*Parser) ListJavaFields ¶
func (p *Parser) ListJavaFields(ctx context.Context, fsys fs.FS, path string) (model.JavaFileSummary, error)
ListJavaFields satisfies ListJavaFieldsPort. It parses the file and returns a JavaFileSummary populated with Path, Package, Imports, and Declarations[i].Fields only — Methods and other JavaDeclaration fields are left at their zero value so callers explicitly opt in to the field-only view.
The same *Parser struct satisfies both ParseJavaFilePort and ListJavaFieldsPort (one collaborator, multiple ISP ports) without any shared mutable state.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package bundledqueries embeds the Tree-sitter query (.scm) sets that ship with the jitctx binary, indexed by canonical language id.
|
Package bundledqueries embeds the Tree-sitter query (.scm) sets that ship with the jitctx binary, indexed by canonical language id. |