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

Syntax error false positive for array indexes that are arithmetic expressions with spaces #706

Closed
akwala opened this issue Feb 1, 2023 · 1 comment
Labels
bug Something isn't working grammar bug Issues related to the bash grammar

Comments

@akwala
Copy link

akwala commented Feb 1, 2023

Code editor

Codium (VS Code)

Platform

Linux/Ubuntu

Version

4.4.0

What steps will reproduce the bug?

Code example:

value=array[i - 2]

This is flagged as a syntax error:

Syntax error: "]" missing

Changing the code as follows gets rid of the error:

value=array[i-2]

With this modified code, AFAICT, shell-format (shfmt) inserts the spaces around the minus. It is not a syntax error to have those spaces.

How often does it reproduce? Is there a required condition?

Always.

What is the expected behavior?

This should not be flagged as a syntax error.

What do you see instead?

Syntax error: "]" missing

Additional information

No response

@skovhus skovhus added grammar bug Issues related to the bash grammar bug Something isn't working labels Feb 1, 2023
@skovhus
Copy link
Collaborator

skovhus commented Feb 1, 2023

Thanks for reporting this. This should be fixed in the latest language server 4.6.2 and in the vscode extension 1.33.

Do let us know if you have other issues or ideas for future improvements. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working grammar bug Issues related to the bash grammar
Projects
None yet
Development

No branches or pull requests

2 participants