Skip to content

Commit

Permalink
fix(typescript): don't emit absvar nodes (#5273)
Browse files Browse the repository at this point in the history
  • Loading branch information
zrlk committed May 4, 2022
1 parent a8cbbde commit 1e4467b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 93 deletions.
18 changes: 3 additions & 15 deletions kythe/typescript/indexer.ts
Expand Up @@ -875,21 +875,6 @@ class Visitor {
`type param ${param.getText()} has no symbol`);
return;
}
const kType = this.host.getSymbolName(sym, TSNamespace.TYPE);
var superType: VName|undefined;
if (kType) {
this.emitNode(kType, NodeKind.ABSVAR);
this.emitEdge(
this.newAnchor(param.name), EdgeKind.DEFINES_BINDING, kType);
// ...<T extends A>
if (param.constraint) {
superType = this.visitType(param.constraint);
if (superType)
this.emitEdge(kType, EdgeKind.BOUNDED_UPPER, superType);
}
// ...<T = A>
if (param.default) this.visitType(param.default);
}
const kTVar = this.host.getSymbolName(sym, TSNamespace.TYPE_MIGRATION);
if (kTVar && parent) {
this.emitNode(kTVar, NodeKind.TVAR);
Expand All @@ -900,9 +885,12 @@ class Visitor {
this.emitEdge(parent, makeOrdinalEdge(EdgeKind.TPARAM, ordinal), kTVar);
// ...<T extends A>
if (param.constraint) {
var superType = this.visitType(param.constraint);
if (superType)
this.emitEdge(kTVar, EdgeKind.BOUNDED_UPPER, superType);
}
// ...<T = A>
if (param.default) this.visitType(param.default);
}
}
}
Expand Down
77 changes: 0 additions & 77 deletions kythe/typescript/testdata/generic.ts

This file was deleted.

2 changes: 1 addition & 1 deletion kythe/typescript/testdata/schema.ts
Expand Up @@ -101,7 +101,7 @@ let v = {
//- @AliasArray defines/binding VName("AliasArray#type", _, _, "testdata/schema", "typescript")
type AliasArray<
// TypeParameter
//- @#0"T" defines/binding VName("AliasArray.T#type", _, _, "testdata/schema", "typescript")
//- @#0"T" defines/binding VName("AliasArray.T#mtype", _, _, "testdata/schema", "typescript")
T> = Array<T>;

//- @arrowFun defines/binding VName("arrowFun", _, _, "testdata/schema", "typescript")
Expand Down

0 comments on commit 1e4467b

Please sign in to comment.