filter non-related errors, update aqua

This commit is contained in:
DieMyst 2024-04-15 14:50:53 +07:00
parent 6e05ea7b25
commit 4b0c776a69
3 changed files with 18 additions and 12 deletions

View File

@ -8,7 +8,7 @@
"name": "aqua-ls-server",
"version": "0.0.1",
"dependencies": {
"@fluencelabs/aqua-language-server-api": "0.14.4",
"@fluencelabs/aqua-language-server-api": "0.14.5",
"global-dirs": "^3.0.0",
"vscode-languageserver": "^7.0.0",
"vscode-languageserver-textdocument": "^1.0.4",
@ -35,9 +35,9 @@
"license": "Apache-2.0"
},
"node_modules/@fluencelabs/aqua-language-server-api": {
"version": "0.14.4",
"resolved": "https://registry.npmjs.org/@fluencelabs/aqua-language-server-api/-/aqua-language-server-api-0.14.4.tgz",
"integrity": "sha512-BHRgOexBZFf/zAE5ERSC9wK5G7/OAdoYafpIFqiMK91LmBVBfJGwHecrNibDGdmCkDFVxNpak4QGQodcJeZYAg=="
"version": "0.14.5",
"resolved": "https://registry.npmjs.org/@fluencelabs/aqua-language-server-api/-/aqua-language-server-api-0.14.5.tgz",
"integrity": "sha512-zlk4VDIEi771fQGAkD4QUN5tvpVYfirIsbpI/Z9ojqecUdsFUXn4GeqpWzZQdqjvkY9/hLzTwqicdijOiObx9A=="
},
"node_modules/@types/json5": {
"version": "0.0.29",
@ -1289,9 +1289,9 @@
},
"dependencies": {
"@fluencelabs/aqua-language-server-api": {
"version": "0.14.4",
"resolved": "https://registry.npmjs.org/@fluencelabs/aqua-language-server-api/-/aqua-language-server-api-0.14.4.tgz",
"integrity": "sha512-BHRgOexBZFf/zAE5ERSC9wK5G7/OAdoYafpIFqiMK91LmBVBfJGwHecrNibDGdmCkDFVxNpak4QGQodcJeZYAg=="
"version": "0.14.5",
"resolved": "https://registry.npmjs.org/@fluencelabs/aqua-language-server-api/-/aqua-language-server-api-0.14.5.tgz",
"integrity": "sha512-zlk4VDIEi771fQGAkD4QUN5tvpVYfirIsbpI/Z9ojqecUdsFUXn4GeqpWzZQdqjvkY9/hLzTwqicdijOiObx9A=="
},
"@types/json5": {
"version": "0.0.29",

View File

@ -11,7 +11,7 @@
"url": "https://github.com/fluencelabs/aqua"
},
"dependencies": {
"@fluencelabs/aqua-language-server-api": "0.14.4",
"@fluencelabs/aqua-language-server-api": "0.14.5",
"global-dirs": "^3.0.0",
"vscode-languageserver": "^7.0.0",
"vscode-languageserver-textdocument": "^1.0.4",

View File

@ -74,13 +74,19 @@ export async function compileAqua(
});
if (result.warnings) {
// Add all warnings to Diagnostic
diagnostics.push(...result.warnings.map((w) => infoToDiagnostic(textDocument, w)));
// Add all warnings related to the file to Diagnostic
const warnings = result.warnings
.filter((w) => w.location == null || w.location === path)
.map((w) => infoToDiagnostic(textDocument, w));
diagnostics.push(...warnings);
}
if (result.errors) {
// Add all errors to Diagnostic
diagnostics.push(...result.errors.map((e) => infoToDiagnostic(textDocument, e)));
// Add all errors related to the file to Diagnostic
const errors = result.errors
.filter((e) => e.location == null || e.location === path)
.map((e) => infoToDiagnostic(textDocument, e));
diagnostics.push(...errors);
}
const locations = result.locations.concat(links);