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

feat: include "triggerReason" and "kind" in code action requests #579

Merged
merged 1 commit into from
Sep 5, 2022

Conversation

rchl
Copy link
Member

@rchl rchl commented Sep 4, 2022

No description provided.

const args: tsp.GetApplicableRefactorsRequestArgs = {
...fileRangeArgs,
triggerReason: context.triggerKind === lsp.CodeActionTriggerKind.Invoked ? 'invoked' : undefined,
kind: context.only?.length === 1 ? context.only[0] : undefined,
Copy link
Member Author

Choose a reason for hiding this comment

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

Typescript only have support for passing 1 kind while in the LSP world it's a list of kinds so I'm only respecting client's kind when there is only one. Alternatively we could filter kinds on our side I guess but for now I'll go with this safer (more backward-compatible) approach.

@rchl rchl merged commit f872078 into master Sep 5, 2022
@rchl rchl deleted the feat/trigger-reason branch September 5, 2022 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant