Documentation ¶
Index ¶
- func PathStandardize(results []*FileResult, basedir string) error
- func RegisterExtractor(langType core.LangType, extractor Extractor)
- type BaseFileResult
- type Call
- type CallFileResult
- type CallSupport
- type ClassSupport
- type Clazz
- type ClazzFileResult
- type ClazzWithPath
- type DataType
- type DataTypes
- type ExtractType
- type Extractor
- type FileResult
- type Function
- type FunctionFileResult
- type FunctionSupport
- type FunctionWithPath
- type Symbol
- type SymbolFileResult
- type SymbolSupport
- type SymbolWithPath
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PathStandardize ¶
func PathStandardize(results []*FileResult, basedir string) error
func RegisterExtractor ¶ added in v0.15.2
Types ¶
type BaseFileResult ¶
type BaseFileResult[T DataType] struct { Path string `json:"path"` Language core.LangType `json:"language"` Type string `json:"type"` Units []T `json:"units"` }
func (*BaseFileResult[T]) IsEmpty ¶ added in v0.16.0
func (b *BaseFileResult[T]) IsEmpty() bool
type CallFileResult ¶
type CallFileResult = BaseFileResult[*Call]
type CallSupport ¶
type ClassSupport ¶ added in v0.10.0
type ClazzFileResult ¶ added in v0.10.0
type ClazzFileResult = BaseFileResult[*Clazz]
type ClazzWithPath ¶ added in v0.16.0
type DataType ¶
type DataType interface { GetIndexName() string // for query and locate from outside GetDesc() string // easy to understand what it actually contains GetSpan() *core.Span }
func DataTypeOf ¶
type ExtractType ¶
type ExtractType = string
const ( TypeExtractFunction ExtractType = "func" TypeExtractSymbol ExtractType = "symbol" TypeExtractCall ExtractType = "call" TypeExtractClazz ExtractType = "class" )
these extractors are independent with each other
type Extractor ¶
type Extractor interface { GetLang() core.LangType SymbolSupport FunctionSupport CallSupport ClassSupport }
Extractor
in tree-sitter, a specific language is ruled by grammar.js. https://github.com/tree-sitter/tree-sitter-java/blob/master/grammar.js
unlike other projects, we will only keep the necessary parts, not the whole grammar rule
func GetExtractor ¶
type FileResult ¶
type FileResult = BaseFileResult[DataType]
type FunctionFileResult ¶
type FunctionFileResult = BaseFileResult[*Function]
type FunctionSupport ¶
type FunctionWithPath ¶ added in v0.16.0
FunctionWithPath original symbol and function do not have a path because they maybe not come from a real file
func WrapFuncWithPath ¶ added in v0.16.0
func WrapFuncWithPath(f *Function, p string) *FunctionWithPath
func (*FunctionWithPath) GetDescWithPath ¶ added in v0.16.0
func (fwp *FunctionWithPath) GetDescWithPath() string
type SymbolFileResult ¶
type SymbolFileResult = BaseFileResult[*Symbol]
type SymbolSupport ¶
type SymbolWithPath ¶ added in v0.16.0
Click to show internal directories.
Click to hide internal directories.