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 1
1
import * as vscode from "vscode" ;
2
+ import * as url from "url" ;
2
3
import { DocSearchResult } from "../../api/atelier" ;
3
4
import { AtelierAPI } from "../../api" ;
4
5
@@ -14,8 +15,11 @@ export class FileSearchProvider implements vscode.FileSearchProvider {
14
15
options : vscode . FileSearchOptions ,
15
16
token : vscode . CancellationToken
16
17
) : 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" ;
19
23
const api = new AtelierAPI ( options . folder ) ;
20
24
let filter = query . pattern ;
21
25
if ( category !== "CSP" ) {
@@ -38,7 +42,7 @@ export class FileSearchProvider implements vscode.FileSearchProvider {
38
42
. then ( ( files : DocSearchResult [ ] ) =>
39
43
files
40
44
. map ( ( file ) => {
41
- if ( category === "* " && file . cat === "CSP" ) {
45
+ if ( category !== "CSP " && file . cat === "CSP" ) {
42
46
return null ;
43
47
}
44
48
if ( file . cat !== "CSP" ) {
You can’t perform that action at this time.
0 commit comments