Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.

Commit cad4b76

Browse files
committed
wip: rebuild with snyk for vs1.40.0
1 parent 43b74b8 commit cad4b76

File tree

3 files changed

+32
-31
lines changed

3 files changed

+32
-31
lines changed

package-lock.json

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "Vulnerability Cost",
44
"description": "Display imported vulnerabilities in VS Code",
55
"license": "MIT",
6-
"version": "1.0.0",
6+
"version": "1.1.0",
77
"publisher": "snyk",
88
"scripts": {
99
"DISABLED_postinstall": "node ./node_modules/vscode/bin/install",
@@ -15,7 +15,7 @@
1515
},
1616
"author": "Remy Sharp <[email protected]>",
1717
"engines": {
18-
"vscode": "^1.42.0"
18+
"vscode": "^1.40.0"
1919
},
2020
"categories": [
2121
"Other"
@@ -93,7 +93,7 @@
9393
},
9494
"devDependencies": {
9595
"@types/node": "^6.0.40",
96-
"@types/vscode": "1.42.0",
96+
"@types/vscode": "^1.40.0",
9797
"eslint": "^6.8.0",
9898
"nodemon": "^2.0.2",
9999
"prettier": "^1.19.1",

src/SnykAction.js

+25-24
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as vscode from 'vscode';
22
import { isAuthed } from './getImports/snykAPI';
3-
import { getPackageFromCache } from './getImports/packageInfo';
3+
// import { getPackageFromCache } from './getImports/packageInfo';
44
import { KEY_MENTION, getPackageFromMessage } from './diagnostics';
55

66
function createOpenBrowserAction({
@@ -25,30 +25,31 @@ function createOpenBrowserAction({
2525
return action;
2626
}
2727

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(' ');
3738

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+
// );
4243

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+
// }
5253

5354
/**
5455
* Provides code actions corresponding to diagnostic problems.
@@ -60,7 +61,7 @@ export class SnykVulnInfo {
6061
.filter(diagnostic => diagnostic.code === KEY_MENTION)
6162
.map(diagnostic => {
6263
const pkg = getPackageFromMessage(diagnostic.message);
63-
const vulns = getPackageFromCache(pkg);
64+
// const vulns = getPackageFromCache(pkg);
6465

6566
const res = [
6667
createOpenBrowserAction({

0 commit comments

Comments
 (0)