Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 26, 2025

Fixes #252102

Resetting a deprecated setting via the gear menu's "Reset Setting" action would not remove it from the Settings editor. The user had to clear and re-enter the search query for the setting to disappear.

Root cause: refreshSingleElement was checking element.isConfigured without first updating the element's state from the configuration service. After a reset, the element still had stale state showing isConfigured = true.

Fix: Call element.inspectSelf() before checking isConfigured to update the element's state to reflect the current configuration. Then, when a deprecated setting is found to be unconfigured, call refreshTree() to rebuild the tree and remove it (which already excludes unconfigured deprecated settings in settingsTreeModels.ts).

private refreshSingleElement(element: SettingsTreeSettingElement): void {
    if (this.isVisible() && this.settingsTree.hasElement(element)) {
        // Update the element's state to reflect the current configuration
        element.inspectSelf();
        if (!element.setting.deprecationMessage || element.isConfigured) {
            this.settingsTree.rerender(element);
        } else {
            // Deprecated and no longer configured - refresh tree to remove it
            this.refreshTree();
        }
    }
}
Original prompt

This section details on the original issue you should resolve

<issue_title>Unable to reset deprecated setting in the UI</issue_title>
<issue_description>I have chat.tools.terminal.shellIntegrationTimeout set to 200 on Insiders. This is a deprecated setting.

  1. Open the Settings editor.
  2. Search "shell integration".
  3. See a deprecation warning for chat.tools.terminal.shellIntegrationTimeout. Select the setting.
  4. Click the gear icon on the top-left of the setting and select Reset Setting.
  5. 🐛 The setting does not disappear from the editor. I have to clear the search query and search "shell integration" again for the setting to stop showing up.</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…ditor

Co-authored-by: rzhao271 <7199958+rzhao271@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix reset issue for deprecated shell integration setting Fix deprecated setting not disappearing after reset in Settings editor Nov 26, 2025
Copilot AI requested a review from rzhao271 November 26, 2025 17:04
@rzhao271
Copy link
Collaborator

@copilot refreshTree still seems to render the deprecated setting even after it has been reset. The fix is more likely to be in the part of the code that decides which settings get rendered or added to the tree.

… after reset

Co-authored-by: rzhao271 <7199958+rzhao271@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 26, 2025

@copilot refreshTree still seems to render the deprecated setting even after it has been reset. The fix is more likely to be in the part of the code that decides which settings get rendered or added t...

You're right. The issue was that element.isConfigured still had the stale value (true) because the element hadn't been updated after the reset. Added a call to element.inspectSelf() before checking isConfigured to update the element's state from the configuration service. Fixed in ab9bef6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to reset deprecated setting in the UI

2 participants