Skip to content
  • Nikolai Kosjar's avatar
    Clang: Fix initial document parse with modified content · 6cf1f796
    Nikolai Kosjar authored
    
    
    Reproduce with:
    
      1. Create a new class named Foo with the wizard.
      2. Close foo.h
      3. In foo.cpp, add some class member function.
      4. In foo.cpp, trigger the refactoring action "Add public Declaration"
         for the just defined member function. As a result, foo.h will be
         opened.
         ==> While the declaration was added, the header file is not yet
             reparsed with the new content - this can be verified by setting
             a custom color for "Function".
    
    In this use case, the refactoring action opens the editor and
    immediately modifies the document (RefactoringFile::apply).
    
    Fix by sending the document content along for the very first
    RegisterTranslationUnitForEditorMessage if the document was already
    modified.
    
    Change-Id: If20615a45b72dd0bef87e1870e403d0b277bc5d6
    Reviewed-by: default avatarDavid Schulz <david.schulz@qt.io>
    6cf1f796