Clang: Add revision and completion management

Reparsing a document is expensive so we should avoid it by all means. In
this patch we prevent that the same document is send again. It isn't send
too in advance of a code completion if there was no changes before the
the completion position.

Change-Id: I0bb786ba1d4e7ce08611a518cb32f8cf8f4d0037
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
Marco Bubke
2015-09-28 17:42:43 +02:00
parent 803cca4086
commit b412eb81ea
18 changed files with 540 additions and 22 deletions

View File

@@ -137,6 +137,7 @@ public:
void updateTranslationUnit(const QString &filePath, const QByteArray &contents, uint documentRevision);
void updateUnsavedFile(const QString &filePath, const QByteArray &contents, uint documentRevision);
void requestDiagnostics(const ClangBackEnd::FileContainer &fileContainer);
void updateChangeContentStartPosition(const QString &filePath, int position);
public: // for tests
IpcSenderInterface *setIpcSender(IpcSenderInterface *ipcSender);
@@ -159,6 +160,7 @@ private:
void onEditorAboutToClose(Core::IEditor *editor);
void onCoreAboutToClose();
private:
IpcReceiver m_ipcReceiver;
ClangBackEnd::ConnectionClient m_connection;
QScopedPointer<IpcSenderInterface> m_ipcSender;