sublimelsp / LSP-typescript

TypeScript, JavaScript support for Sublime LSP plugin
MIT License
132 stars 11 forks source link

Listing and renaming private class methods omits hash sign #178

Closed tukusejssirs closed 1 year ago

tukusejssirs commented 1 year ago

When using private class members and classes, LSP and/or LSP-typescript omit hash sign.

When I rename a private class method, the class sign is not in the text box. When I simply rename the method without adding a leading hash sign, the hash sign is removed from the method and thus made public. When I rename the method to a name that includes a leading hash sign, it is renamed correctly as expected. I would expect to place a hash sign into the text box, but select only the rest of the method name.

When I list all methods (etc) using Goto Symbol, it lists all methods without hash sign. I’d expect to list all private methods with a hash sign, as it is required when the function is referenced and/or called.

rchl commented 1 year ago

To make experience better https://github.com/typescript-language-server/typescript-language-server needs to support prepareRename request but also LSP needs some fixes as it doesn't seem to implement that correctly.

Implementing support for prepareRename in https://github.com/typescript-language-server/typescript-language-server/pull/628

tukusejssirs commented 1 year ago

Thanks, @rchl, for your reply, explanation and for the quick PR! :pray:

rchl commented 1 year ago

Fixing LSP in https://github.com/sublimelsp/LSP/pull/2127.

rchl commented 1 year ago

New version of LSP with fixed support for prepareRename is now released.

tukusejssirs commented 1 year ago

Thanks, @rchl, it works perfectly! :pray: