Skip to content

Commit e0e9b74

Browse files
committed
Preserve existing queryparams when filtering server-side search
1 parent 0ed41eb commit e0e9b74

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/providers/FileSystemProvider/TextSearchProvider.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,9 @@ export class TextSearchProvider implements vscode.TextSearchProvider {
106106
const genStr = params.has("generated") && params.get("generated").length ? params.get("generated") : "0";
107107

108108
let uri = options.folder;
109+
const uriQuery = new URLSearchParams(uri.query);
109110

110-
if (!new URLSearchParams(uri.query).has("filter")) {
111+
if (!uriQuery.has("filter")) {
111112
// Unless isfs spec already includes a filter (which it rarely does), apply includes and excludes at the server side.
112113
// If include or exclude field is set to, say, A1B2M*.int there will be two consecutive options.[in|ex]cludes elements:
113114
// **/A1B2M*.int/**
@@ -131,9 +132,11 @@ export class TextSearchProvider implements vscode.TextSearchProvider {
131132
const tidiedExcludes = tidyFilters(options.excludes);
132133
const filter = tidiedIncludes.join(",") + (tidiedExcludes.length === 0 ? "" : ",'" + tidiedExcludes.join(",'"));
133134
if (filter) {
134-
uri = options.folder.with({ query: `filter=${filter}` });
135+
uriQuery.append("filter", filter);
136+
uri = options.folder.with({ query: uriQuery.toString() });
135137
}
136138
}
139+
137140
searchPromise = api
138141
.actionSearch({
139142
query: query.pattern,

0 commit comments

Comments
 (0)