Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Fix auto import crash due to difference in
paths
handling (#50419)
- Loading branch information
1 parent
12eb519
commit 38076df
Showing
5 changed files
with
87 additions
and
48 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
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,49 @@ | ||
/// <reference path="fourslash.ts" /> | ||
|
||
// @Filename: /tsconfig.json | ||
//// { | ||
//// "compilerOptions": { | ||
//// "module": "esnext", | ||
//// "paths": { | ||
//// "@reduxjs/toolkit": ["src/index.ts"], | ||
//// "@internal/*": ["src/*"] | ||
//// } | ||
//// } | ||
//// } | ||
|
||
// @Filename: /src/index.ts | ||
//// export { configureStore } from "./configureStore"; | ||
|
||
// @Filename: /src/configureStore.ts | ||
//// export function configureStore() {} | ||
|
||
// @Filename: /src/tests/createAsyncThunk.typetest.ts | ||
//// import {} from "@reduxjs/toolkit"; | ||
//// /**/ | ||
|
||
verify.completions({ | ||
marker: "", | ||
includes: [{ | ||
name: "configureStore", | ||
source: "@reduxjs/toolkit", | ||
sourceDisplay: "@reduxjs/toolkit", | ||
hasAction: true, | ||
sortText: completion.SortText.AutoImportSuggestions, | ||
}], | ||
preferences: { | ||
allowIncompleteCompletions: true, | ||
includeCompletionsForModuleExports: true, | ||
}, | ||
}); | ||
|
||
verify.applyCodeActionFromCompletion("", { | ||
name: "configureStore", | ||
source: "@reduxjs/toolkit", | ||
data: { | ||
exportName: "configureStore", | ||
fileName: "/src/configureStore.ts", | ||
moduleSpecifier: "@reduxjs/toolkit", | ||
}, | ||
description: `Update import from "@reduxjs/toolkit"`, | ||
newFileContent: `import { configureStore } from "@reduxjs/toolkit";\n`, | ||
}); |
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