Fix Performance Monitor settings file path collision#48251
Open
namdpran8 wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Fixes the settings file path for the Performance Monitor command palette extension so it no longer collides with the shared settings.json used by other CmdPal extensions.
Changes:
- Updates
SettingsJsonPath()to produce a namespaced file name ({Namespace}.settings.json).
| var directory = Utilities.BaseSettingsPath("Microsoft.CmdPal"); | ||
| Directory.CreateDirectory(directory); | ||
| return Path.Combine(directory, "settings.json"); | ||
| return Path.Combine(directory, $"{Namespace}.settings.json"); |
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.
Summary of the Pull Request
Fixes #48224
The Performance Monitor extension was still storing its settings in the shared settings.json file. Since Command Palette built-in extensions now use extension-specific sibling settings files, the extension's settings could be overwritten when Command Palette personalization settings were saved.
This change updates SettingsJsonPath() to store Performance Monitor settings in an extension-specific settings file (performanceMonitor.settings.json), ensuring the network speed unit setting persists correctly.
PR Checklist
Detailed Description of the Pull Request / Additional comments
The Performance Monitor extension had not been migrated to the newer extension-specific settings file architecture. As a result, its settings were stored in the shared settings.json file and could be lost when the Command Palette host rewrote its configuration.
Following @zadjii-msft's guidance in the issue, this PR updates SettingsManager.cs to store Performance Monitor settings in an extension-specific settings file:
performanceMonitor.settings.json
instead of the shared:
settings.json
This aligns the extension with the current Command Palette settings architecture and prevents the network speed unit setting from being overwritten.
Validation Steps Performed
performanceMonitor.settings.jsonfile.Note to reviewers: I left the "Tests" box unchecked because this is a single-line file path configuration change. I did not add an automated test, but I have thoroughly verified the fix manually as described in the Validation steps above.