vscode icon indicating copy to clipboard operation
vscode copied to clipboard

shellscript syntax highlighting does not recognize command following `until`

Open That-Guy977 opened this issue 1 year ago • 4 comments

Type: Bug

  1. Open file with language mode shellscript.
  2. Input snippet:
if x; then x; elif x; then x; fi
while x; do x; done
until x; do x; done

Actual Behavior: All commands except until recognize x as a command and have appropriate highlighting.

Expected Behavior: until x; should have similar syntax highlighting as while x;.

VS Code version: Code 1.79.2 (Universal) (695af097c7bd098fbf017ce3ac85e09bbc5dda06, 2023-06-14T08:58:52.392Z) OS version: Darwin x64 18.7.0 Modes:

System Info
Item Value
CPUs Intel(R) Core(TM) i5-3427U CPU @ 1.80GHz (4 x 1800)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) 6, 4, 3
Memory (System) 8.00GB (0.47GB free)
Process Argv --crash-reporter-id e76734d8-f729-4de2-a381-a17c3e032dc8
Screen Reader no
VM 0%

That-Guy977 avatar Jul 06 '23 08:07 That-Guy977

$@ and parameter variables are also highlighted as normal variables, rather than the special highlighting given to $?, $#, $*, $$, etc. I'm not sure if this is intentional.

That-Guy977 avatar Jul 07 '23 05:07 That-Guy977

@jeff-hykin

RedCMD avatar Jul 08 '23 08:07 RedCMD

AFAIK the variables look like they're highlighted correctly to me (they're tagged as variable.parameter instead of variable.language. Have you tried different themes @That-Guy977 ?

Screen Shot 2023-07-08 at 2 52 04 PM

I do get the until problem though.

jeff-hykin avatar Jul 08 '23 18:07 jeff-hykin

Ah, that seems like an issue of the theme I was using. I found other themes that don't have the issue, some where $#, $? etc have the same color as normal variables, and some where they're all the same color.

Out of curiosity, why the distinction between variable.parameter and variable.language, and why is $* of the latter type?

That-Guy977 avatar Jul 09 '23 05:07 That-Guy977

The described behavior is how it is expected to work. If you disagree, please explain what is expected and what is not in more detail. See also our issue reporting guidelines.

Happy Coding!

VSCodeTriageBot avatar Jul 11 '23 09:07 VSCodeTriageBot

@alexr00 should reopen the original issue is about until which Jeff confirmed as a bug

I do get the until problem though.

RedCMD avatar Jul 11 '23 19:07 RedCMD

Fixed it with v1.6.2

jeff-hykin avatar Jul 12 '23 17:07 jeff-hykin

Thanks for the quick fix! I've pulled in the latest changes.

alexr00 avatar Jul 13 '23 09:07 alexr00