bash-language-server
bash-language-server copied to clipboard
Double Parentheses (arithmetic evaluation) - failed to parse expression.
I've just started using BLS on vim (through LanguageClient-neovim) and observed that BLS fails to parse hex conversions:
echo $((16#FF)) # prints 255
Which are valid, per-documentation expressions. I'd say this wouldn't be such a big deal, but when BLS encounters such a line it seems to be unable to parse/produce any other info for the whole file and all I get in vim is a single message 'Failed to parse expression' which is not even usually anchored on the actual line.
It is quite possible that this is not because of BLS, but as I am rather new to the whole language server deal, I thought I'd start this from the bottom up, hence this issue.
The same issue happens to me. I found that there is a workaround to avoid "Failed to parse expression" error. For example:
expr="16#FF"
echo "$((expr))"
@KevCui, on what IDE/editor did you observe the error?
@iddinev neovim
I also see this issue with VSCode's Bash IDE extension v1.14.0 which, according to its changelog, uses the bash language server version 3.0.3. The workaround by @KevCui works fine but makes the code a bit awkward.
This seems to have been fixed in the newer version of the grammar.