@@ -20,11 +20,6 @@ class RuleInfo {
20
20
isEnabled : boolean ;
21
21
}
22
22
23
- class SetPSSARulesRequestParams {
24
- filepath : string ;
25
- ruleInfos : RuleInfo [ ] ;
26
- }
27
-
28
23
export class SelectPSSARulesFeature implements IFeature {
29
24
30
25
private command : vscode . Disposable ;
@@ -47,15 +42,20 @@ export class SelectPSSARulesFeature implements IFeature {
47
42
} ) ;
48
43
49
44
showCheckboxQuickPick ( options )
50
- . then ( updatedOptions => {
51
- let filepath : string = vscode . window . activeTextEditor . document . uri . fsPath ;
52
- let ruleInfos : RuleInfo [ ] = updatedOptions . map (
53
- function ( option : CheckboxQuickPickItem ) : RuleInfo {
54
- return { name : option . label , isEnabled : option . isSelected } ;
45
+ . then ( ( updatedOptions : CheckboxQuickPickItem [ ] ) => {
46
+ if ( updatedOptions === undefined ) {
47
+ return ;
48
+ }
49
+ this . languageClient . sendRequest (
50
+ SetPSSARulesRequest . type ,
51
+ {
52
+ filepath : vscode . window . activeTextEditor . document . uri . fsPath ,
53
+ ruleInfos : updatedOptions . map (
54
+ function ( option : CheckboxQuickPickItem ) : RuleInfo {
55
+ return { name : option . label , isEnabled : option . isSelected } ;
56
+ } )
55
57
} ) ;
56
- let requestParams : SetPSSARulesRequestParams = { filepath, ruleInfos} ;
57
- this . languageClient . sendRequest ( SetPSSARulesRequest . type , requestParams ) ;
58
- } ) ;
58
+ } ) ;
59
59
} ) ;
60
60
} ) ;
61
61
}
0 commit comments