From c9521b294fb1ee7c19b2385759052c36fcbd73bf Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 23 Jun 2023 08:44:49 +0200 Subject: [PATCH] Copilot: Disable by default also in the settings ... and make the enabling more prominent. Change-Id: I77e236a1aec2d3ced3280aa8af322a02b8a14dd1 Reviewed-by: Eike Ziller --- src/plugins/copilot/copilotoptionspage.cpp | 2 +- src/plugins/copilot/copilotsettings.cpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/plugins/copilot/copilotoptionspage.cpp b/src/plugins/copilot/copilotoptionspage.cpp index 38c1869445f..2ac25de03b7 100644 --- a/src/plugins/copilot/copilotoptionspage.cpp +++ b/src/plugins/copilot/copilotoptionspage.cpp @@ -67,8 +67,8 @@ public: Column { QString("" + Tr::tr("Note:") + ""), br, warningLabel, br, - authWidget, br, CopilotSettings::instance().enableCopilot, br, + authWidget, br, CopilotSettings::instance().nodeJsPath, br, CopilotSettings::instance().distPath, br, CopilotSettings::instance().autoComplete, br, diff --git a/src/plugins/copilot/copilotsettings.cpp b/src/plugins/copilot/copilotsettings.cpp index b8567f2feb4..5bdd3a54c3f 100644 --- a/src/plugins/copilot/copilotsettings.cpp +++ b/src/plugins/copilot/copilotsettings.cpp @@ -20,7 +20,7 @@ static void initEnableAspect(BoolAspect &enableCopilot) enableCopilot.setDisplayName(Tr::tr("Enable Copilot")); enableCopilot.setLabelText(Tr::tr("Enable Copilot")); enableCopilot.setToolTip(Tr::tr("Enables the Copilot integration.")); - enableCopilot.setDefaultValue(true); + enableCopilot.setDefaultValue(false); } CopilotSettings &CopilotSettings::instance() @@ -52,6 +52,7 @@ CopilotSettings::CopilotSettings() nodeJsPath.setLabelText(Tr::tr("Node.js path:")); nodeJsPath.setHistoryCompleter("Copilot.NodePath.History"); nodeJsPath.setDisplayName(Tr::tr("Node.js Path")); + nodeJsPath.setEnabler(&enableCopilot); nodeJsPath.setToolTip( Tr::tr("Select path to node.js executable. See https://nodejs.org/en/download/" "for installation instructions.")); @@ -62,6 +63,7 @@ CopilotSettings::CopilotSettings() distPath.setLabelText(Tr::tr("Path to agent.js:")); distPath.setHistoryCompleter("Copilot.DistPath.History"); distPath.setDisplayName(Tr::tr("Agent.js path")); + distPath.setEnabler(&enableCopilot); distPath.setToolTip(Tr::tr( "Select path to agent.js in Copilot Neovim plugin. See " "https://github.com/github/copilot.vim#getting-started for installation instructions.")); @@ -70,6 +72,7 @@ CopilotSettings::CopilotSettings() autoComplete.setSettingsKey("Copilot.Autocomplete"); autoComplete.setLabelText(Tr::tr("Request completions automatically")); autoComplete.setDefaultValue(true); + autoComplete.setEnabler(&enableCopilot); autoComplete.setToolTip(Tr::tr("Automatically request suggestions for the current text cursor " "position after changes to the document."));