Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var GoSpec = &LanguageSpec{ NamedChunks: map[string]NamedChunkExtractor{ "function_declaration": { NameQuery: `(function_declaration name: (identifier) @name)`, }, "method_declaration": { NameQuery: `(method_declaration name: (field_identifier) @name)`, ParentNameQuery: ` (method_declaration receiver: (parameter_list (parameter_declaration type: [ (type_identifier) @name (pointer_type (type_identifier) @name) (generic_type (type_identifier) @name) (pointer_type (generic_type (type_identifier) @name))])))`, }, "type_declaration": { NameQuery: ` (type_declaration [ (type_spec name: (type_identifier) @name) (type_alias name: (type_identifier) @name)])`, }, "var_declaration": { NameQuery: `(var_declaration (var_spec name: (identifier) @name))`, }, "const_declaration": { NameQuery: `(const_declaration (const_spec name: (identifier) @name))`, }, }, Ignore: []string{ "package_clause", }, FileTypeRules: []FileTypeRule{ {Pattern: "**/*_test.go", Type: FileTypeTests}, {Pattern: "vendor/**", Type: FileTypeIgnore}, {Pattern: "third_party/**", Type: FileTypeIgnore}, }, }
View Source
var MarkdownSpec = &LanguageSpec{ ExtractChildrenIn: []string{"section"}, Ignore: []string{ "atx_heading", "setext_heading", "block_quote", "block_continuation", "fenced_code_block", "indented_code_block", "html_block", "link_reference_definition", "list", "paragraph", "pipe_table", "thematic_break", }, FileTypeRules: []FileTypeRule{ {Pattern: "**/*.md", Type: FileTypeDocs}, }, }
Functions ¶
This section is empty.
Types ¶
type Chunk ¶
type FileTypeRule ¶ added in v0.3.0
type LanguageSpec ¶
type LanguageSpec struct {
NamedChunks map[string]NamedChunkExtractor
ExtractChildrenIn []string
Ignore []string
FileTypeRules []FileTypeRule
}
type NamedChunkExtractor ¶
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
func NewGoParser ¶
func NewMarkdownParser ¶ added in v0.3.0
Click to show internal directories.
Click to hide internal directories.