microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
160.95k stars 28.24k forks source link

[html] adopt TypeScript semantic highlighting #114477

Closed ImRodry closed 2 years ago

ImRodry commented 3 years ago

Issue Type: Bug

Example code:

                array.forEach(element => {
                const [key, ...valueArr] = element.split('=')
                const value = valueArr.join('=')
                if (key && value) result[key] = value
            });

key and valueArr should be highlighted in dark blue outside of the line where they're declared. Instead, they show as light blue, the color of a var/undeclared variable.

VS Code version: Code 1.52.1 (ea3859d4ba2f3e577a159bc91e3074c5d85c0523, 2020-12-16T16:34:46.910Z) OS version: Windows_NT x64 10.0.19042

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz (12 x 3192)| |GPU Status|2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled| |Load (avg)|undefined| |Memory (System)|19.89GB (4.98GB free)| |Process Argv|D:\\Users\\rodri\\Documents\\GitHub\\hypixel-translators-bot --crash-reporter-id 1aa51578-c79e-468f-b062-c24334e21918| |Screen Reader|no| |VM|0%|
Extensions (14) Extension|Author (truncated)|Version ---|---|--- vscode-crowdin|Cro|1.0.6 vscode-lombok|Gab|1.0.1 discord-vscode|icr|4.1.0 csharp|ms-|1.23.8 gradle-language|nac|0.2.3 vetur|oct|0.31.3 java|red|0.73.0 vscodeintellicode|Vis|1.2.10 vscode-java-debug|vsc|0.30.0 vscode-java-dependency|vsc|0.17.0 vscode-java-pack|vsc|0.12.1 vscode-java-test|vsc|0.27.0 vscode-maven|vsc|0.27.1 minecraft-lang-colorizer|zz5|1.0.0
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 openlogontheside:30221877 python383cf:30185419 vspyt653:30244269 vspor879:30202332 vspor708:30202333 vspor363:30204092 vswsl492:30211401 wsl2promptcf:30224613 pythonvsdeb440:30242242 unusedpromptcf:30224611 folderexplorer:30224614 openfilemenu:30224647 pythonvsded773cf:30236630 pythonvspyt600:30241727 ```
mjbvz commented 3 years ago

Here's what I see once semantic highlighting kicks in:

Screen Shot 2021-01-26 at 10 06 46 PM

Did you perhaps disable semantic highlighting?

ImRodry commented 3 years ago

Here's what I see once semantic highlighting kicks in:

Screen Shot 2021-01-26 at 10 06 46 PM

Did you perhaps disable semantic highlighting?

If this was enabled by default then I didn’t touch it but otherwise I may need to enable it, can you tell me where to find that option? Also did tou get that behavior in the same vscode build?

ImRodry commented 3 years ago

I had semantic highlighting configured by theme so I set it to true and I'm still getting the same behavior

mjbvz commented 3 years ago

Did you test with just the snippet you shared using the default Dark+ theme?

ImRodry commented 3 years ago

Did you test with just the snippet you shared using the default Dark+ theme?

Yep, I tested with that exact same code and using the same settings as before with the only difference being the one I mentioned before. Here are my semantic highlighting settings in case that helps image

mjbvz commented 3 years ago
ImRodry commented 3 years ago

This file was written in HTML and the script is in JavaScript, not sure what you mean by the first question

mjbvz commented 3 years ago

Ah ok. Semantic highlighting for JavaScript is only supported in JS files right now, not JavaScript embedded in html

@aeschli Assigning to you since this is html

ImRodry commented 3 years ago

Are there any plans to support it in the near future?

aeschli commented 3 years ago

Sorry, don't know when I'll get to that.