forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Suggest json files in completion when resolveJsonModule is set and mo…
…dule resolution is node Fixes microsoft#23899
- Loading branch information
1 parent
004a558
commit b4de840
Showing
5 changed files
with
57 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/// <reference path="fourslash.ts" /> | ||
|
||
// @moduleResolution: node | ||
// @resolveJsonModule: true | ||
|
||
// @Filename: /project/node_modules/test.json | ||
////not read | ||
|
||
// @Filename: /project/index.ts | ||
////import { } from "/**/"; | ||
|
||
verify.completionsAt("", ["test.json"], { isNewIdentifierLocation: true }); |
12 changes: 12 additions & 0 deletions
12
tests/cases/fourslash/completionsPathsJsonModuleWithAmd.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/// <reference path="fourslash.ts" /> | ||
|
||
// @module: amd | ||
// @resolveJsonModule: true | ||
|
||
// @Filename: /project/test.json | ||
////not read | ||
|
||
// @Filename: /project/index.ts | ||
////import { } from ".//**/"; | ||
|
||
verify.completionsAt("", [], { isNewIdentifierLocation: true }); |
11 changes: 11 additions & 0 deletions
11
tests/cases/fourslash/completionsPathsJsonModuleWithoutResolveJsonModule.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/// <reference path="fourslash.ts" /> | ||
|
||
// @moduleResolution: node | ||
|
||
// @Filename: /project/test.json | ||
////not read | ||
|
||
// @Filename: /project/index.ts | ||
////import { } from ".//**/"; | ||
|
||
verify.completionsAt("", [], { isNewIdentifierLocation: true }); |
12 changes: 12 additions & 0 deletions
12
tests/cases/fourslash/completionsPathsRelativeJsonModule.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/// <reference path="fourslash.ts" /> | ||
|
||
// @moduleResolution: node | ||
// @resolveJsonModule: true | ||
|
||
// @Filename: /project/test.json | ||
////not read | ||
|
||
// @Filename: /project/index.ts | ||
////import { } from ".//**/"; | ||
|
||
verify.completionsAt("", ["test.json"], { isNewIdentifierLocation: true }); |