microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.51k stars 1.55k forks source link

Clang-Tidy: Not clear when it's running or not #9352

Open H-G-Hristov opened 2 years ago

H-G-Hristov commented 2 years ago

Feature Request

I'm not sure if this is a bug or not. Sometimes, quite often it is not clear if Clang-Tidy is running or experiencing a problem. Especially in automatic mode. Maybe it is taking a lot of time for the Clang-Tidy check to finish but it feels as if it's not running.

sean-mcmanus commented 2 years ago

There's should a flame icon if clang-tidy is running. However, there is a bug that can randomly cause the flame icon to get stuck, in which case you can check if the clang-tidy process is running, and then click the flame icon and choose Cancel to fix the stuck icon.

With 1.9.8, clang-tidy 13 is installed, and with 1.10.2 it's 14 (that could change with a different C_Cpp.codeAnalysis.clangTidy.path setting). We don't currently retrieve the version, but it's on our TODO list.

A clang-diagnostic-error means there was a problem compiling with clang. That error isn't currently disable-able. Do you get the same error when compiling with clang or clang-tidy itself? You could try setting the C_Cpp.codeAnalysis.clangTidy.useBuildPath if you have a compile_commands.json available, but you might also need to set C_Cpp.codeAnalysis.clangTidy.path to the clang-tidy path installed on your machine.

bobbrow commented 2 years ago

Linking this to #8405 where we would be moving our statuses to a single flyout. Individual statuses will have more display area for text and hopefully make it more apparent what background tasks are in progress.

sean-mcmanus commented 2 years ago

@bobbrow It's not clear from the user's report what issue they're hitting and/or if it's related to #8405 or not.

H-G-Hristov commented 2 years ago

@sean-mcmanus Not really.

The part with the clang error. This seems to have started appearing recently and may not be related to Clang-Tidy as I see it in other projects where I haven't enabled code analysis.

Here is a screenshot of the variations of the squiggle I see in a project without:

    "C_Cpp.codeAnalysis.clangTidy.enabled": true,
    "C_Cpp.intelliSenseEngineFallback": "Enabled",

Screen Shot 2022-06-01 at 08 44 44

I have the current released version of VSCode and the cpptools extension/cmake-tools and I have updated to the latest Xcode.

I use VScode on macOS Monterey and Ubuntu 22.04. The screenshot was made on macOS.

H-G-Hristov commented 2 years ago

@bobbrow

Linking this to #8405 where we would be moving our statuses to a single flyout. Individual statuses will have more display area for text and hopefully make it more apparent what background tasks are in progress.

This sounds good. Are there any plants to create a generic API similar to the Testing API/UI for extensions providing compiler support so that there is a similar workflow lets say for C++, Rust, Swift - like Project Outline provided by the CMake extension with Configure, Build, Install buttons to get a similar UX as a more common IDE (VS 2022)?

sean-mcmanus commented 2 years ago

I'm not aware of any generic, cross-language API for providing compiler info.

It looks like you're having configuration problems with system headers. Additional logging from running C/C++: Log Diagnostics might help.

bobbrow commented 2 years ago

This sounds good. Are there any plants to create a generic API similar to the Testing API/UI for extensions providing compiler support so that there is a similar workflow lets say for C++, Rust, Swift - like Project Outline provided by the CMake extension with Configure, Build, Install buttons to get a similar UX as a more common IDE (VS 2022)?

The general idea for the flyout is that it will report status on transient/background operations (replacing the individual icons on the status bar today). We show these statuses so that if there is a delay in the editor for some reason the developer can discover why. It will not be a persistent UI like the Project Outline.

cilence commented 2 years ago

I have the same problem,may I ask if it can provide the function of the shielding clang-diagnostic-error output

sean-mcmanus commented 2 years ago

@cilence Clang diagnostic errors are not currently disablable, other than avoiding running clang-tidy on particular files, perhaps via C_Cpp.codeAnalysis.exclude, or running a Clear code analysis error code action. You could file a new feature request issue on that.