Allow contributed configurations to define additional "search terms"#294221
Allow contributed configurations to define additional "search terms"#294221
Conversation
There was a problem hiding this comment.
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
searchTermsoptional 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 |
|
Would keywords be clearer? |
|
Thanks. Yes |
| 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))); |
There was a problem hiding this comment.
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.
|
👍 |
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 searchingThis 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