forked from qt-creator/qt-creator
LSP: add Command and CodeAction support to the language client
Change-Id: I9e86c17b87c6b6aef36bd0ca293d9db40c554aad Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -24,7 +24,9 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "languageclientcodeassist.h"
|
||||
|
||||
#include "baseclient.h"
|
||||
#include "languageclientutils.h"
|
||||
|
||||
#include <languageserverprotocol/completion.h>
|
||||
#include <texteditor/codeassist/assistinterface.h>
|
||||
@@ -89,17 +91,6 @@ bool LanguageClientCompletionItem::implicitlyApplies() const
|
||||
bool LanguageClientCompletionItem::prematurelyApplies(const QChar &/*typedCharacter*/) const
|
||||
{ return false; }
|
||||
|
||||
static void applyTextEdit(TextEditor::TextDocumentManipulatorInterface &manipulator,
|
||||
const TextEdit &edit)
|
||||
{
|
||||
using namespace Utils::Text;
|
||||
const Range range = edit.range();
|
||||
const QTextDocument *doc = manipulator.textCursorAt(manipulator.currentPosition()).document();
|
||||
const int start = positionInText(doc, range.start().line() + 1, range.start().character() + 1);
|
||||
const int end = positionInText(doc, range.end().line() + 1, range.end().character() + 1);
|
||||
manipulator.replace(start, end - start, edit.newText());
|
||||
}
|
||||
|
||||
void LanguageClientCompletionItem::apply(TextEditor::TextDocumentManipulatorInterface &manipulator,
|
||||
int /*basePosition*/) const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user