Skip to content
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

Merged
merged 5 commits into from
Oct 5, 2023

Conversation

TylerLeonhardt
Copy link
Member

@TylerLeonhardt TylerLeonhardt commented Sep 25, 2023

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.

  • 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

If 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.

image
image

Additionally, these descriptions are diplayed in the keybindings.json editing experience:

image

Commit 2

Rename any description: ICommandHandlerDescription to metadata: 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.

@TylerLeonhardt TylerLeonhardt enabled auto-merge (squash) September 25, 2023 00:04
@TylerLeonhardt TylerLeonhardt self-assigned this Sep 25, 2023
@vscodenpa vscodenpa added this to the September 2023 milestone Sep 25, 2023
@TylerLeonhardt TylerLeonhardt changed the title Tyler/icy-walrus Introduce a concept of Command Descriptions for TF-IDF indexing Sep 25, 2023
Copy link
Member

@jrieken jrieken left a 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.

src/vs/platform/actions/common/actions.ts Outdated Show resolved Hide resolved
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
TylerLeonhardt added a commit that referenced this pull request Oct 4, 2023
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?
@TylerLeonhardt TylerLeonhardt merged commit b3b3473 into main Oct 5, 2023
@TylerLeonhardt TylerLeonhardt deleted the tyler/icy-walrus branch October 5, 2023 14:48
Alex0007 pushed a commit to Alex0007/vscode that referenced this pull request Oct 26, 2023
…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
@github-actions github-actions bot locked and limited conversation to collaborators Nov 19, 2023
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.

Similar commands: "how do I save automatically" does not show Toggle Auto Save
3 participants