-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Intellisense with latest standards (e.g. C++20) works at the beginning, but forgets the standard as soon as the file is edited #10953
Comments
Can you run the C/C++: Log Diagnostics command before and after the IntelliSense mode seems to change and see if the Standard Version changes from c++20 to c++17 in the logging? Also, in that logging do you see c++17 in the "Custom configurations:" sections, such as in compilerFragments? Checking if the issue repros when |
Thanks Sean. Today it seems that the error squiggles stay there also after a "Reload windows". They are not displayed only when the folder is loaded on start-up. However, apart from date, time and process id, the C++ log diagnostic is basically the same. Here is a copy: Thx `-------- Diagnostics - 15/05/2023, 19:36:17 ------- Workspace parsing diagnostics ------- ` |
Hmm...I'm not reproducing the issue and your logging looks okay. One potential thing to try is setting C_Cpp.intelliSenseCacheSize to 0. Otherwise, I'll see if anyone else on my team can repro this. |
Thanks Sean. C_Cpp.intelliSenseCacheSize=0 does not solve. To be more precise, as soon as the settings file is changed, the squiggles disappear as if it is working. For any editing of the active cpp file, the squiggles come back. Basically, is it possible to have the following without Intellisense squiggles: #include <concepts> template<typename T> concept Numeric = std::integral<T> || std::floating_point<T>; Thanks |
Yes, that normally works (it works for us). We're not sure yet why you're seeing an error. |
hmm, that is strange. Have you tried to write a test file test.cpp, with the two lines above. Now, assuming no squiggles, adding an empty line at the end. That, or any other edit, generate the errors. Notice that it only happens with this feature, C++17 features behave well. |
It works for me with a nearly identical setup -- the only difference I see is I'm using gcc 10.4 instead of 10.2 -- can you upgrade your gcc to 10.4? It's possible there could be a bug with our handling of 10.2. |
ok, I will see if I can install on Debian 11. Thx |
Hmm, built gcc 10.4 from source, gcc -v shows 10.4 now and in config: However the problems remains :( ...And again "Reload Window" or re-saving settings solves the problem until the next edit... And this is also interesting. When I play with the settings:
So this suggest that c++20 works at the begging but then is dropped for any edit action. Really weird |
Do you still have the configurationProvider set? It sounds like you do not. Are you editing a .cpp or .h file? |
Tried both h and cpp, same problem Could you please send me a copy of all the settings files you are using: main config setting, local settings and, if present, c_cpp_properties.json? Also, shall I use this file (c_cpp_properties.json) or just the local settings and config settings? Not clear to me |
@codimoc Unfortunately, our team is still unable to repro this. We're using The fact that it shows c++20 in the Log Diagnostics logging but the errors are still occurring seems to imply there is some unexpected parsing error. Can you run |
No squiggles/ errors in test.out.cpp, even after editing. The file has many lines at the top # 2 "./test.cpp" 2 # 2 "./test.cpp" So it looks like as if Intellisense gets confused in parsing my <concepts> while gcc does a good job when it spits it out at the top. Could it be the depth of the cache when parsing many nested #includes? Maybe this could be a clue. When I check the output for "JSON Language Server" in the bottom output tab, it shows only one line: |
Wow! I have finally resolved the problem. It was very insidious, and this is the story on how I got it solved: I have another Linux box with OpenSuse 15.4. Opensuse tends to have old versions, so my gcc was still v7, but I upgraded from source to v10.4, in line with my Debian laptop. Thanks a lot for the support and the many suggestion given. You helped a lot understanding how it all hang toghether. |
Environment
Bug Summary and Steps to Reproduce
Bug Summary:
When setting Intellisense to use C++ 20 standard and displaying a file containing keywords like "concept" or "requires" (which are features in C++20) it works. As soon as the file is edited again, it seems that it is losing the standard and it shows errors on "concept" as missing symbol. Basically it shows errors as if the standard is back to C++ 17. Any action to reload the workspace or to re-save the file .vscode/settings resolves the errors. However they come back as soon as the file is re-edited.
Steps to reproduce:
Expected behavior:
Intellisense should continue to work on C++20 standard if this is set
Configuration and Logs
Other Extensions
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: