-
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
clang-tidy warnings and fixes are missing when relative paths are output #9555
Comments
Yeah, setting "C_Cpp.codeAnalysis.clangTidy.path": "/usr/lib/llvm/13/bin/clang-tidy" may be required if useBuildPath is true, because our pre-built binary isn't able to locate one of the clang include paths that you have installed on your machine. However, it sounds like you're hitting a bug with no Problems being shown. Do you see "Unexpected output from clang-tidy: FileOffset: 5653. Expected: doc != nullptr." in your output logging still? Either way, that unexpected output is an indication of some bug. I'll investigate... |
Works for me, sadness that it's needed but 🤷
Huh... this bug seems to be dependent on the file I'm looking at. |
The "unexpected output" is from code we added for clang-tidy fix processing, so it would not affect the actual warning but any potential fix that would be available would not be available, so that is why you do see the warnings in the UI (with fixes potentially missing that shouldn't be). There might be a 2nd bug causing the warnings to not appear in certain cases -- we have a known repro of this on our build machines that we're currently investigating, which could share the same root cause. The "doc != nullptr" means there was a problem getting the VS Code document object that corresponds to the file output in the clang-tidy --export-fixes yaml file, possibly due to an unexpected URI format. It looks like we don't log the file path format in our non-debug builds, but I could add that logging. Do you know where the "..." is coming from -- is that what is actually being shown or is that an edit from you? |
The The odd thing to me (and this happens in the terminal too) is that |
I just updated VSCode and extensions (so now on v1.69.0 and v1.11.2 respectively) and now I'm getting even weirder behavior. On the file I originally reported, I'm not seeing any warnings show up in the UI, nor am I seeing any parsing errors. However, on the second file I tried, only 1 out of ~30 reports show up in the UI! Here's the debug output, but only the
The report that shows up is the only one that contains an absolute path (to Here's the original entry for the above file in my
If you're interested, I can share all my unedited output with you privately, but I tried to preserve the original syntax a bit better here. |
I confirmed with another file that had mixed relative and absolute paths that only the reports with absolute paths show up in the UI:
In the above case only the latter report showed up. No idea how/why clang-tidy decides to use different syntax in the same output though? |
I got a repro of the issue (via creating a compile_commands.json with a relative path and useBuildPath set to true) -- both the "doc != nullptr" and the relative file path in the output leading to missing diagnostics. |
I've filed #9574 to track the stddef.h not found issue. |
Fixed with 1.11.3 (pre-release): https://github.com/microsoft/vscode-cpptools/releases/tag/v1.11.3 ...well, it's fixed for the repro cases we tested on -- let us know if you're still seeing any bugs related to the relative paths. |
Environment
Bug Summary and Steps to Reproduce
This might be related to #9091, I was having similar issues before?
With the following config:
I get an
error: 'stddef.h' file not found [clang-diagnostic-error]
fromclang-tidy
(removed our source code lines):The above repros when running the cpptools-provided
clang-tidy
in my terminal.Using my system-provided
clang-tidy
doesn't have this error and provides more reports:However, if I try to make cpptools use by system-provided
clang-tidy
instead:I get no reports in VSCode. I see output matching my terminal in the "C/C++" Output tab, but those reports do not surface up to the Problems tab or highlights in the editor.
Here's the versions from both
clang-tidy
s:Other Extensions
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: