Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
11 changes: 11 additions & 0 deletions scripts/release-server.sh
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions server/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
10 changes: 6 additions & 4 deletions server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 7 additions & 0 deletions vscode-client/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 7 additions & 1 deletion vscode-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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": "",
Expand Down
23 changes: 17 additions & 6 deletions vscode-client/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down