Anyone using bash-language-server LSP?

292 views
Skip to first unread message

Weber Grandish

unread,
Oct 13, 2021, 1:29:55 PM10/13/21
to BBEdit Talk
I have it installed (npm install -g bash-language-server).
I have a green light in "Installed Languages...".  
I have other LSPs installed and working (YAML, JSON, etc), the LSP dot will change color as I edit a file.  The LSP icon stays grey on .sh files though.  

The LanguageServerProtocol-Unix Shell Script.txt log file doesn't show any errors:
2021-10-13 12:42:03.164: Application startup: 14.0.1 (416084), r26974
2021-10-13 12:42:03.164: macOS version: 11.6 (20G165)
2021-10-13 12:42:03.740: Server message: Initialized server v. 2.0.0 for file:///...<file.sh>
...
2021-10-13 13:12:46.239: Server message: onCompletion 7:4 word="test"
2021-10-13 13:12:52.131: Server message: onCompletion 7:6 word="-"
2021-10-13 13:12:54.911: Server message: onCompletion 7:12 word="/tmp"
2021-10-13 13:12:57.399: Server message: onCompletion 7:18 word="/tmp/file."
2021-10-13 13:12:58.726: Server message: onCompletion 7:21 word="/tmp/file.txt"
2021-10-13 13:13:04.453: Server message: onCompletion 7:33 word=null

It's doing something in the background, but I'm missing anything interactive while in BBEdit.

I have used ShellCheck successfully fwiw, but that doesn't support zsh.  I don't know if the bash-language-server LSP integration will either, or what behavior to expect or look for.   

Thanks 

Rich Siegel

unread,
Oct 13, 2021, 1:42:32 PM10/13/21
to BBEdit Talk
On 13 Oct 2021, at 13:17, Weber Grandish wrote:

> I have it installed (npm install -g bash-language-server).
> I have a green light in "Installed Languages...".
> I have other LSPs installed and working (YAML, JSON, etc), the LSP dot
> will
> change color as I edit a file. The LSP icon stays grey on .sh files
> though.

That means simply that the server has not yet returned any issues
("diagnostics", in the LSP nomenclature) in your file.

Indeed, the server does not claim to support diagnostic reporting. Its
returned capabilities state:

completionProvider = {
resolveProvider = 1;
triggerCharacters = (
"$",
"{"
);
};
definitionProvider = 1;
documentHighlightProvider = 1;
documentSymbolProvider = 1;
hoverProvider = 1;
referencesProvider = 1;
textDocumentSync = 1;
workspaceSymbolProvider = 1;

So if the documentation says that the server reports diagnostics, that
perhaps may be worth opening an issue against the language server on
GitHub.

R.

--
Rich Siegel Bare Bones Software, Inc.
<sie...@barebones.com> <https://www.barebones.com/>

Someday I'll look back on all this and laugh... until they sedate me.

Weber Grandish

unread,
Oct 14, 2021, 9:19:06 AM10/14/21
to BBEdit Talk
Thanks for the reply, Rich.  I listened to the Mac Admins podcast that you mentioned installing something to check for errors in your shell scripts, which is actually what started me down this path.  I assumed that it was this bash-lsp.  Is that right?  Or would you mind sharing a bit more detail about what you were referring to (if you recall)?
Thanks 

Rich Siegel

unread,
Oct 14, 2021, 9:52:21 AM10/14/21
to BBEdit Talk
On 13 Oct 2021, at 23:21, Weber Grandish wrote:

> Thanks for the reply, Rich. I listened to the Mac Admins podcast that
> you
> mentioned installing something to check for errors in your shell
> scripts,
> which is actually what started me down this path. I assumed that it
> was
> this bash-lsp. Is that right? Or would you mind sharing a bit more
> detail
> about what you were referring to (if you recall)?

I don't specifically recall, sorry. If you have ShellCheck installed,
the "Check Syntax" command on the #! menu will use it.
Reply all
Reply to author
Forward
0 new messages