From a856bbd95e7e5c9debcebc4b17d779f781aa7092 Mon Sep 17 00:00:00 2001 From: Mads Hartmann Date: Sat, 28 Jul 2018 09:03:44 +0200 Subject: [PATCH 1/2] New release script and docs --- docs/releasing.md | 2 +- scripts/release-server.sh | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100755 scripts/release-server.sh diff --git a/docs/releasing.md b/docs/releasing.md index 530466c63..10d4ff88c 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -15,4 +15,4 @@ vsce publish x.x.x To release a new version of the server - Bump the version in package.json -- Upload to NPM: `npm publish` +- Run the script: `./scripts/release-server.sh` diff --git a/scripts/release-server.sh b/scripts/release-server.sh new file mode 100755 index 000000000..72b8b8a90 --- /dev/null +++ b/scripts/release-server.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +set -euo pipefail + +version=$(cat server/package.json | jq -r .version) +tag="server-${version}" + +git tag -a "${tag}" -m "Release ${version} of the bash-language-server package" +git push origin "${tag}" + +cd server && npm publish From 7a7d8df6af61c33f8f3ddc8cf8e6f8e7a95b770d Mon Sep 17 00:00:00 2001 From: Mads Hartmann Date: Sat, 28 Jul 2018 19:39:25 +0200 Subject: [PATCH 2/2] Add support for disabling error diagnostics This is a fix for #13 --- server/CHANGELOG.md | 5 +++++ server/package.json | 2 +- server/src/server.ts | 10 ++++++---- vscode-client/CHANGELOG.md | 7 +++++++ vscode-client/package.json | 8 +++++++- vscode-client/src/extension.ts | 23 +++++++++++++++++------ 6 files changed, 43 insertions(+), 12 deletions(-) diff --git a/server/CHANGELOG.md b/server/CHANGELOG.md index 7f2a1ad9e..817219124 100644 --- a/server/CHANGELOG.md +++ b/server/CHANGELOG.md @@ -1,5 +1,10 @@ # Bash Language Server +## 1.4.1 + +* It's now possible to disable error reporting by setting the environment variable + `HIGHLIGHT_PARSING_ERRORS` to `false`. + ## 1.4.0 * Add support for explainshell implemented by [@chrismwendt][chrismwendt] [#45][45] diff --git a/server/package.json b/server/package.json index d58f5a76d..d105233c1 100644 --- a/server/package.json +++ b/server/package.json @@ -3,7 +3,7 @@ "description": "A language server for Bash", "author": "Mads Hartmann", "license": "MIT", - "version": "1.4.0", + "version": "1.4.1", "publisher": "mads-hartmann", "main": "out/server.js", "bin": { diff --git a/server/src/server.ts b/server/src/server.ts index 1b134a530..522a27f7c 100644 --- a/server/src/server.ts +++ b/server/src/server.ts @@ -55,10 +55,12 @@ export default class BashServer { this.documents.onDidChangeContent(change => { const uri = change.document.uri const diagnostics = this.analyzer.analyze(uri, change.document) - connection.sendDiagnostics({ - uri: change.document.uri, - diagnostics, - }) + if (process.env.HIGHLIGHT_PARSING_ERRORS !== 'false') { + connection.sendDiagnostics({ + uri: change.document.uri, + diagnostics, + }) + } }) // Register all the handlers for the LSP events. diff --git a/vscode-client/CHANGELOG.md b/vscode-client/CHANGELOG.md index 1a049ad22..99b4af044 100644 --- a/vscode-client/CHANGELOG.md +++ b/vscode-client/CHANGELOG.md @@ -1,5 +1,12 @@ # Bash IDE +## 1.3.2 + +* Added a new configuraiton option `bashIde.highlightParsingErrors` which defaults + to `true`. When enabled it will report parsing errors as 'problems'. This means you + can now disable the error reporting which is convenient as `shellcheck` performs a + better job of linting and our parser still has many issues. + ## 1.3.1 * Added new configuration option `bashIde.path` for specifying the exact diff --git a/vscode-client/package.json b/vscode-client/package.json index 377eb082b..17798136a 100644 --- a/vscode-client/package.json +++ b/vscode-client/package.json @@ -4,7 +4,7 @@ "description": "A language server for Bash", "author": "Mads Hartmann", "license": "MIT", - "version": "1.3.0", + "version": "1.3.2", "publisher": "mads-hartmann", "repository": { "type": "git", @@ -29,6 +29,12 @@ "description": "The path to the bash language server binary (example: /usr/local/bin/bash-language-server)" }, + "bashIde.highlightParsingErrors": { + "type": "boolean", + "default": true, + "description": + "If enabled parsing errors will be highlighted as 'problems' " + }, "bashIde.explainshellEndpoint": { "type": "string", "default": "", diff --git a/vscode-client/src/extension.ts b/vscode-client/src/extension.ts index df769793d..f8a09dc87 100644 --- a/vscode-client/src/extension.ts +++ b/vscode-client/src/extension.ts @@ -18,20 +18,31 @@ export async function activate(context: ExtensionContext) { if (semverCompare(version, MINIMUM_SERVER_VERSION) === -1) { return handleOutdatedExecutable() } - start( - context, - command, - workspace.getConfiguration('bashIde').get('explainshellEndpoint') || '', - ) + + const explainshellEndpoint = workspace + .getConfiguration('bashIde') + .get('explainshellEndpoint', '') + + const highlightParsingErrors = workspace + .getConfiguration('bashIde') + .get('highlightParsingErrors', false) + + start(context, command, explainshellEndpoint, highlightParsingErrors) } catch (error) { handleMissingExecutable() } } -function start(context: ExtensionContext, command: string, explainshellEndpoint: string) { +function start( + context: ExtensionContext, + command: string, + explainshellEndpoint: string, + highlightParsingErrors: boolean, +) { const env: any = { ...process.env, EXPLAINSHELL_ENDPOINT: explainshellEndpoint, + HIGHLIGHT_PARSING_ERRORS: highlightParsingErrors, } const serverOptions: ServerOptions = {