mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-18 17:27:54 -05:00
fix(52233): Ambient modules declared with patterns are offered in path completions (#52246)
This commit is contained in:
@@ -1025,7 +1025,7 @@ function removeLeadingDirectorySeparator(path: string): string {
|
||||
function getAmbientModuleCompletions(fragment: string, fragmentDirectory: string | undefined, checker: TypeChecker): readonly string[] {
|
||||
// Get modules that the type checker picked up
|
||||
const ambientModules = checker.getAmbientModules().map(sym => stripQuotes(sym.name));
|
||||
const nonRelativeModuleNames = ambientModules.filter(moduleName => startsWith(moduleName, fragment));
|
||||
const nonRelativeModuleNames = ambientModules.filter(moduleName => startsWith(moduleName, fragment) && moduleName.indexOf("*") < 0);
|
||||
|
||||
// Nested modules of the form "module-name/sub" need to be adjusted to only return the string
|
||||
// after the last '/' that appears in the fragment because that's where the replacement span
|
||||
|
||||
Reference in New Issue
Block a user