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(tsserver): add _typescript.rename handler #2808

Closed
wants to merge 1 commit into from
Closed

feat(tsserver): add _typescript.rename handler #2808

wants to merge 1 commit into from

Conversation

faergeek
Copy link

tsserver calls this method after extracting a variable or function via code action. It enables giving extracted function or variable a name right away without requiring a separate step. Otherwise extracted variable or function is left with a generic name like "newLocal".

tsserver calls this method after extracting a variable or function via
code action. It enables giving extracted function or variable a name
right away without requiring a separate step. Otherwise extracted
variable or function is left with a generic name like "newLocal".
@faergeek
Copy link
Author

faergeek commented Sep 13, 2023

I understand that this is an off-spec handler, though despite that I saw some handlers like eslint/openDoc or similar. The difference might be that eslint code action won't work without eslint/openDoc method at all and _typescript.rename is just for convenience. At the same time this doesn't look like a complicated handler.

@justinmk
Copy link
Member

I've discouraged building up features in lspconfig beyond just the minimum needed for basic configuration. We can't maintain hundreds of special handlers for LSP servers, that should be pushed out to specialized plugins.

One thing we should do in lspconfig is establish a pattern for recommending third-party plugins for a given LSP server.

@faergeek
Copy link
Author

Fair. I just noticed that some specific handlers were here already and thought may be this one could be added as well.

But leaving it to language-specific plugins makes sense, since it's absence doesn't break anything.

@faergeek faergeek closed this Sep 13, 2023
@faergeek faergeek deleted the add-typescript-rename-handler branch September 13, 2023 09:27
@justinmk
Copy link
Member

justinmk commented Sep 13, 2023

Fair. I just noticed that some specific handlers were here already and thought may be this one could be added as well.

Yeah. I mean we could add this one too, though it's a slippery slope because we keep getting more. As a typescript user I agree this would be a nice feature.

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.

2 participants