forked from qt-creator/qt-creator
Clang: Remove ClangEditorDocumentProcessor from ClangCompletionAssistProcessor
Change-Id: I15b0124b980b0df974cc4405b5834919659d6834 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
@@ -30,13 +30,13 @@
|
|||||||
#include "clangassistproposalmodel.h"
|
#include "clangassistproposalmodel.h"
|
||||||
#include "clangcompletionassistprocessor.h"
|
#include "clangcompletionassistprocessor.h"
|
||||||
#include "clangcompletioncontextanalyzer.h"
|
#include "clangcompletioncontextanalyzer.h"
|
||||||
#include "clangeditordocumentprocessor.h"
|
|
||||||
#include "clangfunctionhintmodel.h"
|
#include "clangfunctionhintmodel.h"
|
||||||
#include "clangcompletionchunkstotextconverter.h"
|
#include "clangcompletionchunkstotextconverter.h"
|
||||||
#include "clangpreprocessorassistproposalitem.h"
|
#include "clangpreprocessorassistproposalitem.h"
|
||||||
|
|
||||||
#include <cpptools/cppdoxygen.h>
|
#include <cpptools/cppdoxygen.h>
|
||||||
#include <cpptools/cppmodelmanager.h>
|
#include <cpptools/cppmodelmanager.h>
|
||||||
|
#include <cpptools/cpptoolsbridge.h>
|
||||||
#include <cpptools/editordocumenthandle.h>
|
#include <cpptools/editordocumenthandle.h>
|
||||||
|
|
||||||
#include <texteditor/codeassist/assistproposalitem.h>
|
#include <texteditor/codeassist/assistproposalitem.h>
|
||||||
@@ -54,6 +54,7 @@
|
|||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QDirIterator>
|
#include <QDirIterator>
|
||||||
|
#include <QTextDocument>
|
||||||
|
|
||||||
namespace ClangCodeModel {
|
namespace ClangCodeModel {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -651,17 +652,6 @@ void setLastCompletionPosition(const QString &filePath,
|
|||||||
document->sendTracker().setLastCompletionPosition(completionPosition);
|
document->sendTracker().setLastCompletionPosition(completionPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString projectPartIdForEditorDocument(const QString &filePath)
|
|
||||||
{
|
|
||||||
auto projectPart = ClangEditorDocumentProcessor::get(filePath)->projectPart();
|
|
||||||
|
|
||||||
QString projectPartId;
|
|
||||||
|
|
||||||
if (projectPart)
|
|
||||||
projectPartId = projectPart->id();
|
|
||||||
|
|
||||||
return projectPartId;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ClangCompletionAssistProcessor::sendCompletionRequest(int position,
|
bool ClangCompletionAssistProcessor::sendCompletionRequest(int position,
|
||||||
@@ -682,7 +672,7 @@ bool ClangCompletionAssistProcessor::sendCompletionRequest(int position,
|
|||||||
setLastDocumentRevision(filePath);
|
setLastDocumentRevision(filePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString projectPartId = projectPartIdForEditorDocument(filePath);
|
const QString projectPartId = CppTools::CppToolsBridge::projectPartIdForFile(filePath);
|
||||||
ipcCommunicator.completeCode(this, filePath, uint(line), uint(column), projectPartId);
|
ipcCommunicator.completeCode(this, filePath, uint(line), uint(column), projectPartId);
|
||||||
setLastCompletionPosition(filePath, position);
|
setLastCompletionPosition(filePath, position);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user