better-shell-syntax icon indicating copy to clipboard operation
better-shell-syntax copied to clipboard

syntax highlighting error in arithmetic expressions

Open alexr00 opened this issue 1 year ago • 4 comments

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 https://github.com/microsoft/vscode/issues/231217#issuecomment-2410800447

alexr00 avatar Oct 25 '24 12:10 alexr00

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))

LeoH1310 avatar Oct 28 '24 13:10 LeoH1310

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.

friendly-bits avatar Nov 22 '24 02:11 friendly-bits

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: https://github.com/microsoft/vscode/issues/228637#issuecomment-2353799843 for now I'll install/use the extension

tacooper avatar Jan 09 '25 15:01 tacooper

Unfortunately, the extension also has this bug

iTrooz avatar Mar 07 '25 19:03 iTrooz