mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-15 11:35:42 -06:00
Fix relative path completions when self package.json has typesVersions (#54842)
This commit is contained in:
parent
4d7738ca21
commit
76869eeda1
@ -598,7 +598,7 @@ function getCompletionEntriesForRelativeModules(literalValue: string, scriptDire
|
||||
compilerOptions.rootDirs, literalValue, scriptDirectory, extensionOptions, compilerOptions, host, scriptPath);
|
||||
}
|
||||
else {
|
||||
return arrayFrom(getCompletionEntriesForDirectoryFragment(literalValue, scriptDirectory, extensionOptions, host, /*moduleSpecifierIsRelative*/ false, scriptPath).values());
|
||||
return arrayFrom(getCompletionEntriesForDirectoryFragment(literalValue, scriptDirectory, extensionOptions, host, /*moduleSpecifierIsRelative*/ true, scriptPath).values());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
22
tests/cases/fourslash/pathCompletionsTypesVersionsLocal.ts
Normal file
22
tests/cases/fourslash/pathCompletionsTypesVersionsLocal.ts
Normal file
@ -0,0 +1,22 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @Filename: /package.json
|
||||
//// {
|
||||
//// "typesVersions": {
|
||||
//// "*": {
|
||||
//// "*": ["./src/*"]
|
||||
//// }
|
||||
//// }
|
||||
//// }
|
||||
|
||||
// @Filename: /src/add.ts
|
||||
//// export function add(a: number, b: number) { return a + b; }
|
||||
|
||||
// @Filename: /src/index.ts
|
||||
//// import { add } from ".//**/";
|
||||
|
||||
verify.completions({
|
||||
marker: "",
|
||||
isNewIdentifierLocation: true,
|
||||
exact: ["add"],
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user