feat: Add settings for show progress bar

This commit is contained in:
Petr Mironychev 2025-04-02 20:33:23 +02:00
parent 77aca17dcc
commit 7a4926ad7f
4 changed files with 12 additions and 2 deletions

View File

@ -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<TextEditorWidget>(editor)](
const GetCompletionRequest::Response &response) {
QTC_ASSERT(editor, return);

View File

@ -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")),

View File

@ -44,6 +44,8 @@ public:
Utils::StringListAspect customLanguages{this};
Utils::BoolAspect showProgressWidget{this};
// General Parameters Settings
Utils::DoubleAspect temperature{this};
Utils::IntegerAspect maxTokens{this};

View File

@ -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";