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

Implement symbol renaming #6

Open
tmcw opened this issue Nov 17, 2023 · 2 comments
Open

Implement symbol renaming #6

tmcw opened this issue Nov 17, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@tmcw
Copy link
Member

tmcw commented Nov 17, 2023

CleanShot 2023-11-17 at 17 09 04@2x

This is supported by monaco and should be available to CodeMirror users. It doesn't seem like TypeScript itself has a method to just "give you a document with a symbol renamed" - it's a matter of finding all instances of the symbol and renaming them there. Closest I can find to a source reference:

https://github.com/microsoft/monaco-editor/blob/091550e89857bd926d2b66e100dc3c2094475783/src/language/typescript/languageFeatures.ts#L1191C48-L1191C48

@tmcw tmcw added the enhancement New feature or request label Nov 17, 2023
@peterje
Copy link
Contributor

peterje commented Feb 13, 2024

What's the expected API here? I guess this is an overarching question for the library as a whole. Should codemirror-ts ship with a default context menu, similar to what Monaco provides? The alternative is to ship some minimal

renameSymbol({offset: number, newSymbolName: string, ...opts})

From my experience, the codemirror ecosystem seems to promote the latter.

@tmcw
Copy link
Member Author

tmcw commented Sep 10, 2024

I think I'd want to ship a command, like you suggest, and an optional UI or keybinding to make it easy to get started, but you can stop using the UI if you want to build your own.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants