-
Notifications
You must be signed in to change notification settings - Fork 304
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
Bazel Plugin Inteferes with CLion Code Analysis, Making CLion Report Nonexistent Errors #6375
Comments
Hi @erinacio, could you please upgrade the bazel version to 7.1.1 and retry ? Please let us know if you see the same issue. |
It failed to build one of the dependencies. I'm not a bazel guru and the bazel guru in my team is busy working on another project. I suspect we can't easily upgrade bazel version now. |
Could anyone explain what these |
CLion 2024.1 was released and I updated and the behavior somehow changed. The legacy language engine refuses to work on the particular source file (http_headers_test.cc). All tokens except C++ keywords are plain white. Completion also doesn't work. Using Ctrl-Space to trigger completion only shows me a dropdown box with a loading circle. However, the new ReSharper engine somehow, works? All tokens are correctly colored. Code inspection works. Code completion works. No more nonexistent error reported. For now I suspect that that The ReSharper engine is not enabled by default in CLion 2024.1, so I think this regression may still worth being fixed, at least until the ReSharper engine is enabled by default. |
@erinacio the |
@erinacio does the issue exist after non-incremental sync? |
The issue first happened when I cleared the CLion cache and did a full sync with 2024.03.x plugin. The issue didn't disappear after I did more full syncs, regardless of if I cleared the CLion cache or not. |
@erinacio Hi, it is possible to disable the collection of the -ibazel flags during sync with this flag:
Also I tired to reproduce the analysis errors but I was not able to do so. How many of the -ibazel mappings can you find in the compiler info roughly? |
I tried adding the following line to the
For the particular source file
Among which,
|
My apologies for closing this too early. We provided a workaround in the related PR, you can set |
May I have any hint about what might be the cause of this issue? I don't have detailed idea about how clangd-based code inspection works on CLion and how bazel plugin affects that, so it's hard for me to find out what actually went wrong in my case. I tried many times producing a MRE and in all these cases the code inspection just worked without any problem. |
Sorry we don't know what cause clangd to break when the The idea behind the
creates a mapping from
to
This would allow clangd to resolve references to this file in your source code. When creating these mappings we take things like |
and let me add that we're trying to check if the right side a project file, then we map into the project rather than bazel cache. or to external if not. @erinacio can you drop us a simple project that uses libfmt from |
This is a simple project that I used to try to reproduce this issue (and failed to reproduce), with fmtlib and asio as external dependencies. I almost copied the |
We disabled these changes by default with #6534. If you still experience this issue, please reopen this ticket. Edit: The fix is available in v2024.07.02-RC-1 |
Description of the bug:
After upgraded Bazel for CLion plugin to 2024.03.12.0.1-api-version-233, cleared CLion cache and did a full project sync, CLion can't correctly analysis my C++ project, reporting nonexistent problems.
The project builds.
CLion seems to recognize a legitimate C++ source file as C file (and this error is reported on a comment):
and reports a lot of errors:
Other files seems don't have such funny error, but still have issues like failed to parse a
FMT_COMPILE
macro.All those issues disappeared after downgraded the Bazel plugin to 2024.02.27.0.1-api-version-233, cleared CLion cache and did a full project sync.
Which category does this issue belong to?
CLion
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
I'm still struggling understanding this particular problem. Seems that not all .cc source files are affected by this problem. Because the project is proprietary (for now) I can't share you with the exact code that triggers such problem.
Which Intellij IDE are you using? Please provide the specific version.
CLion 2023.3.4
What programming languages and tools are you using? Please provide specific versions.
C++, clang 17.0.6 (from archlinux repo), Bazel 6.2.0
What Bazel plugin version are you using?
2024.03.12.0.1-api-version-233
Have you found anything relevant by searching the web?
Any other information, logs, or outputs that you want to share?
I edited the
clion.sh
launcher script and added these three lines to it:I compared the "Show Compiler Info" result between two Bazel plugin versions, and found that the new Bazel plugin inserted a whole bunch of things like
to the "Compiler switches" section. All other sections remain unchanged (orders may be changed as I sorted them first to do a diff).
The text was updated successfully, but these errors were encountered: