Skip to content

Commit a33396c

Browse files
committed
Filter QuickOpen more when isfs queryparam specifies a type (cls or rtn)
1 parent 6ec344c commit a33396c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/providers/FileSystemPovider/FileSearchProvider.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as vscode from "vscode";
2+
import * as url from "url";
23
import { DocSearchResult } from "../../api/atelier";
34
import { AtelierAPI } from "../../api";
45

@@ -14,8 +15,11 @@ export class FileSearchProvider implements vscode.FileSearchProvider {
1415
options: vscode.FileSearchOptions,
1516
token: vscode.CancellationToken
1617
): vscode.ProviderResult<vscode.Uri[]> {
17-
const category = `&${options.folder.query}&`.includes("&csp&") ? "CSP" : "*";
18-
const generated = `&${options.folder.query}&`.includes("&generated=1&");
18+
const folderQuery = url.parse(options.folder.toString(true), true).query;
19+
const type = folderQuery.type || "all";
20+
const category =
21+
folderQuery.csp === "" || folderQuery.csp === "1" ? "CSP" : type === "cls" ? "CLS" : type === "rtn" ? "RTN" : "*";
22+
const generated = folderQuery.generated && folderQuery.generated === "1";
1923
const api = new AtelierAPI(options.folder);
2024
let filter = query.pattern;
2125
if (category !== "CSP") {
@@ -38,7 +42,7 @@ export class FileSearchProvider implements vscode.FileSearchProvider {
3842
.then((files: DocSearchResult[]) =>
3943
files
4044
.map((file) => {
41-
if (category === "*" && file.cat === "CSP") {
45+
if (category !== "CSP" && file.cat === "CSP") {
4246
return null;
4347
}
4448
if (file.cat !== "CSP") {

0 commit comments

Comments
 (0)