Skip to content

Commit 76869ee

Browse files
authored
Fix relative path completions when self package.json has typesVersions (#54842)
1 parent 4d7738c commit 76869ee

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

src/services/stringCompletions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ function getCompletionEntriesForRelativeModules(literalValue: string, scriptDire
598598
compilerOptions.rootDirs, literalValue, scriptDirectory, extensionOptions, compilerOptions, host, scriptPath);
599599
}
600600
else {
601-
return arrayFrom(getCompletionEntriesForDirectoryFragment(literalValue, scriptDirectory, extensionOptions, host, /*moduleSpecifierIsRelative*/ false, scriptPath).values());
601+
return arrayFrom(getCompletionEntriesForDirectoryFragment(literalValue, scriptDirectory, extensionOptions, host, /*moduleSpecifierIsRelative*/ true, scriptPath).values());
602602
}
603603
}
604604

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/// <reference path="fourslash.ts" />
2+
3+
// @Filename: /package.json
4+
//// {
5+
//// "typesVersions": {
6+
//// "*": {
7+
//// "*": ["./src/*"]
8+
//// }
9+
//// }
10+
//// }
11+
12+
// @Filename: /src/add.ts
13+
//// export function add(a: number, b: number) { return a + b; }
14+
15+
// @Filename: /src/index.ts
16+
//// import { add } from ".//**/";
17+
18+
verify.completions({
19+
marker: "",
20+
isNewIdentifierLocation: true,
21+
exact: ["add"],
22+
});

0 commit comments

Comments
 (0)