diff options
author | David Schulz <david.schulz@qt.io> | 2021-08-12 12:00:58 +0200 |
---|---|---|
committer | David Schulz <david.schulz@qt.io> | 2021-08-16 07:48:22 +0000 |
commit | fdd3b03ba9a6c94c97da57a6d865b15e629bed8f (patch) | |
tree | df75bfe0df556bad5266675213129fa7189a07ee /src/plugins/cpptools/cppcodemodelsettingspage.cpp | |
parent | 68313a1e27d2247889f731ea2f10a06c608c8e10 (diff) | |
download | qt-creator-fdd3b03ba9a6c94c97da57a6d865b15e629bed8f.tar.gz |
clangd: add setting for document update timeout
Change-Id: I4fae2cdff022f6f29566c0316a8ade51d3482466
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/cpptools/cppcodemodelsettingspage.cpp')
-rw-r--r-- | src/plugins/cpptools/cppcodemodelsettingspage.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/plugins/cpptools/cppcodemodelsettingspage.cpp b/src/plugins/cpptools/cppcodemodelsettingspage.cpp index dc04dc3cb8..f591a9c8b3 100644 --- a/src/plugins/cpptools/cppcodemodelsettingspage.cpp +++ b/src/plugins/cpptools/cppcodemodelsettingspage.cpp @@ -197,6 +197,7 @@ public: QCheckBox useClangdCheckBox; QCheckBox indexingCheckBox; QSpinBox threadLimitSpinBox; + QSpinBox documentUpdateThreshold; Utils::PathChooser clangdChooser; }; @@ -216,6 +217,15 @@ ClangdSettingsWidget::ClangdSettingsWidget(const ClangdSettings::Data &settingsD "the project is first opened.")); d->threadLimitSpinBox.setValue(settings.workerThreadLimit()); d->threadLimitSpinBox.setSpecialValueText("Automatic"); + d->documentUpdateThreshold.setMinimum(50); + d->documentUpdateThreshold.setMaximum(10000); + d->documentUpdateThreshold.setValue(settings.documentUpdateThreshold()); + d->documentUpdateThreshold.setSingleStep(100); + d->documentUpdateThreshold.setSuffix(" ms"); + d->documentUpdateThreshold.setToolTip( + tr("Defines the amount of time Qt Creator waits before sending document changes to the " + "server.\n" + "If the document changes again while waiting, this timeout resets.\n")); const auto layout = new QVBoxLayout(this); layout->addWidget(&d->useClangdCheckBox); @@ -227,8 +237,13 @@ ClangdSettingsWidget::ClangdSettingsWidget(const ClangdSettings::Data &settingsD const auto threadLimitLayout = new QHBoxLayout; threadLimitLayout->addWidget(&d->threadLimitSpinBox); threadLimitLayout->addStretch(1); - const auto threadLimitLabel = new QLabel(tr("Set worker thread count:")); + const auto threadLimitLabel = new QLabel(tr("Worker thread count:")); formLayout->addRow(threadLimitLabel, threadLimitLayout); + const auto documentUpdateThresholdLayout = new QHBoxLayout; + documentUpdateThresholdLayout->addWidget(&d->documentUpdateThreshold); + documentUpdateThresholdLayout->addStretch(1); + const auto documentUpdateThresholdLabel = new QLabel(tr("Document update threshold:")); + formLayout->addRow(documentUpdateThresholdLabel, documentUpdateThresholdLayout); layout->addLayout(formLayout); layout->addStretch(1); @@ -265,6 +280,7 @@ ClangdSettings::Data ClangdSettingsWidget::settingsData() const data.executableFilePath = d->clangdChooser.filePath(); data.enableIndexing = d->indexingCheckBox.isChecked(); data.workerThreadLimit = d->threadLimitSpinBox.value(); + data.documentUpdateThreshold = d->documentUpdateThreshold.value(); return data; } |