Closed CynicatPro closed 3 weeks ago
@CynicatPro Can you run C/C++: Log Diagnostics, see what source file is being associated with the header, and then change the language of the source file from C++ to C, then open the header and right-click and select Reset IntelliSense for Active File?
Did that process, got a giant log printout, it stays on C only until I hit a key or save the file.
Oh wow, does it assume the mapping based on whether you include it in a .cpp/.cc file?
The "Translation Unit Mappings" include a 'game.cc' file as the file that includes it.
That makes a degree of sense but it is surprising.
Hi @CynicatPro . I believe what you're seeing is a result of headers getting associated with source files (for various reasons, one of which is because custom configuration providers generally provide configurations for source files and not header files). What you're seeing is the header file's language association getting 'corrected' to refer to the language it's actually being processed as (based on the source file).
I think in order to properly support your scenario, we would need VS Code to address this issue: https://github.com/microsoft/vscode/issues/227643#issuecomment-2345006244
Thanks for clarifying, now that I understand it, it makes a lot more sense. Thanks for helping me with this!
Type: Bug
Changing header file to C instead of C++ immediately reverts back to C++.
I have a math library and i want to flip back and forth to test that it compiles in both C and C++ (yes, i'm doing full compile tests as well, but this is a quick smoke test).
When i click on the language select in the bottom right and change the language to C from C++, it immediately reverts back to C++.
Extension version: 1.22.10 VS Code version: Code 1.94.2 (384ff7382de624fb94dbaf6da11977bba1ecd427, 2024-10-09T16:08:44.566Z) OS version: Windows_NT x64 10.0.19045 Modes:
System Info
|Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz (8 x 3600)| |GPU Status|2d_canvas: enabledcanvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off| |Load (avg)|undefined| |Memory (System)|15.91GB (0.85GB free)| |Process Argv|--crash-reporter-id f23e84c0-a32c-430f-a578-0707fe5c8de2| |Screen Reader|no| |VM|0%|
A/B Experiments
``` vsliv368cf:30146710 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscod805cf:30301675 binariesv615:30325510 vsaa593cf:30376535 py29gd2263:31024239 c4g48928:30535728 azure-dev_surveyone:30548225 a9j8j154:30646983 962ge761:30959799 pythongtdpath:30769146 pythonnoceb:30805159 asynctok:30898717 pythonmypyd1:30879173 2e7ec940:31000449 pythontbext0:30879054 accentitlementsc:30995553 cppperfnew:31000557 dsvsc020:30976470 pythonait:31006305 dsvsc021:30996838 g316j359:31013175 dvdeprecation:31068756 dwnewjupytercf:31046870 2f103344:31071589 impr_priority:31102340 nativerepl1:31139838 refactort:31108082 pythonrstrctxt:31112756 wkspc-onlycs-t:31132770 wkspc-ranged-t:31151552 cf971741:31144450 autoexpandse:31146404 iacca2:31156134 notype1:31157159 5fd0e150:31155592 dwcopilot:31162478 icondisabled:31158250 ```