-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replace whole path if directory separator appears for import completi…
…on. (#41412) * replace whole path if directory separator appears. * Fix. * revert change. * Fix test case. * add test. * fix as suggested. * revert useless change * adapt to code change. * fix baseline for test file.
- Loading branch information
1 parent
242e020
commit d5779c7
Showing
4 changed files
with
111 additions
and
4 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
40 changes: 40 additions & 0 deletions
40
tests/cases/fourslash/completionForStringLiteralNonrelativeImport16.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,40 @@ | ||
/// <reference path='fourslash.ts' /> | ||
|
||
// Should give completions for modules referenced via baseUrl and paths compiler options with explicit name mappings | ||
|
||
// @Filename: tsconfig.json | ||
//// { | ||
//// "compilerOptions": { | ||
//// "baseUrl": "./", | ||
//// "paths": { | ||
//// "module1/path1": ["some/path/whatever.ts"], | ||
//// } | ||
//// } | ||
//// } | ||
|
||
// @Filename: test0.ts | ||
//// import * as foo1 from "m/*first*/ | ||
//// import * as foo1 from "module1/pa/*second*/ | ||
|
||
// @Filename: some/path/whatever.ts | ||
//// export var x = 9; | ||
|
||
verify.completions({ marker: ["first"], exact: ["test0", "some", { | ||
name: "module1/path1", | ||
replacementSpan: { | ||
fileName: "foo", | ||
pos: 23, | ||
end: 24 | ||
} | ||
}], isNewIdentifierLocation: true }); | ||
|
||
verify.completions({ | ||
marker: ["second"], exact: [{ | ||
name: "module1/path1", | ||
replacementSpan: { | ||
fileName: "foo", | ||
pos: 48, | ||
end: 58 | ||
} | ||
}], isNewIdentifierLocation: true | ||
}); |