Skip to content

Commit fe761ad

Browse files
Debug parent symbol
1 parent e61f73a commit fe761ad

3 files changed

Lines changed: 16 additions & 11 deletions

File tree

packages/pyright-scip/src/lsif-typescript/Descriptor.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ type Suffix = scip.Descriptor.Suffix;
66
const Suffix = scip.Descriptor.Suffix;
77

88
export function packageDescriptor(name: string): Descriptor {
9-
if (name === '') {
10-
throw new Error('Package name cannot be empty');
11-
}
9+
// if (name === '') {
10+
// throw new Error('Package name cannot be empty');
11+
// }
1212
return new Descriptor({ name, suffix: Suffix.Namespace });
1313
}
1414

packages/pyright-scip/src/symbols.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ export function makeModule(pythonPackage: PythonPackage, moduleName: string): Sc
2727
if (ns) {
2828
moduleName = ns + '.' + moduleName;
2929
}
30-
if (moduleName === '') {
31-
throw new Error(
32-
`Module name is empty namespace = ${ns}, pkgname = ${pythonPackage.name}, map = ${JSON.stringify(
33-
Object.fromEntries(namespaces)
34-
)}`
35-
);
36-
}
30+
// if (moduleName === '') {
31+
// throw new Error(
32+
// `Module name is empty namespace = ${ns}, pkgname = ${pythonPackage.name}, map = ${JSON.stringify(
33+
// Object.fromEntries(namespaces)
34+
// )}`
35+
// );
36+
// }
3737

3838
return ScipSymbol.global(makePackage(pythonPackage), packageDescriptor(moduleName));
3939
}

packages/pyright-scip/src/treeVisitor.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1091,7 +1091,12 @@ export class TreeVisitor extends ParseTreeWalker {
10911091
return Symbols.makeParameter(this.getScipSymbol(node.parent!), node.name.value);
10921092
}
10931093
case ParseNodeType.Class: {
1094-
return Symbols.makeType(this.getScipSymbol(node.parent!), (node as ClassNode).name.value);
1094+
const x = (node as ClassNode).name.value;
1095+
const parentSym = this.getScipSymbol(node.parent!);
1096+
if (x.indexOf('SuchNestedMuchWow') !== -1) {
1097+
console.log(`parentSym = ${parentSym.value} for SuchNestedMuchWow`);
1098+
}
1099+
return Symbols.makeType(parentSym, x);
10951100
}
10961101
case ParseNodeType.Function: {
10971102
let cls = ParseTreeUtils.getEnclosingClass(node, false);

0 commit comments

Comments
 (0)