diff --git a/extensions/css-language-features/server/src/pathCompletion.ts b/extensions/css-language-features/server/src/pathCompletion.ts index 7de00f1d57bde3c9ae3b64ed9aebad2ee2690820..6808076991fd42b2d1459487745fa2d9a0b19d51 100644 --- a/extensions/css-language-features/server/src/pathCompletion.ts +++ b/extensions/css-language-features/server/src/pathCompletion.ts @@ -153,7 +153,8 @@ function pathToReplaceRange(valueBeforeCursor: string, fullValue: string, fullVa // Find the last slash before cursor, and calculate the start of replace range from there const valueAfterLastSlash = fullValue.slice(lastIndexOfSlash + 1); const startPos = shiftPosition(fullValueRange.end, -valueAfterLastSlash.length); - // If whitespace exists, replace until it + + // If whitespace exists, replace until there is no more remaining. const whitespaceIndex = valueAfterLastSlash.indexOf(' '); if (whitespaceIndex === -1) { return Range.create(startPos, fullValueRange.end); diff --git a/extensions/html-language-features/server/src/modes/pathCompletion.ts b/extensions/html-language-features/server/src/modes/pathCompletion.ts index 8813c3f595be8e701d1b7b9e14adcd32c0f393a2..37188f74e2718672befbddf6bf03a8b59c39a12d 100644 --- a/extensions/html-language-features/server/src/modes/pathCompletion.ts +++ b/extensions/html-language-features/server/src/modes/pathCompletion.ts @@ -108,7 +108,8 @@ function pathToSuggestion(p: string, valueBeforeCursor: string, fullValue: strin // Find the last slash before cursor, and calculate the start of replace range from there const valueAfterLastSlash = fullValue.slice(lastIndexOfSlash + 1); const startPos = shiftPosition(range.end, -1 - valueAfterLastSlash.length); - // If whitespace exists, replace until it + + // If whitespace exists, replace until there is no more remaining. const whitespaceIndex = valueAfterLastSlash.indexOf(' '); if (whitespaceIndex === -1) { replaceRange = Range.create(startPos, shiftPosition(range.end, -1)); diff --git a/src/vs/base/common/glob.ts b/src/vs/base/common/glob.ts index 6746c06c9be715d766a76ccca190902546f3a23d..7200febd0391270772278f38489d58bf0383fe0d 100644 --- a/src/vs/base/common/glob.ts +++ b/src/vs/base/common/glob.ts @@ -331,11 +331,10 @@ function wrapRelativePattern(parsedPattern: ParsedStringPattern, arg2: string | } return function (path, basename) { - if (!extpath.isEqualOrParent(path, arg2.base)) { - return null; + if (extpath.isEqualOrParent(path, arg2.base)) { + return parsedPattern(paths.relative(arg2.base, path), basename); } - - return parsedPattern(paths.relative(arg2.base, path), basename); + return null; }; }