Intellisense bug VS 2017

Sysprogs forums Forums VisualGDB Intellisense bug VS 2017

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #13143
    tapwus
    Participant

    Hi,

    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.

    #13145
    support
    Keymaster

    Hi,

    This looks like VisualGDB mistakenly assumes that those files belong to a VisualGDB-managed project. Please try the following:

    1. Close your solution.
    2. Clear the Clang diagnostic log.
    3. Reopen the solution and open one source file. Ensure the problem persists.
    4. 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.

    #23802
    andreapedica
    Participant

    Hi,

    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.

    #24110
    support
    Keymaster

    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-5.4.103.2978.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.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.