microsoft / vscode

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

Incorrect syntax error highlighting in workspace folder list #108131

Open PaulSwarthout opened 3 years ago

PaulSwarthout commented 3 years ago

Issue Type: Bug

I use VS Code to develop WordPress plugins in PHP.

1) Create a PHP file with a syntax error in it. 2) Save it.

VS Code will highlight the file name in the folder list in red indicating the presence of an error. Further, it will red highlight all of the files parent folders all the way up the tree to indicate the presence of a syntax error.

I find this functionality to be very helpful.

3) Go to VS Code Settings and exclude the file from the workspace.

The file disappears from the folder list under the Explorer tab. That's what I would expect.

But the parent folders all the way up the tree, continue to be red highlighted indicating the presence of a syntax error.

That is bad. I would expect that if the file with a syntax error is not included in the workspace, then the parent folders would no longer be red highlighted.

While developing, I will move code that's not working correctly, that I'm rewriting and replacing, to a subfolder. Sometimes I do that because the broken code shows the proper way to call a particular function, or is a way of doing something that I don't want to forget, etc. I want to keep the code, and keep it associated with the project. I may use some of it later.

Often those code snippets have errors. So, I exclude those folders and files from the project with .gitignore, and VS Code Settings Exclusions.

Unfortunately, VS Code continues to show me there is an error in the not-displayed, not-included file by highlight the parent folders in red. This renders the whole functionality of highlighting folders and files with errors useless because I just ignore the highlighting.

VS Code version: Code 1.49.3 (2af051012b66169dde0c4dfae3f5ef48f787ff69, 2020-10-02T17:57:01.595Z) OS version: Windows_NT x64 10.0.19041

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz (8 x 3392)| |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)|15.89GB (9.27GB free)| |Process Argv|--crash-reporter-id 4a8c61d7-f6d3-495d-9576-c69834d93045| |Screen Reader|no| |VM|0%|
Extensions (2) Extension|Author (truncated)|Version ---|---|--- php-debug|fel|1.13.0 php-intellisense|fel|2.3.14
jrieken commented 3 years ago

Removing bug label because things kinda work as expected. A file is not visible but it still has a compile error and that's correctly shown/bubbling. Arguably PHP shouldn't report an error at the first place but file/folder visibility is also not a good project descriptor. Unsure what to do here