8000 More debugging · codemuse-app/scip-python@d281e5f · GitHub
[go: up one dir, main page]

Skip to content

Commit d281e5f

Browse files
More debugging
1 parent fe761ad commit d281e5f

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

packages/pyright-scip/src/treeVisitor.ts

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -894,9 +894,16 @@ export class TreeVisitor extends ParseTreeWalker {
894894
}
895895
}
896896

897-
private getScipSymbol(node: ParseNode, opts: ScipSymbolOptions | undefined = undefined): ScipSymbol {
897+
private getScipSymbol(
898+
node: ParseNode,
899+
debug: boolean = false,
900+
opts: ScipSymbolOptions | undefined = undefined
901+
): ScipSymbol {
898902
const existing = this.rawGetLsifSymbol(node);
899903
if (existing) {
904+
if (debug) {
905+
console.log('got existing');
906+
}
900907
return existing;
901908
}
902909

@@ -922,6 +929,9 @@ export class TreeVisitor extends ParseTreeWalker {
922929
}
923930

924931
moduleName = nodeFileInfo.moduleName;
932+
if (debug) {
933+
console.log(`moduleName = ${moduleName}`);
934+
}
925935
if (moduleName == 'builtins') {
926936
return this.emitBuiltinScipSymbol(node);
927937
} else if (Hardcoded.stdlib_module_names.has(moduleName)) {
@@ -1092,11 +1102,14 @@ export class TreeVisitor extends ParseTreeWalker {
10921102
}
10931103
case ParseNodeType.Class: {
10941104
const x = (node as ClassNode).name.value;
1095-
const parentSym = this.getScipSymbol(node.parent!);
1105+
const parentSym =
1106+
x.indexOf('SuchNestedMuchWow') !== -1
1107+
? this.getScipSymbol(node.parent!, true)
1108+
: this.getScipSymbol(node.parent!);
10961109
if (x.indexOf('SuchNestedMuchWow') !== -1) {
10971110
console.log(`parentSym = ${parentSym.value} for SuchNestedMuchWow`);
10981111
}
1099-
return Symbols.makeType(parentSym, x);
1112+
return Symbols.makeType(parentSym, x); // Varun: bad call here
11001113
}
11011114
case ParseNodeType.Function: {
11021115
let cls = ParseTreeUtils.getEnclosingClass(node, false);

0 commit comments

Comments
 (0)
0