Variable: eglot-move-to-linepos-function

eglot-move-to-linepos-function is a variable defined in eglot.el.gz.

Value

eglot-move-to-utf-16-linepos

Documentation

Move point to LSP-reported position within a line.

Per the LSP spec, character offsets in LSP Position objects count UTF-16 code units, not actual code points. So when LSP says position 3 of a line containing just "aXbc", where X is a funny looking character in the UTF-16 "supplementary plane", it actually means b, not c. The default value eglot-move-to-utf-16-linepos accounts for this.

This variable can also be set to eglot-move-to-utf-8-linepos or eglot-move-to-utf-32-linepos for servers not closely following the spec. Also, since LSP 3.17 server and client may agree on an encoding and Eglot will set this variable automatically.

Aliases

eglot-move-to-column-function (obsolete since 1.12)

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/eglot.el.gz
(defvar eglot-move-to-linepos-function #'eglot-move-to-utf-16-linepos
  "Move point to LSP-reported position within a line.

Per the LSP spec, character offsets in LSP Position objects count UTF-16
code units, not actual code points.  So when LSP says position 3 of a
line containing just \"aXbc\", where X is a funny looking character in
the UTF-16 \"supplementary plane\", it actually means `b', not `c'.  The
default value `eglot-move-to-utf-16-linepos' accounts for this.

This variable can also be set to `eglot-move-to-utf-8-linepos' or
`eglot-move-to-utf-32-linepos' for servers not closely following the
spec.  Also, since LSP 3.17 server and client may agree on an encoding
and Eglot will set this variable automatically.")