mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-04 21:53:42 -06:00
fix(54580): Bad operation for find-all-references on import.meta when meta occurs in a comment (#54581)
This commit is contained in:
parent
eeed72171f
commit
af075841c5
@ -1725,7 +1725,10 @@ export namespace Core {
|
||||
}
|
||||
|
||||
function getPossibleSymbolReferenceNodes(sourceFile: SourceFile, symbolName: string, container: Node = sourceFile): readonly Node[] {
|
||||
return getPossibleSymbolReferencePositions(sourceFile, symbolName, container).map(pos => getTouchingPropertyName(sourceFile, pos));
|
||||
return mapDefined(getPossibleSymbolReferencePositions(sourceFile, symbolName, container), pos => {
|
||||
const referenceLocation = getTouchingPropertyName(sourceFile, pos);
|
||||
return referenceLocation === sourceFile ? undefined : referenceLocation;
|
||||
});
|
||||
}
|
||||
|
||||
function getPossibleSymbolReferencePositions(sourceFile: SourceFile, symbolName: string, container: Node = sourceFile): readonly number[] {
|
||||
|
||||
@ -0,0 +1,25 @@
|
||||
// === findAllReferences ===
|
||||
// === /tests/cases/fourslash/findAllReferencesImportMeta.ts ===
|
||||
// // Haha that's so meta!
|
||||
//
|
||||
// let x = import.[|meta|]/*FIND ALL REFS*/;
|
||||
|
||||
// === Definitions ===
|
||||
// === /tests/cases/fourslash/findAllReferencesImportMeta.ts ===
|
||||
// // Haha that's so meta!
|
||||
//
|
||||
// let x = import.[|meta|]/*FIND ALL REFS*/;
|
||||
|
||||
// === Details ===
|
||||
[
|
||||
{
|
||||
"containerKind": "",
|
||||
"containerName": "",
|
||||
"kind": "keyword",
|
||||
"displayParts": [
|
||||
{
|
||||
"kind": "keyword"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
7
tests/cases/fourslash/findAllReferencesImportMeta.ts
Normal file
7
tests/cases/fourslash/findAllReferencesImportMeta.ts
Normal file
@ -0,0 +1,7 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
////// Haha that's so meta!
|
||||
////
|
||||
////let x = import.meta/**/;
|
||||
|
||||
verify.baselineFindAllReferences("");
|
||||
Loading…
x
Reference in New Issue
Block a user