File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -4225,7 +4225,14 @@ The method uses `replace-buffer-contents'."
4225
4225
(seq-sort #'lsp--text-edit-sort-predicate)
4226
4226
(mapc (lambda (edit)
4227
4227
(progress-reporter-update reporter (cl-incf done))
4228
- (funcall apply-edit edit))))
4228
+ (funcall apply-edit edit)
4229
+ (when (lsp-snippet-text-edit? edit)
4230
+ (-when-let ((&SnippetTextEdit :range (&RangeToPoint :start)
4231
+ :insert-text-format? :new-text) edit)
4232
+ (when (eq insert-text-format? lsp/insert-text-format-snippet)
4233
+ (let (yas-indent-line)
4234
+ (yas-expand-snippet (lsp--to-yasnippet-snippet new-text)
4235
+ start (+ start (length new-text))))))))))
4229
4236
(when (fboundp 'undo-amalgamate-change-group)
4230
4237
(with-no-warnings (undo-amalgamate-change-group change-group)))
4231
4238
(progress-reporter-done reporter))))))
Original file line number Diff line number Diff line change @@ -475,6 +475,7 @@ See `-let' for a description of the destructuring mechanism."
475
475
(TextDocumentItem (:languageId :text :uri :version ) nil )
476
476
(TextDocumentSyncOptions nil (:change :openClose :save :willSave :willSaveWaitUntil ))
477
477
(TextEdit (:newText :range ) nil )
478
+ (SnippetTextEdit (:newText :range ) (:insertTextFormat ))
478
479
(TypeDefinitionCapabilities nil (:dynamicRegistration :linkSupport ))
479
480
(TypeHierarchyCapabilities nil (:dynamicRegistration ))
480
481
(TypeHierarchyItem (:kind :name :range :selectionRange :uri ) (:children :data :deprecated :detail :parents ))
Original file line number Diff line number Diff line change @@ -568,7 +568,8 @@ The command should include `--message=format=json` or similar option."
568
568
(when lsp-rust-analyzer-server-display-inlay-hints
569
569
(lsp-rust-analyzer-inlay-hints-mode)))
570
570
:ignore-messages nil
571
- :server-id 'rust-analyzer ))
571
+ :server-id 'rust-analyzer
572
+ :custom-capabilities '((experimental . ((snippetTextEdit . , lsp-enable-snippet ))))))
572
573
573
574
(defun lsp-rust-switch-server (&optional lsp-server )
574
575
" Switch priorities of lsp servers, unless LSP-SERVER is already active."
You can’t perform that action at this time.
0 commit comments