mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-18 13:59:04 -05:00
Fix path completions for typesVersions (#49154)
* Fix path completions for typesVersions * Add more tests * Fix case when * is a fragment of a path component * Once a path pattern matches, only return completions from that pattern and higher priority ones * Fix iteration order issue * Aesthetics
This commit is contained in:
@@ -2299,7 +2299,7 @@ namespace ts {
|
||||
return startsWith(getCanonicalFileName(str), getCanonicalFileName(prefix)) ? str.substring(prefix.length) : undefined;
|
||||
}
|
||||
|
||||
function isPatternMatch({ prefix, suffix }: Pattern, candidate: string) {
|
||||
export function isPatternMatch({ prefix, suffix }: Pattern, candidate: string) {
|
||||
return candidate.length >= prefix.length + suffix.length &&
|
||||
startsWith(candidate, prefix) &&
|
||||
endsWith(candidate, suffix);
|
||||
|
||||
Reference in New Issue
Block a user