Skip to content

Commit 95b055b

Browse files
committed
Update diagnostic to guide ShellCheck directive usage
1 parent d012e8b commit 95b055b

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

server/src/__tests__/analyzer.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,10 @@ describe('analyze', () => {
9898
{
9999
"message": "Source command could not be analyzed: non-constant source not supported.
100100
101-
Note that enabling the configuration flag "includeAllWorkspaceSymbols"
102-
would include all symbols in the workspace regardless of source commands.
103-
But be aware that this will lead to false positive suggestions.",
101+
Consider adding a ShellCheck directive above this line to fix or ignore this:
102+
# shellcheck source=/my-file.sh # specify the file to source
103+
# shellcheck source-path=my_script_folder # specify the folder to search in
104+
# shellcheck source=/dev/null # to ignore the error",
104105
"range": {
105106
"end": {
106107
"character": 16,

server/src/analyser.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,10 @@ export default class Analyzer {
100100
sourceCommand.range,
101101
[
102102
`Source command could not be analyzed: ${sourceCommand.error}.\n`,
103-
'Note that enabling the configuration flag "includeAllWorkspaceSymbols"',
104-
'would include all symbols in the workspace regardless of source commands.',
105-
'But be aware that this will lead to false positive suggestions.',
103+
'Consider adding a ShellCheck directive above this line to fix or ignore this:',
104+
'# shellcheck source=/my-file.sh # specify the file to source',
105+
'# shellcheck source-path=my_script_folder # specify the folder to search in',
106+
'# shellcheck source=/dev/null # to ignore the error',
106107
].join('\n'),
107108
LSP.DiagnosticSeverity.Information,
108109
undefined,

0 commit comments

Comments
 (0)