fabric8-analytics-lsp-server
Advanced tools
Comparing version 0.1.38 to 0.1.39
@@ -167,12 +167,17 @@ /* -------------------------------------------------------------------------------------------- | ||
}); | ||
parser.on("end", function () { | ||
// the XML document doesn't have to be well-formed, that's fine | ||
// parser.error = null; | ||
this.dependencies = deps; | ||
}); | ||
return parser; | ||
} | ||
parse() { | ||
try { | ||
this.stream.pipe(this.parser.saxStream); | ||
} | ||
catch (e) { | ||
console.error(e.message); | ||
} | ||
return this.dependencies; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return new Promise(resolve => { | ||
this.stream.pipe(this.parser.saxStream).on('end', (data) => { | ||
resolve(this.dependencies); | ||
}); | ||
}); | ||
}); | ||
} | ||
@@ -187,4 +192,7 @@ } | ||
let parser = new NaivePomXmlSaxParser(file); | ||
let dependencies = parser.parse(); | ||
return dependencies; | ||
let dependencies; | ||
yield parser.parse().then(data => { | ||
dependencies = data; | ||
}); | ||
return dependencies || []; | ||
}); | ||
@@ -191,0 +199,0 @@ } |
@@ -8,2 +8,3 @@ /* -------------------------------------------------------------------------------------------- | ||
const utils_1 = require("./utils"); | ||
const vscode_languageserver_1 = require("vscode-languageserver"); | ||
; | ||
@@ -78,6 +79,6 @@ /* Bind & return the part of `obj` as described by `desc` */ | ||
return [{ | ||
severity: 3 /* Information */, | ||
severity: vscode_languageserver_1.DiagnosticSeverity.Information, | ||
range: utils_1.get_range(this.context.version), | ||
message: `Package ${this.context.name.value}-${this.context.version.value} - analysis is pending`, | ||
source: 'Component Analysis' | ||
message: `Application dependency ${this.context.name.value}-${this.context.version.value} - analysis is pending`, | ||
source: 'Dependency Analytics' | ||
}]; | ||
@@ -108,6 +109,6 @@ } | ||
let diagnostic = { | ||
severity: 1 /* Error */, | ||
severity: vscode_languageserver_1.DiagnosticSeverity.Error, | ||
range: utils_1.get_range(this.context.version), | ||
message: `Package ${this.context.name.value}-${this.context.version.value} is vulnerable: ${cves}`, | ||
source: 'Component Analysis' | ||
message: `Application dependency ${this.context.name.value}-${this.context.version.value} is vulnerable: ${cves}`, | ||
source: 'Dependency Analytics' | ||
}; | ||
@@ -114,0 +115,0 @@ // TODO: this can be done lazily |
@@ -1,1 +0,1 @@ | ||
{"name":"fabric8-analytics-lsp-server","description":"LSP Server for Component Analysis","version":"0.1.38","author":"Pavel Odvody","contributors":[{"name":"Michal Srb","email":"michal@redhat.com"},{"name":"Jyasveer Gotta","email":"jgotta@redhat.com"},{"name":"Jaivardhan Kumar","email":"jakumar@redhat.com"}],"license":"Apache-2.0","engines":{"node":"*"},"keywords":["fabric8-analytics","LSP"],"repository":{"type":"git","url":"https://github.com/fabric8-analytics/fabric8-analytics-lsp-server.git"},"dependencies":{"request":"^2.79.0","stream-json":"0.4.2","vscode-languageserver":"^2.2.0","winston":"2.3.1","xml2object":"0.1.2"},"devDependencies":{"@krux/condition-jenkins":"1.0.1","semantic-release":"8.2.0","typescript":"^2.1.4"},"scripts":{"build":"npm run clean && node node_modules/typescript/bin/tsc -p . && cp LICENSE package.json README.md output && npm run dist","clean":"rm -Rf ca-lsp-server.tar output/","dist":"cp -r node_modules output/ && cp ./package.json output/ && node -p -e \"require('./package.json').version\" > output/VERSION && rm -rf output/node_modules/typescript/ && tar cvjf ca-lsp-server.tar -C output/ .","semantic-release":"semantic-release pre && npm run build && cp -r .git output && npm publish output/ && semantic-release post"},"release":{"branch":"master","debug":false,"verifyConditions":{"path":"./node_modules/@krux/condition-jenkins"}}} | ||
{"name":"fabric8-analytics-lsp-server","description":"LSP Server for Dependency Analytics","version":"0.1.39","author":"Pavel Odvody","contributors":[{"name":"Michal Srb","email":"michal@redhat.com"},{"name":"Jyasveer Gotta","email":"jgotta@redhat.com"},{"name":"Jaivardhan Kumar","email":"jakumar@redhat.com"}],"license":"Apache-2.0","engines":{"node":"*"},"keywords":["fabric8-analytics","LSP"],"repository":{"type":"git","url":"https://github.com/fabric8-analytics/fabric8-analytics-lsp-server.git"},"dependencies":{"request":"^2.79.0","stream-json":"0.4.2","vscode-languageserver":"^4.1.3","winston":"2.3.1","xml2object":"0.1.2"},"devDependencies":{"@types/node":"^6.0.52","@krux/condition-jenkins":"1.0.1","semantic-release":"8.2.0","typescript":"^2.1.4"},"scripts":{"build":"npm run clean && node node_modules/typescript/bin/tsc -p . && cp LICENSE package.json README.md output && npm run dist","clean":"rm -Rf ca-lsp-server.tar output/","dist":"cp -r node_modules output/ && cp ./package.json output/ && node -p -e \"require('./package.json').version\" > output/VERSION && rm -rf output/node_modules/typescript/ && tar cvjf ca-lsp-server.tar -C output/ .","semantic-release":"semantic-release pre && npm run build && cp -r .git output && npm publish output/ && semantic-release post"},"release":{"branch":"master","debug":false,"verifyConditions":{"path":"./node_modules/@krux/condition-jenkins"}}} |
@@ -1,2 +0,2 @@ | ||
# Component Analysis LSP Server | ||
# Dependency Analytics LSP Server | ||
@@ -3,0 +3,0 @@ LSP Server that can analyze your dependencies specified in `package.json`. |
@@ -196,2 +196,3 @@ /* -------------------------------------------------------------------------------------------- | ||
let collector = new collector_1.DependencyCollector(null); | ||
connection.sendNotification('caNotification', 'Analysing dependencies for any security vulnerability'); | ||
collector.collect(stream).then((deps) => { | ||
@@ -201,2 +202,8 @@ let diagnostics = []; | ||
let aggregator = new Aggregator(deps, () => { | ||
if (diagnostics.length > 0) { | ||
connection.sendNotification('caNotification', `Out of ${deps.length}, ${diagnostics.length} dependencies have vulnerabilities`); | ||
} | ||
else { | ||
connection.sendNotification('caNotification', `Out of ${deps.length}, No dependencies have vulnerabilities`); | ||
} | ||
connection.sendDiagnostics({ uri: uri, diagnostics: diagnostics }); | ||
@@ -225,2 +232,3 @@ }); | ||
let collector = new collector_1.PomXmlDependencyCollector(); | ||
connection.sendNotification('caNotification', 'Analysing dependencies for any security vulnerability'); | ||
collector.collect(stream).then((deps) => { | ||
@@ -230,2 +238,8 @@ let diagnostics = []; | ||
let aggregator = new Aggregator(deps, () => { | ||
if (diagnostics.length > 0) { | ||
connection.sendNotification('caNotification', `Out of ${deps.length}, ${diagnostics.length} dependencies have vulnerabilities`); | ||
} | ||
else { | ||
connection.sendNotification('caNotification', `Out of ${deps.length}, No dependencies have vulnerabilities`); | ||
} | ||
connection.sendDiagnostics({ uri: uri, diagnostics: diagnostics }); | ||
@@ -232,0 +246,0 @@ }); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
71966
827
4
+ Addedvscode-jsonrpc@8.2.0(transitive)
+ Addedvscode-languageserver@4.4.2(transitive)
+ Addedvscode-languageserver-protocol@3.17.5(transitive)
+ Addedvscode-languageserver-types@3.17.5(transitive)
+ Addedvscode-uri@1.0.8(transitive)
- Removedvscode-jsonrpc@2.4.0(transitive)
- Removedvscode-languageserver@2.6.2(transitive)
- Removedvscode-languageserver-types@1.0.4(transitive)
Updatedvscode-languageserver@^4.1.3