(defun eglot--signal-textDocument/didSave ()
"Send textDocument/didSave to server."
(eglot--signal-textDocument/didChange)
- (jsonrpc-notify
- (eglot--current-server-or-lose)
- :textDocument/didSave
- (list
- ;; TODO: Handle TextDocumentSaveRegistrationOptions to control this.
- :text (buffer-substring-no-properties (point-min) (point-max))
- :textDocument (eglot--TextDocumentIdentifier))))
+ (when (eglot--server-capable :textDocumentSync :save)
+ (jsonrpc-notify
+ (eglot--current-server-or-lose)
+ :textDocument/didSave
+ (list
+ ;; TODO: Handle TextDocumentSaveRegistrationOptions to control this.
+ :text (buffer-substring-no-properties (point-min) (point-max))
+ :textDocument (eglot--TextDocumentIdentifier)))))
(defun eglot-flymake-backend (report-fn &rest _more)
"A Flymake backend for Eglot.