Function: eca-editor--lsp-location->eca

eca-editor--lsp-location->eca is a natively compiled function defined in eca-editor.el.

Signature

(eca-editor--lsp-location->eca LOCATION)

Documentation

Convert a lsp Location or LocationLink LOCATION to an eca location.

Source Code

;; Defined in /nix/store/jklqzw6pzz6j4jrbv8wy0iwgi7jlrbld-emacs-packages-deps/share/emacs/site-lisp/elpa/eca-20260928.1827/eca-editor.el
(defun eca-editor--lsp-location->eca (location)
  "Convert a lsp Location or LocationLink LOCATION to an eca location."
  (when location
    (let ((uri (or (eca-editor--lsp-obj-get location :uri)
                   (eca-editor--lsp-obj-get location :targetUri)))
          (range (or (eca-editor--lsp-obj-get location :range)
                     (eca-editor--lsp-obj-get location :targetSelectionRange)
                     (eca-editor--lsp-obj-get location :targetRange))))
      (when (and uri range)
        (list :uri uri
              :range (list :start (eca-editor--lsp-position->eca
                                   (eca-editor--lsp-obj-get range :start))
                           :end (eca-editor--lsp-position->eca
                                 (eca-editor--lsp-obj-get range :end))))))))