Skip to content

Commit 1f9d544

Browse files
authored
Merge pull request microsoft#185784 from microsoft/tyriar/185139
Fix :line:col in anything quick access when @ is in path
2 parents 9328d38 + dc127a6 commit 1f9d544

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/vs/workbench/contrib/search/common/search.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ export interface IFilterAndRange {
157157
}
158158

159159
export function extractRangeFromFilter(filter: string, unless?: string[]): IFilterAndRange | undefined {
160-
if (!filter || unless?.some(value => filter.indexOf(value) !== -1)) {
160+
if (!filter || unless?.some(value => filter.indexOf(value) === 0)) {
161161
return undefined;
162162
}
163163

src/vs/workbench/contrib/search/test/common/extractRange.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ suite('extractRangeFromFilter', () => {
1212
assert.ok(!extractRangeFromFilter(''));
1313
assert.ok(!extractRangeFromFilter('/some/path'));
1414
assert.ok(!extractRangeFromFilter('/some/path/file.txt'));
15+
assert.ok(!extractRangeFromFilter('/some/@path'), 'paths like as /node_modules/@types/ should be supported');
1516

1617
for (const lineSep of [':', '#', '(', ':line ']) {
1718
for (const colSep of [':', '#', ',']) {
@@ -44,7 +45,7 @@ suite('extractRangeFromFilter', () => {
4445
});
4546

4647
test('unless', async function () {
47-
const res = extractRangeFromFilter('/some/path/file.txt@ (19,20)', ['@']);
48+
const res = extractRangeFromFilter('@/some/path/file.txt (19,20)', ['@']);
4849

4950
assert.ok(!res);
5051
});

0 commit comments

Comments
 (0)