From 2d232c21a2ab611b551af967459ac6e25431f9e8 Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Tue, 17 Jan 2017 10:29:54 -0800 Subject: [PATCH 1/2] Support find-all-references for type keywords --- src/harness/fourslash.ts | 6 +- src/services/documentHighlights.ts | 18 +- src/services/findAllReferences.ts | 191 ++++++++++-------- src/services/services.ts | 31 ++- src/services/types.ts | 2 +- src/services/utilities.ts | 22 +- tests/cases/fourslash/findAllRefsPrimitive.ts | 33 +++ tests/cases/fourslash/fourslash.ts | 1 + tests/cases/fourslash/getOccurrencesOfAny.ts | 12 -- tests/cases/fourslash/localGetReferences.ts | 6 +- 10 files changed, 191 insertions(+), 131 deletions(-) create mode 100644 tests/cases/fourslash/findAllRefsPrimitive.ts delete mode 100644 tests/cases/fourslash/getOccurrencesOfAny.ts diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index 1afb6de2cf24d..6e9ab502e5218 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -1668,7 +1668,7 @@ namespace FourSlash { this.goToPosition(len); } - private goToRangeStart({fileName, start}: Range) { + public goToRangeStart({fileName, start}: Range) { this.openFile(fileName); this.goToPosition(start); } @@ -3082,6 +3082,10 @@ namespace FourSlashInterface { this.state.goToMarker(name); } + public rangeStart(range: FourSlash.Range) { + this.state.goToRangeStart(range); + } + public bof() { this.state.goToBOF(); } diff --git a/src/services/documentHighlights.ts b/src/services/documentHighlights.ts index 79fa0236bc5d6..778a007ded58c 100644 --- a/src/services/documentHighlights.ts +++ b/src/services/documentHighlights.ts @@ -17,25 +17,11 @@ namespace ts.DocumentHighlights { } function getSemanticDocumentHighlights(node: Node, typeChecker: TypeChecker, cancellationToken: CancellationToken, sourceFilesToSearch: SourceFile[]): DocumentHighlights[] { - if (node.kind === SyntaxKind.Identifier || - node.kind === SyntaxKind.ThisKeyword || - node.kind === SyntaxKind.ThisType || - node.kind === SyntaxKind.SuperKeyword || - node.kind === SyntaxKind.StringLiteral || - isLiteralNameOfPropertyDeclarationOrIndexAccess(node)) { - - const referencedSymbols = FindAllReferences.getReferencedSymbolsForNode(typeChecker, cancellationToken, node, sourceFilesToSearch, /*findInStrings*/ false, /*findInComments*/ false, /*implementations*/false); - return convertReferencedSymbols(referencedSymbols); - } - - return undefined; + const referencedSymbols = FindAllReferences.getReferencedSymbolsForNode(typeChecker, cancellationToken, node, sourceFilesToSearch, /*findInStrings*/false, /*findInComments*/false, /*implementations*/false); + return referencedSymbols && convertReferencedSymbols(referencedSymbols); } function convertReferencedSymbols(referencedSymbols: ReferencedSymbol[]): DocumentHighlights[] { - if (!referencedSymbols) { - return undefined; - } - const fileNameToDocumentHighlights = createMap(); const result: DocumentHighlights[] = []; for (const referencedSymbol of referencedSymbols) { diff --git a/src/services/findAllReferences.ts b/src/services/findAllReferences.ts index 090357a56b2d4..68eb684fe2582 100644 --- a/src/services/findAllReferences.ts +++ b/src/services/findAllReferences.ts @@ -1,29 +1,16 @@ /* @internal */ namespace ts.FindAllReferences { - export function findReferencedSymbols(typeChecker: TypeChecker, cancellationToken: CancellationToken, sourceFiles: SourceFile[], sourceFile: SourceFile, position: number, findInStrings: boolean, findInComments: boolean): ReferencedSymbol[] { + export function findReferencedSymbols(typeChecker: TypeChecker, cancellationToken: CancellationToken, sourceFiles: SourceFile[], sourceFile: SourceFile, position: number, findInStrings: boolean, findInComments: boolean): ReferencedSymbol[] | undefined { const node = getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true); - if (node === sourceFile) { - return undefined; - } - - switch (node.kind) { - case SyntaxKind.NumericLiteral: - if (!isLiteralNameOfPropertyDeclarationOrIndexAccess(node)) { - break; - } - // Fallthrough - case SyntaxKind.Identifier: - case SyntaxKind.ThisKeyword: - // case SyntaxKind.SuperKeyword: TODO:GH#9268 - case SyntaxKind.ConstructorKeyword: - case SyntaxKind.StringLiteral: - return getReferencedSymbolsForNode(typeChecker, cancellationToken, node, sourceFiles, findInStrings, findInComments, /*implementations*/false); - } - return undefined; + return getReferencedSymbolsForNode(typeChecker, cancellationToken, node, sourceFiles, findInStrings, findInComments, /*implementations*/false); } - export function getReferencedSymbolsForNode(typeChecker: TypeChecker, cancellationToken: CancellationToken, node: Node, sourceFiles: SourceFile[], findInStrings: boolean, findInComments: boolean, implementations: boolean): ReferencedSymbol[] { + export function getReferencedSymbolsForNode(typeChecker: TypeChecker, cancellationToken: CancellationToken, node: Node, sourceFiles: SourceFile[], findInStrings: boolean, findInComments: boolean, implementations: boolean): ReferencedSymbol[] | undefined { if (!implementations) { + if (isTypeKeyword(node.kind)) { + return getAllReferencesForKeyword(sourceFiles, node.kind, cancellationToken); + } + // Labels if (isLabelName(node)) { if (isJumpStatementTarget(node)) { @@ -68,8 +55,6 @@ namespace ts.FindAllReferences { return undefined; } - let result: ReferencedSymbol[]; - // Compute the meaning from the location and the symbol it references const searchMeaning = getIntersectingMeaningFromDeclarations(getMeaningFromLocation(node), declarations); @@ -84,6 +69,7 @@ namespace ts.FindAllReferences { // Maps from a symbol ID to the ReferencedSymbol entry in 'result'. const symbolToIndex: number[] = []; + let result: ReferencedSymbol[]; if (scope) { result = []; getReferencesInNode(scope, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result, symbolToIndex, implementations, typeChecker, cancellationToken); @@ -92,10 +78,7 @@ namespace ts.FindAllReferences { const internedName = getInternedName(symbol, node); for (const sourceFile of sourceFiles) { cancellationToken.throwIfCancellationRequested(); - - const nameTable = getNameTable(sourceFile); - - if (nameTable.get(internedName) !== undefined) { + if (sourceFileHasName(sourceFile, internedName)) { result = result || []; getReferencesInNode(sourceFile, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result, symbolToIndex, implementations, typeChecker, cancellationToken); } @@ -105,9 +88,13 @@ namespace ts.FindAllReferences { return result; } + function sourceFileHasName(sourceFile: SourceFile, name: string): boolean { + return getNameTable(sourceFile).get(name) !== undefined; + } + function getDefinition(symbol: Symbol, node: Node, typeChecker: TypeChecker): ReferencedSymbolDefinitionInfo { - const info = SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, node.getSourceFile(), getContainerNode(node), node); - const name = map(info.displayParts, p => p.text).join(""); + const { displayParts, symbolKind } = SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, node.getSourceFile(), getContainerNode(node), node); + const name = displayParts.map(p => p.text).join(""); const declarations = symbol.declarations; if (!declarations || declarations.length === 0) { return undefined; @@ -117,10 +104,10 @@ namespace ts.FindAllReferences { containerKind: "", containerName: "", name, - kind: info.symbolKind, + kind: symbolKind, fileName: declarations[0].getSourceFile().fileName, textSpan: createTextSpan(declarations[0].getStart(), 0), - displayParts: info.displayParts + displayParts }; } @@ -351,6 +338,45 @@ namespace ts.FindAllReferences { } } + function getAllReferencesForKeyword(sourceFiles: SourceFile[], keywordKind: ts.SyntaxKind, cancellationToken: CancellationToken): ReferencedSymbol[] { + const name = tokenToString(keywordKind); + const definition: ReferencedSymbolDefinitionInfo = { + containerKind: "", + containerName: "", + fileName: "", + kind: ScriptElementKind.keyword, + name, + textSpan: createTextSpan(0, 1), + displayParts: [{ text: name, kind: ScriptElementKind.keyword }] + } + + const references: ReferenceEntry[] = []; + for (const sourceFile of sourceFiles) { + cancellationToken.throwIfCancellationRequested(); + if (sourceFileHasName(sourceFile, name)) { + addReferencesForKeywordInFile(sourceFile, keywordKind, name, cancellationToken, references); + } + } + + return [{ definition, references }]; + } + + function addReferencesForKeywordInFile(sourceFile: SourceFile, kind: SyntaxKind, searchText: string, cancellationToken: CancellationToken, references: Push): void { + const possiblePositions = getPossibleSymbolReferencePositions(sourceFile, searchText, sourceFile.getStart(), sourceFile.getEnd(), cancellationToken); + for (const position of possiblePositions) { + cancellationToken.throwIfCancellationRequested(); + const referenceLocation = getTouchingPropertyName(sourceFile, position); + if (referenceLocation.kind === kind) { + references.push({ + textSpan: createTextSpanFromNode(referenceLocation), + fileName: sourceFile.fileName, + isWriteAccess: false, + isDefinition: false, + }); + } + } + } + /** Search within node "container" for references for a search value, where the search value is defined as a * tuple of(searchSymbol, searchText, searchLocation, and searchMeaning). * searchLocation: a node where the search value @@ -375,67 +401,64 @@ namespace ts.FindAllReferences { const parents = getParentSymbolsOfPropertyAccess(); const inheritsFromCache: Map = createMap(); + // Build the set of symbols to search for, initially it has only the current symbol + const searchSymbols = populateSearchSymbolSet(searchSymbol, searchLocation, typeChecker, implementations); - if (possiblePositions.length) { - // Build the set of symbols to search for, initially it has only the current symbol - const searchSymbols = populateSearchSymbolSet(searchSymbol, searchLocation, typeChecker, implementations); - - forEach(possiblePositions, position => { - cancellationToken.throwIfCancellationRequested(); + for (const position of possiblePositions) { + cancellationToken.throwIfCancellationRequested(); - const referenceLocation = getTouchingPropertyName(sourceFile, position); - if (!isValidReferencePosition(referenceLocation, searchText)) { - // This wasn't the start of a token. Check to see if it might be a - // match in a comment or string if that's what the caller is asking - // for. - if (!implementations && ((findInStrings && isInString(sourceFile, position)) || - (findInComments && isInNonReferenceComment(sourceFile, position)))) { - - // In the case where we're looking inside comments/strings, we don't have - // an actual definition. So just use 'undefined' here. Features like - // 'Rename' won't care (as they ignore the definitions), and features like - // 'FindReferences' will just filter out these results. - result.push({ - definition: undefined, - references: [{ - fileName: sourceFile.fileName, - textSpan: createTextSpan(position, searchText.length), - isWriteAccess: false, - isDefinition: false - }] - }); - } - return; + const referenceLocation = getTouchingPropertyName(sourceFile, position); + if (!isValidReferencePosition(referenceLocation, searchText)) { + // This wasn't the start of a token. Check to see if it might be a + // match in a comment or string if that's what the caller is asking + // for. + if (!implementations && ((findInStrings && isInString(sourceFile, position)) || + (findInComments && isInNonReferenceComment(sourceFile, position)))) { + + // In the case where we're looking inside comments/strings, we don't have + // an actual definition. So just use 'undefined' here. Features like + // 'Rename' won't care (as they ignore the definitions), and features like + // 'FindReferences' will just filter out these results. + result.push({ + definition: undefined, + references: [{ + fileName: sourceFile.fileName, + textSpan: createTextSpan(position, searchText.length), + isWriteAccess: false, + isDefinition: false + }] + }); } + continue; + } - if (!(getMeaningFromLocation(referenceLocation) & searchMeaning)) { - return; - } + if (!(getMeaningFromLocation(referenceLocation) & searchMeaning)) { + continue; + } - const referenceSymbol = typeChecker.getSymbolAtLocation(referenceLocation); - if (referenceSymbol) { - const referenceSymbolDeclaration = referenceSymbol.valueDeclaration; - const shorthandValueSymbol = typeChecker.getShorthandAssignmentValueSymbol(referenceSymbolDeclaration); - const relatedSymbol = getRelatedSymbol(searchSymbols, referenceSymbol, referenceLocation, - /*searchLocationIsConstructor*/ searchLocation.kind === SyntaxKind.ConstructorKeyword, parents, inheritsFromCache, typeChecker); + const referenceSymbol = typeChecker.getSymbolAtLocation(referenceLocation); + if (referenceSymbol) { + const referenceSymbolDeclaration = referenceSymbol.valueDeclaration; + const shorthandValueSymbol = typeChecker.getShorthandAssignmentValueSymbol(referenceSymbolDeclaration); + const relatedSymbol = getRelatedSymbol(searchSymbols, referenceSymbol, referenceLocation, + /*searchLocationIsConstructor*/ searchLocation.kind === SyntaxKind.ConstructorKeyword, parents, inheritsFromCache, typeChecker); - if (relatedSymbol) { - addReferenceToRelatedSymbol(referenceLocation, relatedSymbol); - } - /* Because in short-hand property assignment, an identifier which stored as name of the short-hand property assignment - * has two meaning : property name and property value. Therefore when we do findAllReference at the position where - * an identifier is declared, the language service should return the position of the variable declaration as well as - * the position in short-hand property assignment excluding property accessing. However, if we do findAllReference at the - * position of property accessing, the referenceEntry of such position will be handled in the first case. - */ - else if (!(referenceSymbol.flags & SymbolFlags.Transient) && searchSymbols.indexOf(shorthandValueSymbol) >= 0) { - addReferenceToRelatedSymbol(referenceSymbolDeclaration.name, shorthandValueSymbol); - } - else if (searchLocation.kind === SyntaxKind.ConstructorKeyword) { - findAdditionalConstructorReferences(referenceSymbol, referenceLocation); - } + if (relatedSymbol) { + addReferenceToRelatedSymbol(referenceLocation, relatedSymbol); } - }); + /* Because in short-hand property assignment, an identifier which stored as name of the short-hand property assignment + * has two meaning : property name and property value. Therefore when we do findAllReference at the position where + * an identifier is declared, the language service should return the position of the variable declaration as well as + * the position in short-hand property assignment excluding property accessing. However, if we do findAllReference at the + * position of property accessing, the referenceEntry of such position will be handled in the first case. + */ + else if (!(referenceSymbol.flags & SymbolFlags.Transient) && searchSymbols.indexOf(shorthandValueSymbol) >= 0) { + addReferenceToRelatedSymbol(referenceSymbolDeclaration.name, shorthandValueSymbol); + } + else if (searchLocation.kind === SyntaxKind.ConstructorKeyword) { + findAdditionalConstructorReferences(referenceSymbol, referenceLocation); + } + } } return; diff --git a/src/services/services.ts b/src/services/services.ts index 26374eccbfddb..20204165328f4 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1959,11 +1959,9 @@ namespace ts { function walk(node: Node) { switch (node.kind) { - case SyntaxKind.Identifier: { - const text = (node).text; - nameTable.set(text, nameTable.get(text) === undefined ? node.pos : -1); + case SyntaxKind.Identifier: + setNameTable((node).text, node); break; - } case SyntaxKind.StringLiteral: case SyntaxKind.NumericLiteral: // We want to store any numbers/strings if they were a name that could be @@ -1974,20 +1972,31 @@ namespace ts { node.parent.kind === SyntaxKind.ExternalModuleReference || isArgumentOfElementAccessExpression(node) || isLiteralComputedPropertyDeclarationName(node)) { - - const text = (node).text; - nameTable.set(text, nameTable.get(text) === undefined ? node.pos : -1); + setNameTable((node).text, node); } break; - default: + case SyntaxKind.TypeOperator: + setNameTable(tokenToString((node as ts.TypeOperatorNode).operator), node); forEachChild(node, walk); - if (node.jsDoc) { - for (const jsDoc of node.jsDoc) { - forEachChild(jsDoc, 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); + } } } } } + + function setNameTable(text: string, node: ts.Node): void { + nameTable.set(text, nameTable.get(text) === undefined ? node.pos : -1); + } } function isArgumentOfElementAccessExpression(node: Node) { diff --git a/src/services/types.ts b/src/services/types.ts index 88ffe2950ced8..42f2a7992bd8a 100644 --- a/src/services/types.ts +++ b/src/services/types.ts @@ -495,7 +495,7 @@ namespace ts { export interface SymbolDisplayPart { text: string; - kind: string; + kind: string; // A ScriptElementKind } export interface QuickInfo { diff --git a/src/services/utilities.ts b/src/services/utilities.ts index def7ab8e4bd85..dd337238da304 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -71,7 +71,10 @@ namespace ts { } export function getMeaningFromLocation(node: Node): SemanticMeaning { - if (node.parent.kind === SyntaxKind.ExportAssignment) { + if (node.kind === SyntaxKind.SourceFile) { + return SemanticMeaning.Value; + } + else if (node.parent.kind === SyntaxKind.ExportAssignment) { return SemanticMeaning.Value | SemanticMeaning.Type | SemanticMeaning.Namespace; } else if (isInRightSideOfImport(node)) { @@ -1116,6 +1119,23 @@ namespace ts { export function createTextSpanFromNode(node: Node, sourceFile?: SourceFile): TextSpan { return createTextSpanFromBounds(node.getStart(sourceFile), node.getEnd()); } + + export function isTypeKeyword(kind: SyntaxKind): boolean { + switch (kind) { + case SyntaxKind.AnyKeyword: + case SyntaxKind.BooleanKeyword: + case SyntaxKind.NeverKeyword: + case SyntaxKind.NumberKeyword: + case SyntaxKind.KeyOfKeyword: + case SyntaxKind.ObjectKeyword: + case SyntaxKind.StringKeyword: + case SyntaxKind.SymbolKeyword: + case SyntaxKind.VoidKeyword: + return true; + default: + return false; + } + } } // Display-part writer helpers diff --git a/tests/cases/fourslash/findAllRefsPrimitive.ts b/tests/cases/fourslash/findAllRefsPrimitive.ts new file mode 100644 index 0000000000000..9bd3d62eabb5b --- /dev/null +++ b/tests/cases/fourslash/findAllRefsPrimitive.ts @@ -0,0 +1,33 @@ +// @noLib: true + +/// + +// @Filename: a.ts +////const x: [|any|] = 0; +////const any = 2; +////const y: [|any|] = any; + +////function f(b: [|boolean|]): [|boolean|]; + +////type T = [|never|]; type U = [|never|]; + +////function n(x: [|number|]): [|number|]; + +////function o(x: [|object|]): [|object|]; + +////function s(x: [|string|]): [|string|]; + +////function sy(s: [|symbol|]): [|symbol|]; + +////function v(v: [|void|]): [|void|]; + +////function k(x: [|keyof|] Date): [|keyof|] Date; + +// @Filename: b.ts +// const z: [|any|] = 0; + +verify.rangesWithSameTextReferenceEachOther(); +verify.rangesWithSameTextAreDocumentHighlights(); + +goTo.rangeStart(test.ranges()[0]); +verify.renameInfoFailed(); diff --git a/tests/cases/fourslash/fourslash.ts b/tests/cases/fourslash/fourslash.ts index ed09fcd2c92b6..d0293585a4eed 100644 --- a/tests/cases/fourslash/fourslash.ts +++ b/tests/cases/fourslash/fourslash.ts @@ -118,6 +118,7 @@ declare namespace FourSlashInterface { } class goTo { marker(name?: string): void; + rangeStart(range: Range): void; bof(): void; eof(): void; implementation(): void; diff --git a/tests/cases/fourslash/getOccurrencesOfAny.ts b/tests/cases/fourslash/getOccurrencesOfAny.ts deleted file mode 100644 index c28dd83b422c2..0000000000000 --- a/tests/cases/fourslash/getOccurrencesOfAny.ts +++ /dev/null @@ -1,12 +0,0 @@ -/// - -////var obj1: { -//// (bar: any): any; -//// new (bar: any): any; -//// [bar: any]: any; -//// bar: any; -//// foob(bar: any): an/**/y; -////}; - -goTo.marker(); -verify.occurrencesAtPositionCount(0); diff --git a/tests/cases/fourslash/localGetReferences.ts b/tests/cases/fourslash/localGetReferences.ts index fa9e59cabcfc3..d8e64be1ada3e 100644 --- a/tests/cases/fourslash/localGetReferences.ts +++ b/tests/cases/fourslash/localGetReferences.ts @@ -3,7 +3,7 @@ // @Filename: localGetReferences_1.ts ////// Comment Refence Test: g/*1*/lobalVar ////// References to a variable declared in global. -////var [|globalVar|]: n/*2*/umber = 2; +////var [|globalVar|]: number = 2; //// ////class fooCls { //// // References to static variable declared in a class. @@ -189,10 +189,6 @@ goTo.marker("1"); verify.referencesAre([]); -// References to type. -goTo.marker("2"); -verify.referencesAre([]); - // References to unresolved symbol. goTo.marker("3"); verify.referencesAre([]); From 1267fd3030a588eb29dcf7ad0e4bb3c8887a59fb Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Fri, 20 Jan 2017 06:41:57 -0800 Subject: [PATCH 2/2] Don't use nameTable for type keywords, and don't handle keyof. --- src/services/findAllReferences.ts | 4 +--- src/services/services.ts | 17 ++++------------- src/services/utilities.ts | 3 +-- tests/cases/fourslash/findAllRefsPrimitive.ts | 2 -- 4 files changed, 6 insertions(+), 20 deletions(-) diff --git a/src/services/findAllReferences.ts b/src/services/findAllReferences.ts index 68eb684fe2582..82a5da453b7db 100644 --- a/src/services/findAllReferences.ts +++ b/src/services/findAllReferences.ts @@ -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 }]; diff --git a/src/services/services.ts b/src/services/services.ts index 20204165328f4..1fe2235a4bace 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1975,20 +1975,11 @@ namespace ts { setNameTable((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); } } } diff --git a/src/services/utilities.ts b/src/services/utilities.ts index dd337238da304..a1680da69c320 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -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: diff --git a/tests/cases/fourslash/findAllRefsPrimitive.ts b/tests/cases/fourslash/findAllRefsPrimitive.ts index 9bd3d62eabb5b..51c463843e196 100644 --- a/tests/cases/fourslash/findAllRefsPrimitive.ts +++ b/tests/cases/fourslash/findAllRefsPrimitive.ts @@ -21,8 +21,6 @@ ////function v(v: [|void|]): [|void|]; -////function k(x: [|keyof|] Date): [|keyof|] Date; - // @Filename: b.ts // const z: [|any|] = 0;