microsoft / vscode

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

Semantic highlighting breaks in the working tree view #131365

Closed ImRodry closed 2 years ago

ImRodry commented 2 years ago

Issue Type: Bug

When making changes in a GitHub repository folder, going into Source Control and clicking one of the changes files, the working tree view is opened and you can see that the left side of this view does not have proper semantic highlighting, whereas the right side does.

VS Code version: Code 1.59.1 (3866c3553be8b268c8a7f8c0482c0c0177aa8bfa, 2021-08-19T11:56:46.957Z) OS version: Windows_NT x64 10.0.19043 Restricted Mode: No

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz (12 x 3192)| |GPU Status|2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled| |Load (avg)|undefined| |Memory (System)|19.89GB (4.53GB 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 (17) Extension|Author (truncated)|Version ---|---|--- better-comments|aar|2.1.0 jsdoc-markdown-highlighting|bie|0.0.1 vscode-eslint|dba|2.1.23 gitlens|eam|11.6.0 EditorConfig|Edi|0.16.4 prettier-vscode|esb|8.1.0 copilot|Git|1.3.2425 vscode-graphql|Gra|0.3.16 discord-vscode|icr|5.7.0 vscode-env|Iro|0.1.0 python|ms-|2021.8.1147840270 jupyter|ms-|2021.8.1236758218 remote-wsl|ms-|0.58.2 vsliveshare|ms-|1.0.4673 vetur|oct|0.34.1 vscodeintellicode|Vis|1.2.14 minecraft-lang-colorizer|zz5|1.0.0
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 python383cf:30185419 vspyt653:30270858 pythonvspyt602:30300191 vspor879:30202332 vspor708:30202333 vspor363:30204092 pythonvspyt639:30300192 pythontb:30283811 pythonptprofiler:30281270 vshan820:30294714 vstes263cf:30335440 pythondataviewer:30285071 pythonvsuse255:30340121 vscod805cf:30301675 pythonvspyt200:30340761 vscextlangct:30333562 binariesv615:30325510 pythonvssor306:30344512 bridge0708:30335490 pygetstartedc2:30351386 vstre464cf:30350173 bridge0723:30353136 vsdyn420:30354109 ```
aeschli commented 2 years ago

Semantic highlighting comes from language servers and not all language servers ca work with virtual files (files from repositories). Also, semantic highlighting depends on resolving references in the context of a project which is hard for repo files as the project context is unknown to the language server.

For what language did you see the issue?

ImRodry commented 2 years ago

Semantic highlighting comes from language servers and not all language servers ca work with virtual files (files from repositories). Also, semantic highlighting depends on resolving references in the context of a project which is hard for repo files as the project context is unknown to the language server.

For what language did you see the issue?

Sorry forgot to mention it was on TypeScript. Just thought it was weird how one view worked and the other one didn’t

aeschli commented 2 years ago

Not sure if TypeScript want to attempt to get sematic highlighting for the file content on the left side of the diff editor.

ImRodry commented 2 years ago

Why would it not?

aeschli commented 2 years ago

As mentioned, semantic highlighting depends on resolving references in the context of a project. The left-hand side file is a file from the history and might reference other files from the history. The TypeScript server does not have access to these other files.