-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Introduce a concept of Command Descriptions for TF-IDF indexing #193937
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.
Looking good, left some nit about the shape of MenuItemAction which should be addressed.
I understand the preference for ILocalizedString
but I also have to say its ergnomics aren't great. The duplication of strings is annyoing and it's basically only because our NLS tool has short comings.
This does a few things in a few strategic commits: ### Commit 1 The first commit contains the actual functional changes. * In our TF-IDF implementation in the Command Palette we now consume command's description if available. This will help provide more hits in the similar commands category section of the Command Palette. To do this we now include the description in the MenuItem which is needed by the Command Palette. * It allows Allows `description` to be an `ILocalizedString` so that we can include both the translated & original strings in the TF-IDF calculation
bd4635f
to
f0101f1
Compare
This depends on #193937 and would allow Editor Commands' descriptions to be picked up in the TF-IDF indexing of commands. The problem I currently struggle with is what to do with this introduction of `ICommandMetadata`... do we want to add it to monaco? Do we want to add maybe a subset of it (just the description property)? Additionally, I noticed that the concept of a LocalizedString isn't a thing in the monaco API... so that would be _another_ thing to introduce. Should we add these types? Or should we have `description` be a `string` and then use that instead?
…osoft#193937) * Introduce a concept of Command Descriptions for TF-IDF indexing This does a few things in a few strategic commits: ### Commit 1 The first commit contains the actual functional changes. * In our TF-IDF implementation in the Command Palette we now consume command's description if available. This will help provide more hits in the similar commands category section of the Command Palette. To do this we now include the description in the MenuItem which is needed by the Command Palette. * It allows Allows `description` to be an `ILocalizedString` so that we can include both the translated & original strings in the TF-IDF calculation * Rename any `description: ICommandHandlerDescription` to `metadata: ICommandMetadata` * move to localize2 * Joh's feedback * Add a description for auto save
COMPETING PR OF #193626 AND #193631
I recommend reviewing each commit at a time since a lot of this PR is renaming.
Commit 1
The first commit contains the actual functional changes.
description
to be anILocalizedString
so that we can include both the translated & original strings in the TF-IDF calculationIf a description is contributed, then that will be included in the TF-IDF chunk calculation. This allows us to include additional relevant information that will help the Command Palette find the command you're looking for.
Additionally, these descriptions are diplayed in the keybindings.json editing experience:
Commit 2
Rename any
description: ICommandHandlerDescription
tometadata: ICommandMetadata
Commit 3
moves to using
localize2
Commit 4
addresses some feedback
Commit 5
Fixes #194108
Next steps
After this goes in, I'll work on lighting up the same for Editor Commands.