ClangCodeModel: Get document symbols immediately

... when doing a decl/def switch via clangd.
The delay is fine for e.g. populating the outline, but shouldn't be used
when dealing with explicit user requests.

Change-Id: I0350ed6daf8220ec3b702a3876fbf0f726da8a67
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2021-09-14 17:00:16 +02:00
parent 4324f3e8c1
commit bcfe229f8b
8 changed files with 27 additions and 15 deletions

View File

@@ -155,10 +155,10 @@ LanguageClientOutlineWidget::LanguageClientOutlineWidget(Client *client,
&LanguageClientOutlineWidget::handleResponse);
connect(client, &Client::documentUpdated, this, [this](TextEditor::TextDocument *document) {
if (m_client && m_uri == DocumentUri::fromFilePath(document->filePath()))
m_client->documentSymbolCache()->requestSymbols(m_uri);
m_client->documentSymbolCache()->requestSymbols(m_uri, Schedule::Delayed);
});
client->documentSymbolCache()->requestSymbols(m_uri);
client->documentSymbolCache()->requestSymbols(m_uri, Schedule::Delayed);
auto *layout = new QVBoxLayout;
layout->setContentsMargins(0, 0, 0, 0);
@@ -367,7 +367,7 @@ void OutlineComboBox::activateEntry()
void OutlineComboBox::documentUpdated(TextEditor::TextDocument *document)
{
if (document == m_editorWidget->textDocument())
m_client->documentSymbolCache()->requestSymbols(m_uri);
m_client->documentSymbolCache()->requestSymbols(m_uri, Schedule::Delayed);
}
} // namespace LanguageClient