Fixed isolated file indexing
This commit is contained in:
@@ -182,7 +182,13 @@ func (pt *ProjectTree) AddFile(file string, config *parser.Configuration) {
|
||||
}
|
||||
|
||||
if config.Package == nil {
|
||||
pt.populateNode(pt.Root, file, config)
|
||||
node := &ProjectNode{
|
||||
Children: make(map[string]*ProjectNode),
|
||||
Metadata: make(map[string]string),
|
||||
Variables: make(map[string]VariableInfo),
|
||||
}
|
||||
pt.IsolatedFiles[file] = node
|
||||
pt.populateNode(node, file, config)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -716,9 +716,16 @@ func HandleCompletion(params CompletionParams) *CompletionList {
|
||||
return nil
|
||||
}
|
||||
|
||||
func suggestGAMSignals(_ *index.ProjectNode, direction string) *CompletionList {
|
||||
func suggestGAMSignals(container *index.ProjectNode, direction string) *CompletionList {
|
||||
var items []CompletionItem
|
||||
|
||||
// Find scope root
|
||||
root := container
|
||||
for root.Parent != nil {
|
||||
root = root.Parent
|
||||
}
|
||||
|
||||
var walk func(*index.ProjectNode)
|
||||
processNode := func(node *index.ProjectNode) {
|
||||
if !isDataSource(node) {
|
||||
return
|
||||
@@ -776,7 +783,13 @@ func suggestGAMSignals(_ *index.ProjectNode, direction string) *CompletionList {
|
||||
}
|
||||
}
|
||||
|
||||
Tree.Walk(processNode)
|
||||
walk = func(n *index.ProjectNode) {
|
||||
processNode(n)
|
||||
for _, child := range n.Children {
|
||||
walk(child)
|
||||
}
|
||||
}
|
||||
walk(root)
|
||||
|
||||
if len(items) > 0 {
|
||||
return &CompletionList{Items: items}
|
||||
|
||||
Reference in New Issue
Block a user