Skip to content
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

Scheme setting does not apply to shellcheck linting #66

Closed
adepke opened this issue Jul 5, 2023 · 1 comment
Closed

Scheme setting does not apply to shellcheck linting #66

adepke opened this issue Jul 5, 2023 · 1 comment

Comments

@adepke
Copy link

adepke commented Jul 5, 2023

When running shellcheck linting, I'm seeing the following error in the lsp log panel:

LSP-bash: 14:32:55.143 ERROR Error while linting: TypeError [ERR_INVALID_URL_SCHEME]: The URL must be of scheme file

where the url is buffer://sublime/x. It looks like only file is supported as a scheme here. Saving as a file fixes this.

@predragnikolic
Copy link
Member

Hello,
Sorry for the late reply.

If I paste the following text to a buffer and not save a file:

#! /bin/bash

echo -n "Enter a number: "
read -r NUM

if [[ $NUM -gt 10 ]]
 echo "The variable is greater than 10."
else
 echo "The variable is equal or less than 10."
fi

I will get the following logs:

:: [12:09:35.138]  -> LSP-bash textDocument/didChange: {'contentChanges': [{'text': '#! /bin/bash\n\necho -n "Enter a number: "\nread -r NUM\n\nif [[ $NUM -gt 10 ]]\n echo "The variable is greater than 10."\nelse\n echo "The variable is equal or less than 10."\nfi'}], 'textDocument': {'version': 3, 'uri': 'buffer://sublime/52'}}
:: [12:09:35.140] --> LSP-bash textDocument/documentHighlight (81): {'textDocument': {'uri': 'buffer://sublime/52'}, 'position': {'line': 9, 'character': 2}}
LSP-bash: 10:09:35.140 WARNING ⛔️ Error while parsing buffer://sublime/52: syntax error
:: [12:09:35.142] <-  LSP-bash window/logMessage: {'type': 2, 'message': '10:09:35.140 WARNING ⛔️ Error while parsing buffer://sublime/52: syntax error'}
:: [12:09:35.143] <<< LSP-bash (81) (duration: 2ms): []
LSP-bash: 10:09:35.642 ERROR ⛔️ Error while linting: TypeError [ERR_INVALID_URL_SCHEME]: The URL must be of scheme file
:: [12:09:35.643] <-  LSP-bash window/logMessage: {'type': 1, 'message': '10:09:35.642 ERROR ⛔️ Error while linting: TypeError [ERR_INVALID_URL_SCHEME]: The URL must be of scheme file'}
:: [12:09:35.643] <-  LSP-bash textDocument/publishDiagnostics: {'version': 3, 'uri': 'buffer://sublime/52', 'diagnostics': []}

It looks like there are two issues:

  1. WARNING ⛔️ Error while parsing buffer://sublime/52: syntax error ("Go to Definition" rarely works, Bash IDE output is full of "WARNING ⛔️ Error while parsing file" bash-lsp/bash-language-server#859 is not related, but I see that the tree-sitter parser is not perfect)
  2. ERROR ⛔️ Error while linting: TypeError [ERR_INVALID_URL_SCHEME]: The URL must be of scheme file

both of those issues are server issues,
so they are better reported here -> https://github.com/bash-lsp/bash-language-server/issues

Feel free to open the issues at that repo.
I will close this, because there is nothing that can be done in this repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants