Skip to content

TS Server Plugin rename supoort transform user input #61702

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

Closed
6 tasks done
mantou132 opened this issue May 15, 2025 · 2 comments
Closed
6 tasks done

TS Server Plugin rename supoort transform user input #61702

mantou132 opened this issue May 15, 2025 · 2 comments
Labels
Declined The issue was declined as something which matches the TypeScript vision Suggestion An idea for TypeScript

Comments

@mantou132
Copy link

mantou132 commented May 15, 2025

πŸ” Search Terms

rename, ts server, plugin

βœ… Viability Checklist

⭐ Suggestion

Current ls interface:

interface LanguageService {
  ...
  findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean, preferences: UserPreferences): readonly RenameLocation[] | undefined;
  ...
}

Add textStyle property to RenameLocation

interface RenameLocation extends DocumentSpan {
    readonly prefixText?: string;
    readonly suffixText?: string;
    readonly textStyle?: 'origin' | 'kebab' | 'camel'
}

As far as I know, this does not require changing the LSP

πŸ“ƒ Motivating Example

When renaming, some templates need to perform symbol conversion

Image

πŸ’» Use Cases

my case:

@customElements('e-my')
class MyElement extends GemElement {
  @emitter sayHi
}

html`<e-my @say-hi=${console.log}></e-my>`

When I rename an emitter name(camelCase), I want the event name(kebabCase) in the html template to transform

@customElements('e-my')
class MyElement extends GemElement {
  @emitter goodBye
}

html`<e-my @good-bye=${console.log}></e-my>`

my plugin: https://github.com/mantou132/gem/blob/main/packages/ts-gem-plugin/src/decorate-ts.ts#L159

vscode issue: microsoft/vscode#248912

@mantou132 mantou132 changed the title TS Server Rename supoort transform user input TS Server Plugin rename supoort transform user input May 15, 2025
@RyanCavanaugh
Copy link
Member

With the changing architecture of the new native TypeScript implementation, we're not going to be further expanding the scope of the existing language service surface area. We'll have more guidance soon on how these scenarios can be achieved in the new codebase; stay tuned.

@RyanCavanaugh RyanCavanaugh added Suggestion An idea for TypeScript Declined The issue was declined as something which matches the TypeScript vision labels May 19, 2025
@typescript-bot
Copy link
Collaborator

This issue has been marked as "Declined" and has seen no recent activity. It has been automatically closed for house-keeping purposes.

@typescript-bot typescript-bot closed this as not planned Won't fix, can't repro, duplicate, stale May 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Declined The issue was declined as something which matches the TypeScript vision Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy