Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(typescript): don't emit absvar nodes #5273

Merged
merged 1 commit into from
May 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 3 additions & 15 deletions kythe/typescript/indexer.ts
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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