-
Notifications
You must be signed in to change notification settings - Fork 218
Fix rendering of settings by adding ids to package.json #4209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes the settings UI rendering issue where all extension settings appeared under a single "Extensions->CLI" category instead of being properly organized under their respective categories like "Extensions->CodeQL->CLI", "Extensions->CodeQL->Running queries", etc. The fix involves adding unique id fields to each configuration section in the package.json file.
- Adds
idfields to all 12 configuration sections in package.json - Uses consistent kebab-case naming convention with
codeql-prefix - Improves settings organization and discoverability in VS Code's settings UI
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d10c
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to these docs,
If the configuration has multiple categories of settings, and the category does not have the same title as the extension's display name, then for settings within that category, the settings UI will use the settings ID and the category
idfield to determine the display title.As an example, for settings ID
css.completion.completePropertyWithSemicolonand category IDcss, because the prefix of the settings ID matches with the suffix of the category ID, thecsspart of the settings ID will be removed in the settings UI, and the generated title for the setting will be "Completion: Complete Property With Semicolon".
It doesn't say anything about kebab-case, which makes me think that the more typical format would be (say) "codeQL.cli" instead of "codeql-cli", i.e. the actual prefix from the properties keys.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, according to your screenshot, there remains a difference in the display of the title between codeQL.cli.downloadTimeout (id: codeql-cli, displayed as "Download Timeout" within the "CLI" category) and codeQL.runningQueries.cacheSize (id: codeql-running-queries, displayed as "Code QL > Running Queries: Cache Size" within the "Running queries" category), which makes me suspect that - is treated similar to . in stripping off the prefix from the setting ID. So I would suggest renaming the category id to always be a prefix of the setting IDs beneath it, and seeing if that gives a more consistent look to all the settings.
f573c12 to
270d27b
Compare
d10c
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Still a couple of discrepancies left, which if my theory is correct should display differently from the other settings.
This appears to fix a problem I noticed, where all the settings defined by this extension appeared in the settings UI under "Extensions->CLI" (the name of our first config category), rather than "Extensions->CodeQL->CLI", "Extensions->CodeQL->Running queries", etc.
270d27b to
b517ed5
Compare

This appears to fix a problem I noticed, where all the settings defined by this extension appeared in the settings UI under "Extensions->CLI" (the name of our first config category), rather than "Extensions->CodeQL->CLI", "Extensions->CodeQL->Running queries", etc.
I don't know exactly why this works, but I was just looking for differences between our
package.jsonand that of a different open-source extension.Before
After