microsoft / vscode-languageserver-node

Language server protocol implementation for VSCode. This allows implementing language services in JS/TS running on node.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[textDocument/rename] client doesn't obey `RenameOptions` while registering provider

Talv opened this issue · comments

commented

prepareRename handler can't be registered because options.prepareProvider is never being set, even if server does include it in its capabilities.

Fix:

--- a/client/src/client.ts
+++ b/client/src/client.ts
@@ -2002,7 +2002,7 @@ class RenameFeature extends TextDocumentFeature<RenameRegistrationOptions> {
                }
                this.register(this.messages, {
                        id: UUID.generateUuid(),
-                       registerOptions: Object.assign({}, { documentSelector: documentSelector })
+                       registerOptions: Object.assign({}, { documentSelector: documentSelector }, capabilities.renameProvider)
                });
        }

https://github.com/Microsoft/vscode-languageserver-node/blob/d168533600cafd64023cade9f2b5e6dee74134d4/client/src/client.ts#L2005

@Talv very good catch. And sorry for the late response.

Good to know for future contributions.

Thanks for catching this, @Talv!