Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions lsp-ltex.el
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,33 @@ and concatenate them."
(setq res (plist-put res prop (vconcat val (plist-get res prop))))))
res))

;;
;; (@* "LTeX Special Commands")
;;

;; https://valentjn.github.io/ltex/ltex-ls/server-usage.html#_ltexcheckdocument-server
(defun lsp-ltex-check-document ()
"Trigger the check of the current buffer/region."
(interactive)
(when-let ((file (buffer-file-name)))
(let* ((uri (lsp--path-to-uri file))
(beg (region-beginning))
(end (region-end))
(req (if (region-active-p)
`(:uri ,uri
:range ,(lsp--region-to-range beg end))
`(:uri ,uri)))
(ret (lsp-send-execute-command "_ltex.checkDocument" req)))
(if (and ret (plist-get ret :success))
(message "Command executed successfully.")
(message "An error occured while executing the command: %s"
(plist-get ret :errorMessage))))))

;; https://valentjn.github.io/ltex/ltex-ls/server-usage.html#_ltexgetserverstatus-server
(defun lsp-ltex-get-server-status ()
"Get the server status."
(lsp-send-execute-command "_ltex.getServerStatus"))

;;
;; (@* "Installation and Upgrade" )
;;
Expand Down