TextEditor: Fix requesting more proposals than needed

Since

    commit d61d29cf16
    Introduce a basic client for the language server protocol

extra proprosals were requested in the fragile case on a change
notification, e.g. for function signature completion. Restrict this to
the language client proposal, as it was actually intended.

The language client does not support prefixes, so introduce this concept
for deciding whether to request new proposals or not.

Done-with: David Schulz
Change-Id: Ibc1ad82dbeeea93b85f279c59b8c7289fe6ec726
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Nikolai Kosjar
2018-10-23 13:42:58 +02:00
parent a775c9fddc
commit 5601ac2952
4 changed files with 15 additions and 1 deletions

View File

@@ -440,7 +440,7 @@ void CodeAssistantPrivate::notifyChange()
QTC_ASSERT(m_proposal, return);
if (m_editorWidget->position() < m_proposal->basePosition()) {
destroyContext();
} else if (!m_proposal->isFragile()) {
} else if (m_proposal->supportsPrefix()) {
m_proposalWidget->updateProposal(
m_editorWidget->textAt(m_proposal->basePosition(),
m_editorWidget->position() - m_proposal->basePosition()));