Documentation
¶
Index ¶
- func FoldingRange(rootNode *parser.GroupStatementNode) ([]*parser.GroupStatementNode, []*parser.CommentNode)
- func GoToDefinition(file *checker.FileDefinition, position lexer.Position) (fileNames []string, reachs []lexer.Range, err error)
- func HasFileExtension(fileName string, extensions []string) bool
- func Hover(file *checker.FileDefinition, position lexer.Position) (string, lexer.Range)
- func OpenProjectFiles(rootDir string, withFileExtensions []string) map[string][]byte
- func Print(node ...parser.AstNode)
- type Error
- func DefinitionAnalysisSingleFile(fileName string, parsedFilesInWorkspace map[string]*parser.GroupStatementNode) (*checker.FileDefinition, []Error)
- func ParseFilesInWorkspace(workspaceFiles map[string][]byte) (map[string]*parser.GroupStatementNode, []Error)
- func ParseSingleFile(source []byte) (*parser.GroupStatementNode, []Error)
- type FileAnalysisAndError
- func DefinitionAnalisisWithinWorkspace(parsedFilesInWorkspace map[string]*parser.GroupStatementNode) []FileAnalysisAndError
- func DefinitionAnalysisChainTrigerredByBatchFileChange(parsedFilesInWorkspace map[string]*parser.GroupStatementNode, ...) []FileAnalysisAndError
- func DefinitionAnalysisChainTrigerredBysingleFileChange(parsedFilesInWorkspace map[string]*parser.GroupStatementNode, fileName string) []FileAnalysisAndError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FoldingRange ¶ added in v0.8.1
func FoldingRange(rootNode *parser.GroupStatementNode) ([]*parser.GroupStatementNode, []*parser.CommentNode)
func GoToDefinition ¶
func HasFileExtension ¶ added in v0.8.3
Report whether 'fileName' extension is found within 'extensions'
func OpenProjectFiles ¶
Recursively open files from 'rootDir'. However there is a depth limit for the recursion (current MAX_DEPTH = 5) TODO: expand authorized file extension to '.gohtml, .gohtmpl, .tmpl, .tpl, etc.'
Types ¶
type Error ¶
func DefinitionAnalysisSingleFile ¶
func DefinitionAnalysisSingleFile(fileName string, parsedFilesInWorkspace map[string]*parser.GroupStatementNode) (*checker.FileDefinition, []Error)
This version is inefficient but simplier to use Use 'DefinitionAnalysisChainTrigerredBysingleFileChange()' instead since it more performant and more accurate as well
func ParseFilesInWorkspace ¶
func ParseFilesInWorkspace(workspaceFiles map[string][]byte) (map[string]*parser.GroupStatementNode, []Error)
Parse all files within a workspace. The output is an AST node, and an error list containing parsing error and suggestions Never return nil, always an empty 'map' if nothing found
func ParseSingleFile ¶
func ParseSingleFile(source []byte) (*parser.GroupStatementNode, []Error)
Parse a file content (buffer). The output is an AST node, and an error list containing parsing error and suggestions Returned parse tree is never 'nil', even when empty
type FileAnalysisAndError ¶ added in v0.6.0
type FileAnalysisAndError struct {
FileName string
File *checker.FileDefinition
Errs []lexer.Error
}
func DefinitionAnalisisWithinWorkspace ¶
func DefinitionAnalisisWithinWorkspace(parsedFilesInWorkspace map[string]*parser.GroupStatementNode) []FileAnalysisAndError
Definition analysis for all files within a workspace. It should only be done after 'ParseFilesInWorkspace()' or similar
func DefinitionAnalysisChainTrigerredByBatchFileChange ¶ added in v0.6.0
func DefinitionAnalysisChainTrigerredByBatchFileChange(parsedFilesInWorkspace map[string]*parser.GroupStatementNode, fileNames ...string) []FileAnalysisAndError
Prefered function for computing the semantic analysis of many files change in a workspace
func DefinitionAnalysisChainTrigerredBysingleFileChange ¶ added in v0.6.0
func DefinitionAnalysisChainTrigerredBysingleFileChange(parsedFilesInWorkspace map[string]*parser.GroupStatementNode, fileName string) []FileAnalysisAndError
Prefered function for computing the semantic analysis of a file in a workspace This also compute the semantic analysis of other files affected by the change initiated by 'fileName' So this process the semantic analysis of 'fileName' and other file affected by the change