December 3, 2017 at 11:38 #13143
While working on a Cmake project in Visual Studio, I encountered an intellisense autocomplete bug.
Looking at the clang log i would see messages saying “Cannot retrieve source backend for ‘<filename>’ “. Autocomplete was broken in all files.
Tried changing the clang intellisense state in tools->options but to no effect.
Removing VisualGBD immediately solved the issue.
Would appreciate any help on why this issue occurs.
Thanks.December 3, 2017 at 18:48 #13145
This looks like VisualGDB mistakenly assumes that those files belong to a VisualGDB-managed project. Please try the following:
- Close your solution.
- Clear the Clang diagnostic log.
- Reopen the solution and open one source file. Ensure the problem persists.
- Post the entire Clang log here. It should explain what projects are considered open by the IntelliSense and why it attaches to your files.
Also as a quick workaround while diagnosing this you can change the default engine on the Clang IntelliSense Diagnostic Console to “VS IntelliSense” while not working with VisualGDB projects. This should prevent it from attaching to the files unless the project referencing them explicitly enables Clang IntelliSense via settings.February 11, 2019 at 01:10 #23802
I fell in this “old” topic by searching on google about a very simlar problem with CLang + VS2017 + VisualGDB.
Actually, I found that Clang Diagnostics Console shows problems with .c modules recently added to a project, or where we add some new includes. If we close the solution and reopen to try to fix IntelliSense, this will continue to give a failure until we close all open files of the solution: it seems like Clang fails to reparse modules that are automatically opened when we open the solution (VS remembers the last modules opened before we close a solution).
So, if sometimes I still encounter the failure of IntelliSense, I do following steps:
- close all open modules and files of the solution (right click on a file tab, and select “close all documents”
- close the solution
- reopen the solution, verifying that no document is automatically opened by VS
- check the Clang Intellisense Diagnostic Console that wil no more show problems on modules parsing
Hope this can help someone else.March 7, 2019 at 03:23 #24110
Thanks for sharing this.
We have tested a few scenarios related to IntelliSense in newly added files and have found one potential cause of the problems: if you add a header file to the project and do not include it from any source files, the Clang IntelliSense will try to guess the compiler arguments for that file, that might not always be correct, especially for projects with multiple targets. We have added a special warning for this case and a button that allows rescanning the solution for files that could include the header file without reopening it.
If anyone else encounters issues with header files and Clang IntelliSense, please try this build: VisualGDB-220.127.116.1178.msi
We have also published a tutorial on diagnosing IntelliSense-related problems here: https://visualgdb.com/tutorials/IntelliSense/
We will try to make this process fully automatic in one of the next VisualGDB releases.
You must be logged in to reply to this topic.