Skip to content

Commit 650de7b

Browse files
authored
Merge pull request #753 from bash-lsp/fix-strikethrough
ShellCheck: avoid using deprecated tag
2 parents 0b0d3d6 + 5dba9d2 commit 650de7b

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed

server/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Bash Language Server
22

3+
## 4.8.2
4+
5+
- ShellCheck: avoid using the diagnostic tag "deprecated" that allow clients to render diagnostics with a strike through https://github.com/bash-lsp/bash-language-server/pull/753
6+
37
## 4.8.1
48

59
- Ensure ShellCheck directive parse does not throw on malformed input https://github.com/bash-lsp/bash-language-server/pull/749

server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "A language server for Bash",
44
"author": "Mads Hartmann",
55
"license": "MIT",
6-
"version": "4.8.1",
6+
"version": "4.8.2",
77
"main": "./out/server.js",
88
"typings": "./out/server.d.ts",
99
"bin": {

server/src/shellcheck/config.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,7 @@ export const SUPPORTED_BASH_DIALECTS = ['sh', 'bash', 'dash', 'ksh']
66

77
// https://github.com/koalaman/shellcheck/wiki
88
export const CODE_TO_TAGS: Record<number, LSP.DiagnosticTag[] | undefined> = {
9-
2006: [LSP.DiagnosticTag.Deprecated],
10-
2007: [LSP.DiagnosticTag.Deprecated],
119
2034: [LSP.DiagnosticTag.Unnecessary],
12-
2186: [LSP.DiagnosticTag.Deprecated],
13-
2196: [LSP.DiagnosticTag.Deprecated],
14-
2197: [LSP.DiagnosticTag.Deprecated],
1510
}
1611

1712
// https://github.com/koalaman/shellcheck/blob/364c33395e2f2d5500307f01989f70241c247d5a/src/ShellCheck/Formatter/Format.hs#L50

server/src/util/__tests__/sourcing.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ describe('getSourcedUris', () => {
173173
174174
# shellcheck source-path=SCRIPTDIR # note that this is already the behaviour of bash language server
175175
source ./testing/fixtures/issue101.sh
176+
177+
source # not finished
176178
`
177179

178180
const sourceCommands = getSourceCommands({

server/src/util/sourcing.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ function getSourcedPathInfoFromNode({
5959
}): null | { sourcedPath?: string; parseError?: string } {
6060
if (node.type === 'command') {
6161
const [commandNameNode, argumentNode] = node.namedChildren
62+
63+
if (!commandNameNode || !argumentNode) {
64+
return null
65+
}
66+
6267
if (
6368
commandNameNode.type === 'command_name' &&
6469
SOURCING_COMMANDS.includes(commandNameNode.text)

0 commit comments

Comments
 (0)