Don't use nameTable for type keywords, and don't handle keyof.
This commit is contained in:
parent
2d232c21a2
commit
1267fd3030
4 changed files with 6 additions and 20 deletions
|
@ -353,9 +353,7 @@ namespace ts.FindAllReferences {
|
|||
const references: ReferenceEntry[] = [];
|
||||
for (const sourceFile of sourceFiles) {
|
||||
cancellationToken.throwIfCancellationRequested();
|
||||
if (sourceFileHasName(sourceFile, name)) {
|
||||
addReferencesForKeywordInFile(sourceFile, keywordKind, name, cancellationToken, references);
|
||||
}
|
||||
addReferencesForKeywordInFile(sourceFile, keywordKind, name, cancellationToken, references);
|
||||
}
|
||||
|
||||
return [{ definition, references }];
|
||||
|
|
|
@ -1975,20 +1975,11 @@ namespace ts {
|
|||
setNameTable((<LiteralExpression>node).text, node);
|
||||
}
|
||||
break;
|
||||
case SyntaxKind.TypeOperator:
|
||||
setNameTable(tokenToString((node as ts.TypeOperatorNode).operator), node);
|
||||
forEachChild(node, walk);
|
||||
break;
|
||||
default:
|
||||
if (isTypeKeyword(node.kind)) {
|
||||
setNameTable(tokenToString(node.kind), node);
|
||||
}
|
||||
else {
|
||||
forEachChild(node, walk);
|
||||
if (node.jsDoc) {
|
||||
for (const jsDoc of node.jsDoc) {
|
||||
forEachChild(jsDoc, walk);
|
||||
}
|
||||
forEachChild(node, walk);
|
||||
if (node.jsDoc) {
|
||||
for (const jsDoc of node.jsDoc) {
|
||||
forEachChild(jsDoc, walk);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// These utilities are common to multiple language service features.
|
||||
// These utilities are common to multiple language service features.
|
||||
/* @internal */
|
||||
namespace ts {
|
||||
export const scanner: Scanner = createScanner(ScriptTarget.Latest, /*skipTrivia*/ true);
|
||||
|
@ -1126,7 +1126,6 @@ namespace ts {
|
|||
case SyntaxKind.BooleanKeyword:
|
||||
case SyntaxKind.NeverKeyword:
|
||||
case SyntaxKind.NumberKeyword:
|
||||
case SyntaxKind.KeyOfKeyword:
|
||||
case SyntaxKind.ObjectKeyword:
|
||||
case SyntaxKind.StringKeyword:
|
||||
case SyntaxKind.SymbolKeyword:
|
||||
|
|
|
@ -21,8 +21,6 @@
|
|||
|
||||
////function v(v: [|void|]): [|void|];
|
||||
|
||||
////function k(x: [|keyof|] Date): [|keyof|] Date;
|
||||
|
||||
// @Filename: b.ts
|
||||
// const z: [|any|] = 0;
|
||||
|
||||
|
|
Loading…
Reference in a new issue