Clang vs Visual Studio Intellisense (issues with Clang)

Sysprogs forums Forums VisualGDB Clang vs Visual Studio Intellisense (issues with Clang)

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #20036
    joeb
    Participant

    Comments in these forums suggest that Clang Intellisense should be used instead of Visual Studio’s Intellisense.

    When I used the VisualGDB trial with its default Clang Intellisense, I found that Visual Studio would eventually lose track of what I was clicking on (e.g. a function name that I wanted to right-click and jump to the function definition). It  was behaving as if I had clicked on something that was 3 lines below it. When I set VisualGDB to use Visual Studio’s Intellisense, everything worked again as I would expect.

    Is this a known bug? I can’t remember if it occurs immediately or if it only appears after Visual Studio has been running for many hours (possibly a few days) without being restarted.

    VisualStudio Community 2017 15.5.6.

    VisualGDB 5.3r8 trial

    Windows 8.1 High DPI 5k screen with 200% (default) scaling.

    #20037
    parsec67
    Participant

    I had something similar happen to me a while back, in my case me it was improper line endings that caused Clang Intellisense to see  bomb out. See this thread:

    Clang Intellisense out of whack

    I’ve also noticed it happen sometimes when there is a syntactical error somewhere in the code, such as a missing closing brace, but it is very rare.

    #20040
    support
    Keymaster

    Hi,

    We are not aware of anything like this, however we can still help you pinpoint it. Next time you observe the issue please try switching the IntelliSense engine to the regular VC++ one and back (via the Clang IntelliSense Diagnostics Console). Does this resolve the issue? If not, does reopening the source file resolve the issue, or is restarting VS the only way to solve this?

    #20041
    joeb
    Participant

    My trial has expired and I’m figuring out if I should purchase ‘Custom’ at this time, so I can’t try the diagnostics procedure yet.

    What parsec67 pointed out holds true with my memory of the situation.

    I remember now that when I would regenerate STM32 CubeMX (ST Micro auto-generated boilerplate config) files, that Visual Studio would warn about line endings, which I would always accept to correct the line endings. This should mean that Clang never saw the incorrect line endings though. It just saw a new file with several modifications change all of a sudden.

    Also, yes, the context highlighting gets messed up, even with simple

    #if 0

    blah blah

    #endif

    blocks around temporarily unwanted code portions.

     

    #20067
    support
    Keymaster

    Hi,

    This could be caused by several different issues. If you could attach a screenshot of this, we might be able to pinpoint and fix the problem.

    #20094
    b.timofte
    Participant

    Usually happens when windows CR LF line endings are not fixed by visual studio. Then intellisense gets out of whack

    Just set VS 2015 ..etc to correct line endings or use a python scripts to do it automatically for all your files.

     

     

    ! /usr/bin/env python
    
    <span style="color: #2a00ff;">"Replace LF with CRLF in argument files.  Print names of changed files."</span>
    
    <span style="color: #7f0055;"><b>import</b></span> sys, re, os
    
    def main():
        <span style="color: #7f0055;"><b>for</b></span> filename in sys.argv[1:]:
            <span style="color: #7f0055;"><b>if</b></span> os.path.isdir(filename):
                print filename, <span style="color: #2a00ff;">"Directory!"</span>
                <span style="color: #7f0055;"><b>continue</b></span>
            data = open(filename, <span style="color: #2a00ff;">"rb"</span>).read()
            <span style="color: #7f0055;"><b>if</b></span> <span style="color: #2a00ff;">'\0'</span> in data:
                print filename, <span style="color: #2a00ff;">"Binary!"</span>
                <span style="color: #7f0055;"><b>continue</b></span>
            newdata = re.sub(<span style="color: #2a00ff;">"\r?\n"</span>, <span style="color: #2a00ff;">"\r\n"</span>, data)
            <span style="color: #7f0055;"><b>if</b></span> newdata != data:
                print filename
                f = open(filename, <span style="color: #2a00ff;">"wb"</span>)
                f.write(newdata)
                f.close()
    
    <span style="color: #7f0055;"><b>if</b></span> __name__ == <span style="color: #2a00ff;">'__main__'</span>:
        main()
    
    #20096
    support
    Keymaster

    Hi,

    The CRLF handling should have been fixed in one of the recent maintenance releases. If anyone can confirm that the problem is still present and attach a repro file, we should be able to investigate it quickly and release a hotfix.

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