LanguageClient: filter completion results

Use the optional filter text or the label of a completion item to filter
out results that do not match the current completion prefix. Fixes
completing code with language servers that do not provide server side
filtering.

Done with: Thorbjørn Lindeijer

Change-Id: Id27b88bb4e8f0b8b68d6ee49bd1d41ec11d54c45
Reviewed-by: Thorbjørn Lindeijer <bjorn@lindeijer.nl>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2021-05-31 12:47:35 +02:00
parent f4a8c4590e
commit 14067cca86
3 changed files with 21 additions and 8 deletions

View File

@@ -57,6 +57,7 @@ public:
UTILS_DELETE_MOVE_AND_COPY(AssistProposalItemInterface)
virtual QString text() const = 0;
virtual QString filterText() const { return text(); }
virtual bool implicitlyApplies() const = 0;
virtual bool prematurelyApplies(const QChar &typedCharacter) const = 0;
virtual void apply(TextDocumentManipulatorInterface &manipulator, int basePosition) const = 0;