Skip to content

Allow contributed configurations to define additional "search terms"#294221

Merged
mjbvz merged 2 commits intomainfrom
dev/mjbvz/vivacious-parrotfish
Feb 10, 2026
Merged

Allow contributed configurations to define additional "search terms"#294221
mjbvz merged 2 commits intomainfrom
dev/mjbvz/vivacious-parrotfish

Conversation

@mjbvz
Copy link
Copy Markdown
Collaborator

@mjbvz mjbvz commented Feb 10, 2026

For #292934

With the current settings, the only way I can get my settings to show up correctly for searches such as "javascript" or "typescript" is the include those words in the setting description. This can make the setting description less clear. I also tried a setting name such as javascript/typescript.mySetting, but this is pretty long and still doesn't show up correctly when searching

This PR proposes a new "searchTerms" field for configurations to solve this. The search terms are basically just added onto the description for search, but are not show to the user. This will let us use a more readable setting id and description for #292934

@sandy081 @rzhao271 Let me know what you think about this proposal. Happy to try other approaches too if you have any suggestions

Copilot AI review requested due to automatic review settings February 10, 2026 20:22
@vs-code-engineering vs-code-engineering bot added this to the February 2026 milestone Feb 10, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 pull request adds a new "searchTerms" field to configuration properties to help users find settings in the Settings editor without cluttering the visible setting descriptions. This is particularly useful for language-specific settings like JavaScript/TypeScript configurations where searching for "javascript" or "typescript" should surface the unified js/ts.* settings.

Changes:

  • Added searchTerms optional string array field to configuration schema
  • Integrated search terms into the settings search algorithm
  • Updated the configuration extension point to allow extensions to specify search terms

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/vs/platform/configuration/common/configurationRegistry.ts Added searchTerms?: string[] field to IConfigurationPropertySchema interface with documentation
src/vs/workbench/services/preferences/common/preferences.ts Added searchTerms?: string[] field to ISetting interface
src/vs/workbench/services/preferences/common/preferencesModels.ts Updated parseSetting to copy searchTerms from config property to ISetting
src/vs/workbench/api/common/configurationExtensionPoint.ts Added searchTerms to the extension point schema definition with localized description
src/vs/workbench/contrib/preferences/browser/preferencesSearch.ts Modified search logic to include searchTerms in searchable content

Comment thread src/vs/workbench/contrib/preferences/browser/preferencesSearch.ts Outdated
@rzhao271
Copy link
Copy Markdown
Collaborator

Would keywords be clearer?

@mjbvz
Copy link
Copy Markdown
Collaborator Author

mjbvz commented Feb 10, 2026

Thanks. Yes keywords sounds good and matches the top level package.json for the marketplace. Making the change now

for (let lineIndex = 0; lineIndex < searchableLines.length; lineIndex++) {
const descriptionMatches = matchesBaseContiguousSubString(word, searchableLines[lineIndex]);
if (descriptionMatches?.length) {
descriptionMatchingWords.set(word, descriptionMatches.map(match => this.toDescriptionRange(setting, match, lineIndex)));
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self that the range might be invalid if it corresponds to the line of keywords, but that I'm unsure whether the actual range values are used at all these days.

@mjbvz mjbvz merged commit ae0ebc9 into main Feb 10, 2026
18 checks passed
@mjbvz mjbvz deleted the dev/mjbvz/vivacious-parrotfish branch February 10, 2026 23:17
@sandy081
Copy link
Copy Markdown
Member

👍

@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Mar 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants