-
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.
Fix an off-by-one error in getBaseDirectoriesFromRootDirs (#55233)
Co-authored-by: Phoebe Szmucer <[email protected]>
- Loading branch information
1 parent
fdb2531
commit eb2d1f9
Showing
3 changed files
with
73 additions
and
2 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
37 changes: 37 additions & 0 deletions
37
tests/cases/fourslash/completionForStringLiteralRelativeImport5.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,37 @@ | ||
/// <reference path='fourslash.ts' /> | ||
|
||
// Should give correct completions for directories when invoked from within nested folders | ||
|
||
// @rootDirs: /repo/src1,/repo/src2/,/repo/generated1,/repo/generated2/ | ||
|
||
// @Filename: /dir/secret_file.ts | ||
//// /*secret_file*/ | ||
|
||
// @Filename: /repo/src1/dir/test1.ts | ||
//// import * as foo1 from ".//*import_as1*/ | ||
//// import foo2 = require(".//*import_equals1*/ | ||
//// var foo3 = require(".//*require1*/ | ||
|
||
// @Filename: /repo/src2/dir/test2.ts | ||
//// import * as foo1 from ".//*import_as2*/ | ||
//// import foo2 = require(".//*import_equals2*/ | ||
//// var foo3 = require(".//*require2*/ | ||
|
||
// @Filename: /repo/generated1/dir/f1.ts | ||
//// /*f1*/ | ||
|
||
// @Filename: /repo/generated2/dir/f2.ts | ||
//// /*f2*/ | ||
|
||
verify.completions( | ||
{ | ||
marker: ["import_as1", "import_equals1", "require1"], | ||
unsorted: ["f1", "f2", "test2"], | ||
isNewIdentifierLocation: true, | ||
}, | ||
{ | ||
marker: ["import_as2", "import_equals2", "require2"], | ||
unsorted: ["f1", "f2", "test1"], | ||
isNewIdentifierLocation: true, | ||
} | ||
); |
34 changes: 34 additions & 0 deletions
34
tests/cases/fourslash/completionForStringLiteralRelativeImport6.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,34 @@ | ||
/// <reference path='fourslash.ts' /> | ||
|
||
// Should give correct completions for rootDirs regardless of the slash at the end | ||
|
||
// @rootDirs: /repo/src1,/repo/src2/,/repo/generated1,/repo/generated2/ | ||
|
||
// @Filename: /repo/src1/test1.ts | ||
//// import * as foo1 from "./dir//*import_as1*/ | ||
//// import foo2 = require("./dir//*import_equals1*/ | ||
//// var foo3 = require("./dir//*require1*/ | ||
|
||
// @Filename: /repo/src2/test2.ts | ||
//// import * as foo1 from "./dir//*import_as2*/ | ||
//// import foo2 = require("./dir//*import_equals2*/ | ||
//// var foo3 = require("./dir//*require2*/ | ||
|
||
// @Filename: /repo/generated1/dir/f1.ts | ||
//// /*f1*/ | ||
|
||
// @Filename: /repo/generated2/dir/f2.ts | ||
//// /*f2*/ | ||
|
||
verify.completions( | ||
{ | ||
marker: ["import_as1", "import_equals1", "require1"], | ||
exact: ["f1", "f2"], | ||
isNewIdentifierLocation: true, | ||
}, | ||
{ | ||
marker: ["import_as2", "import_equals2", "require2"], | ||
exact: ["f1", "f2"], | ||
isNewIdentifierLocation: true, | ||
} | ||
); |