File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
src/providers/FileSystemPovider Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 11import * as vscode from "vscode" ;
2+ import * as url from "url" ;
23import { DocSearchResult } from "../../api/atelier" ;
34import { 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" ) {
You can’t perform that action at this time.
0 commit comments