diff --git a/QodeAssistClient.cpp b/QodeAssistClient.cpp index 0841389..c5389b8 100644 --- a/QodeAssistClient.cpp +++ b/QodeAssistClient.cpp @@ -151,7 +151,9 @@ void QodeAssistClient::requestCompletions(TextEditor::TextEditorWidget *editor) {TextDocumentIdentifier(hostPathToServerUri(filePath)), documentVersion(filePath), Position(cursor.mainCursor())}}; - m_progressHandler.showProgress(editor); + if (Settings::codeCompletionSettings().showProgressWidget()) { + m_progressHandler.showProgress(editor); + } request.setResponseCallback([this, editor = QPointer(editor)]( const GetCompletionRequest::Response &response) { QTC_ASSERT(editor, return); diff --git a/settings/CodeCompletionSettings.cpp b/settings/CodeCompletionSettings.cpp index bff5055..1afc9b8 100644 --- a/settings/CodeCompletionSettings.cpp +++ b/settings/CodeCompletionSettings.cpp @@ -202,6 +202,10 @@ CodeCompletionSettings::CodeCompletionSettings() "(space-separated), file extensions (space-separated)")); customLanguages.setDefaultValue({{"cmake,#,cmake,CMakeLists.txt"}, {"qmake,#,qmake,pro pri"}}); + showProgressWidget.setSettingsKey(Constants::CC_SHOW_PROGRESS_WIDGET); + showProgressWidget.setLabelText(Tr::tr("Show progress indicator during code completion")); + showProgressWidget.setDefaultValue(true); + useProjectChangesCache.setSettingsKey(Constants::CC_USE_PROJECT_CHANGES_CACHE); useProjectChangesCache.setDefaultValue(true); useProjectChangesCache.setLabelText(Tr::tr("Max Changes Cache Size:")); @@ -281,7 +285,8 @@ CodeCompletionSettings::CodeCompletionSettings() Row{autoCompletionCharThreshold, autoCompletionTypingInterval, startSuggestionTimer, - Stretch{1}}}}, + Stretch{1}}, + showProgressWidget}}, Space{8}, Group{ title(Tr::tr("General Parameters")), diff --git a/settings/CodeCompletionSettings.hpp b/settings/CodeCompletionSettings.hpp index d3211c6..7aaa1dd 100644 --- a/settings/CodeCompletionSettings.hpp +++ b/settings/CodeCompletionSettings.hpp @@ -44,6 +44,8 @@ public: Utils::StringListAspect customLanguages{this}; + Utils::BoolAspect showProgressWidget{this}; + // General Parameters Settings Utils::DoubleAspect temperature{this}; Utils::IntegerAspect maxTokens{this}; diff --git a/settings/SettingsConstants.hpp b/settings/SettingsConstants.hpp index 880dcf6..226c20c 100644 --- a/settings/SettingsConstants.hpp +++ b/settings/SettingsConstants.hpp @@ -55,6 +55,7 @@ const char CC_PRESET1_URL_HISTORY[] = "QodeAssist.ccPreset1UrlHistory"; // settings const char ENABLE_QODE_ASSIST[] = "QodeAssist.enableQodeAssist"; const char CC_AUTO_COMPLETION[] = "QodeAssist.ccAutoCompletion"; +const char CC_SHOW_PROGRESS_WIDGET[] = "QodeAssist.ccShowProgressWidget"; const char ENABLE_LOGGING[] = "QodeAssist.enableLogging"; const char ENABLE_CHECK_UPDATE[] = "QodeAssist.enableCheckUpdate"; const char ENABLE_CHAT[] = "QodeAssist.enableChat";