File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,16 @@ directory containing the package. Example:
113
113
'(:npm :package " typescript"
114
114
:path " tsserver" ))
115
115
116
+ (defun lsp-javascript--rename (_workspace args )
117
+ (let ((path (lsp--uri-to-path (lsp-get (lsp-get args :textDocument ) :uri ))))
118
+ (if (f-exists? path)
119
+ (with-current-buffer (find-file path)
120
+ (goto-char (lsp--position-to-point
121
+ (lsp-get args :position ))))
122
+ (error " There is no file %s " path)))
123
+ (call-interactively #'lsp-rename )
124
+ nil )
125
+
116
126
(lsp-register-client
117
127
(make-lsp-client :new-connection (lsp-stdio-connection (lambda ()
118
128
`(,(lsp-package-path 'typescript-language-server )
@@ -128,6 +138,7 @@ directory containing the package. Example:
128
138
:tsServerPath (lsp-package-path 'typescript )))
129
139
:ignore-messages '(" readFile .*? requested by TypeScript but content not available" )
130
140
:server-id 'ts-ls
141
+ :request-handlers (ht (" _typescript.rename" #'lsp-javascript--rename ))
131
142
:download-server-fn (lambda (_client callback error-callback _update? )
132
143
(lsp-package-ensure
133
144
'typescript
You can’t perform that action at this time.
0 commit comments