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 highlighting error in arithmetic expressions #104

Open
alexr00 opened this issue Oct 25, 2024 · 3 comments
Open

syntax highlighting error in arithmetic expressions #104

alexr00 opened this issue Oct 25, 2024 · 3 comments

Comments

@alexr00
Copy link

alexr00 commented Oct 25, 2024

The code with a problem is:

z=$((x + y))

x is yellow entity.name.command.shell

  • y is brown string.unquoted.argument.shell

It looks like:

Image

Image

It should look like:

I would expect x and y to have the same scopes.

Originally from @mcandre in microsoft/vscode#231217 (comment)

@LeoH1310
Copy link

The following problem may be related to this. When using arithmetic shift operation, everything after it is highlighted as a string.
Like this:
z=$((x << y))

@friendly-bits
Copy link

friendly-bits commented Nov 22, 2024

I can not reproduce the exact issue described by @LeoH1310 but I'm having a similar issue:

e=$(( (c) << 8 )) turns everything after it into a string.

The parentheses around c seem to break the highlighting.

image

But this is probably an unrelated bug to the one which the issue was opened about.

@tacooper
Copy link

tacooper commented Jan 9, 2025

The following problem may be related to this. When using arithmetic shift operation, everything after it is highlighted as a string. Like this: z=$((x << y))

is there a separate ticket for this pattern? I'm seeing this same problem specifically with the shift-left operation:

image


edit:
never mind, found the original issue #93. I guess it hasn't been propagated to VS Code yet (as of Windows version 1.96.2), according to this comment:
microsoft/vscode#228637 (comment)
for now I'll install/use the extension

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

4 participants