Skip to content

Commit

Permalink
fix getRepoInfos which sometimes yield in wrong/missing IntelliSense
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken committed Apr 30, 2020
1 parent e06275b commit ba849fb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/utils.ts
Expand Up @@ -15,17 +15,19 @@ export function* getRepoInfos(doc: QueryDocumentNode, project: Project, node: Qu

const repoStrings: string[] = [];

let stack: Node[] = [node];
let stack: { node: Node, doc: QueryDocumentNode; }[] = [{ doc, node }];

while (stack.length) {

Utils.walk(stack.shift()!, (node, parent) => {
const { doc, node } = stack.shift()!;

Utils.walk(node, (node, parent) => {

if (node._type === NodeType.VariableName && parent?._type !== NodeType.VariableDefinition) {
// check variables
let symbol = project.symbols.getFirst(node.value);
if (symbol) {
stack.push(symbol.def);
stack.push({ node: symbol.def, doc: symbol.root });
}

} else if (node._type === NodeType.QualifiedValue && node.qualifier.value === 'repo') {
Expand Down

0 comments on commit ba849fb

Please sign in to comment.