-
Notifications
You must be signed in to change notification settings - Fork 464
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
Warnings such as variable 'as' is not initialized [cppcoreguidelines-init-variables]GCC
not cleared on fixing it and saving the file
#4079
Comments
@sean-mcmanus From what I can tell, these are coming from the C/C++ extension, can you confirm? And if so, I'll transfer the issue |
@gcampbell-msft This was already reported for the C/C++ extension at microsoft/vscode-cpptools#12716 . The errors labeled with C/C++ on the right are from our extension (so I think those are our issues), but the GCC ones are from another, maybe CMake Tools or from CMake -- the CMakeLists.txt might have some clang-tidy on build feature enabled. |
I believe I see that we're populating this. @thernstig There are two things that I believe you could do:
|
@gcampbell-msft you are correct, the errors go away on rebuild. I understand the rationale behind this. I have set There are two things that makes this hard UX-wise for users when we see the error: variable name 'a' is too short, expected at least 3 characters [readability-identifier-length] GCC
Are these feasible and make sense? |
I don't agree with this suggestion. Build errors should persist until the next build. Visual Studio behaves the same way. When I work through a list of build problems (e.g. when I'm refactoring code), I don't want the ones I haven't fixed yet to suddenly disappear because I fixed other ones in the file. That would require me to rebuild and that can take time. And I don't think CMake Tools should automatically rebuild the file on edit/save. And I don't know of a way to make an error show in the Problems pane without also drawing a squiggle. In VS Code, extensions just report the Problems and VS Code handles the rest. |
What CMake Tools could potentially do is add a code action for the build errors that allow you to dismiss them one by one. |
@bobbrow I am not sure being able to dismiss them one-by-one is something I would personally use, maybe others would. How would one solve the problem with that the yellow squigglies end up in the wrong place when doing any edits to the file? Are there any other ideas, or are we saying we have to live with this incorrect-placement-of-yellow-squigglies-on-further-edits? I cannot come up with a good idea myself. aside: Should I write a separate issue about the |
@gcampbell-msft Users want to know if we have a better solution to the problem of the yellow wavy line appearing in the wrong place, and if we need to create a new issue about unclear output. |
@thernstig I agree that it can be confusing, but based on the discussion and the options, I don't think there is any fix we will do here. However, @thernstig I think it'd be great if you created a new issue and maybe even contributed a change to make the THanks! |
@gcampbell-msft I will contemplate this, thanks. |
Brief Issue Summary
This is a quite serious bug, as it completely hampers working with this tool when having errors and clearing them.
If you have common errors and then save a file, the errors do not get away on save. They stay. See here:
See also this capture. I am saving the file in between changes done in this video, before I hover the error:
test.mp4
I have no idea why this tool even shows errors like this, I initially wrote a bug report here microsoft/vscode-cpptools#12716 thinking it was the C/C++ extension from Microsoft that had this problem, since it has built-in support for clang-tidy. But for some reason this CMake extension decides to also show errors. And those errors are not removed on save.
This issue is thus about that the errors are not cleared when you fix them and save the file.
Also, is there a way to completely disable them in settings? I already have the C/C++ to show these errors.
CMake Tools Diagnostics
Debug Log
Additional Information
No response
The text was updated successfully, but these errors were encountered: