forked from qt-creator/qt-creator
ClangCodeModel: Handle UI header updates with clangd
We need to manually refresh the documents that include the generated header, as clangd does not know about it. Change-Id: I8c4303ac029bbb56c01aa99b7950dcc651701678 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -608,6 +608,7 @@ void ClangModelManagerSupport::onAbstractEditorSupportContentsUpdated(const QStr
|
||||
|
||||
const QString mappedPath = m_uiHeaderOnDiskManager.write(filePath, content);
|
||||
m_communicator.unsavedFilesUpdated(mappedPath, content, 0);
|
||||
ClangdClient::handleUiHeaderChange(Utils::FilePath::fromString(filePath).fileName());
|
||||
}
|
||||
|
||||
void ClangModelManagerSupport::onAbstractEditorSupportRemoved(const QString &filePath)
|
||||
@@ -618,6 +619,7 @@ void ClangModelManagerSupport::onAbstractEditorSupportRemoved(const QString &fil
|
||||
const QString mappedPath = m_uiHeaderOnDiskManager.remove(filePath);
|
||||
const QString projectPartId = projectPartIdForFile(filePath);
|
||||
m_communicator.unsavedFilesRemoved({{mappedPath, projectPartId}});
|
||||
ClangdClient::handleUiHeaderChange(Utils::FilePath::fromString(filePath).fileName());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user