Repository navigation
Don't suggest C/C++ DevTools when AI features are disabled - #5165
Open
Zuhair Khalid (zuhairkhalid229) wants to merge 1 commit into
Open
Zuhair Khalid (zuhairkhalid229) wants to merge 1 commit into
Zuhair Khalid (zuhairkhalid229) wants to merge 1 commit into
Conversation
chat.disableAIFeatures turns Copilot off, but the suggestion only checked whether Copilot is installed, which bundled Copilot always is. Skip the suggestion when the setting is on. Fixes microsoft#5163
Author
|
@microsoft-github-policy-service agree |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5163.
With
"chat.disableAIFeatures": true, CMake Tools still suggests installing C/C++ DevTools "to give Copilot more accurate code understanding".DevToolsNotification.showIfNeededonly checks whether Copilot is installed, and VS Code ships Copilot bundled, so the check passes even when the user has turned AI features off.This adds an
areAIFeaturesDisabled()check (vscode.workspace.getConfiguration('chat').get<boolean>('disableAIFeatures', false)) to both eligibility guards inshowIfNeeded: the first one, so the suggestion is skipped before the bundled-Copilot manifest is read, and the one afterisCopilotInstalled(), which already re-checks what can change during that await.getreturns thefalsedefault, so nothing changes there.vscode.extensions.onDidChange, andstart()already re-checks on that event, so no configuration listener is added.Testing
New unit test in
test/unit-tests/devToolsNotification.test.ts: bundled Copilot (absent from the extension registry, manifest underappRoot) withchat.disableAIFeaturesstubbed totrue(other configuration sections pass through). It checks that no toast is shown and the bundled manifest isn't read.I ran this repo's Linux CI workflow (build, lint, backend and unit suites) on my fork:
yarn compile-production-ciandyarn lintpass, backend tests pass, unit tests 410 passing, 4 pending.src/ui/devToolsNotification.ts: unit tests 409 passing, 1 failing: the new test (AssertionError: expected true to equal false).Changelog
Added under a new
## 1.26heading, since1.25.10is already released. Happy to move it if you'd rather keep it somewhere else.