Fix getter of local symbol for export= when it is json module
Fixes #24341
This commit is contained in:
parent
56f33ad3bb
commit
a0d4e4f059
|
@ -579,6 +579,9 @@ namespace ts.FindAllReferences {
|
|||
else if (isBinaryExpression(decl)) { // `module.exports = class {}`
|
||||
return Debug.assertDefined(decl.right.symbol);
|
||||
}
|
||||
else if (isSourceFile(decl)) { // json module
|
||||
return Debug.assertDefined(decl.symbol);
|
||||
}
|
||||
return Debug.fail();
|
||||
}
|
||||
|
||||
|
|
14
tests/cases/fourslash/findAllReferencesOfJsonModule.ts
Normal file
14
tests/cases/fourslash/findAllReferencesOfJsonModule.ts
Normal file
|
@ -0,0 +1,14 @@
|
|||
/// <reference path='fourslash.ts' />
|
||||
|
||||
// @resolveJsonModule: true
|
||||
// @module: commonjs
|
||||
// @esModuleInterop: true
|
||||
|
||||
// @Filename: /foo.ts
|
||||
////import [|{| "isWriteAccess": true, "isDefinition": true |}settings|] from "./settings.json";
|
||||
////[|settings|];
|
||||
|
||||
// @Filename: /settings.json
|
||||
//// {}
|
||||
|
||||
verify.singleReferenceGroup("import settings");
|
Loading…
Reference in a new issue