1
1
import * as vscode from 'vscode' ;
2
2
import { isAuthed } from './getImports/snykAPI' ;
3
- import { getPackageFromCache } from './getImports/packageInfo' ;
3
+ // import { getPackageFromCache } from './getImports/packageInfo';
4
4
import { KEY_MENTION , getPackageFromMessage } from './diagnostics' ;
5
5
6
6
function createOpenBrowserAction ( {
@@ -25,30 +25,31 @@ function createOpenBrowserAction({
25
25
return action ;
26
26
}
27
27
28
- function createPackageUpgradeAction ( {
29
- vulnerabilities,
30
- diagnostic,
31
- isPreferred,
32
- } ) {
33
- const packages = vulnerabilities
34
- . filter ( _ => _ . isUpgradeable )
35
- . map ( _ => _ . upgradePath [ 0 ] )
36
- . join ( ' ' ) ;
28
+ // TODO will restore later
29
+ // function createPackageUpgradeAction({
30
+ // vulnerabilities,
31
+ // diagnostic,
32
+ // isPreferred,
33
+ // }) {
34
+ // const packages = vulnerabilities
35
+ // .filter(_ => _.isUpgradeable)
36
+ // .map(_ => _.upgradePath[0])
37
+ // .join(' ');
37
38
38
- const action = new vscode . CodeAction (
39
- 'Run Snyk remediation' ,
40
- vscode . CodeActionKind . Refactor
41
- ) ;
39
+ // const action = new vscode.CodeAction(
40
+ // 'Run Snyk remediation',
41
+ // vscode.CodeActionKind.Refactor
42
+ // );
42
43
43
- action . command = {
44
- command : 'vscode.open' ,
45
- title : 'Run Snyk remediation' ,
46
- arguments : [ ] ,
47
- } ;
48
- action . diagnostics = [ diagnostic ] ;
49
- action . isPreferred = isPreferred ;
50
- return action ;
51
- }
44
+ // action.command = {
45
+ // command: 'vscode.open',
46
+ // title: 'Run Snyk remediation',
47
+ // arguments: [],
48
+ // };
49
+ // action.diagnostics = [diagnostic];
50
+ // action.isPreferred = isPreferred;
51
+ // return action;
52
+ // }
52
53
53
54
/**
54
55
* Provides code actions corresponding to diagnostic problems.
@@ -60,7 +61,7 @@ export class SnykVulnInfo {
60
61
. filter ( diagnostic => diagnostic . code === KEY_MENTION )
61
62
. map ( diagnostic => {
62
63
const pkg = getPackageFromMessage ( diagnostic . message ) ;
63
- const vulns = getPackageFromCache ( pkg ) ;
64
+ // const vulns = getPackageFromCache(pkg);
64
65
65
66
const res = [
66
67
createOpenBrowserAction ( {
0 commit comments