Skip to content

ShellCheck: avoid using deprecated tag #753

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 5, 2023
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
4 changes: 4 additions & 0 deletions server/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Bash Language Server

## 4.8.2

- 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

## 4.8.1

- Ensure ShellCheck directive parse does not throw on malformed input https://github.com/bash-lsp/bash-language-server/pull/749
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": "4.8.1",
"version": "4.8.2",
"main": "./out/server.js",
"typings": "./out/server.d.ts",
"bin": {
Expand Down
5 changes: 0 additions & 5 deletions server/src/shellcheck/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@ export const SUPPORTED_BASH_DIALECTS = ['sh', 'bash', 'dash', 'ksh']

// https://github.com/koalaman/shellcheck/wiki
export const CODE_TO_TAGS: Record<number, LSP.DiagnosticTag[] | undefined> = {
2006: [LSP.DiagnosticTag.Deprecated],
2007: [LSP.DiagnosticTag.Deprecated],
2034: [LSP.DiagnosticTag.Unnecessary],
2186: [LSP.DiagnosticTag.Deprecated],
2196: [LSP.DiagnosticTag.Deprecated],
2197: [LSP.DiagnosticTag.Deprecated],
}

// https://github.com/koalaman/shellcheck/blob/364c33395e2f2d5500307f01989f70241c247d5a/src/ShellCheck/Formatter/Format.hs#L50
Expand Down
2 changes: 2 additions & 0 deletions server/src/util/__tests__/sourcing.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ describe('getSourcedUris', () => {
# shellcheck source-path=SCRIPTDIR # note that this is already the behaviour of bash language server
source ./testing/fixtures/issue101.sh
source # not finished
`

const sourceCommands = getSourceCommands({
Expand Down
5 changes: 5 additions & 0 deletions server/src/util/sourcing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ function getSourcedPathInfoFromNode({
}): null | { sourcedPath?: string; parseError?: string } {
if (node.type === 'command') {
const [commandNameNode, argumentNode] = node.namedChildren

if (!commandNameNode || !argumentNode) {
return null
}

if (
commandNameNode.type === 'command_name' &&
SOURCING_COMMANDS.includes(commandNameNode.text)
Expand Down