Skip to content
  • Nikolai Kosjar's avatar
    Clang: Honor fixits own locations · 46840046
    Nikolai Kosjar authored
    
    
    ...when showing the refactoring marker and generating the quick fix
    operations.
    
    Opening main.cpp
    
      main.cpp:
       #include "file.h"
       void f(char *s) { foo(s); }
    
      file.h:
        // significant line 1
        // significant line 2
        // significant line 3
        bool foo(int fd);
    
    led to
    
        SOFT ASSERT: "textBlock.isValid()" in file
        clangdiagnosticmanager.cpp, line 205
    
    and a misbehavior when applying the fixit from the tooltip.
    
    We take the line of a diagnostic to display the fixit marker if it has
    any fixits. But the (child) diagnostic might be issued for an other file
    (that's what happening here), so better take the line of the location
    where the fixit is meant to be applied.
    
    Same applies for generation of the quick fix entries.
    
    Change-Id: I48d38420b285d2d2f86e3faa2319513aa8b47848
    Reviewed-by: default avatarChristian Kandeler <christian.kandeler@theqtcompany.com>
    Reviewed-by: default avatarDavid Schulz <david.schulz@theqtcompany.com>
    46840046