-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues when buffer contains special characters #124
Labels
Comments
joaotavora
added a commit
that referenced
this issue
Nov 7, 2018
* eglot-tests.el (issue-124): New test. * eglot.el (eglot--lsp-char-to-column): New helper. (eglot--lsp-position-to-point): Use eglot--lsp-char-to-column. * fixtures/utf16.cpp: New test fixture
joaotavora
added a commit
that referenced
this issue
Nov 8, 2018
* eglot-tests.el (issue-124): New test. * eglot.el (eglot--lsp-char-to-column): New helper. (eglot--lsp-position-to-point): Use eglot--lsp-char-to-column. * fixtures/utf16.cpp: New test fixture
mkcms
added a commit
that referenced
this issue
Nov 11, 2018
The spec says that :character offsets are based on a UTF-16 representation. Previously we were assuming that :character specifies the number of characters. * eglot.el (eglot-full-position-conversion): New defvar. (eglot--count-characters): New function. (eglot--pos-to-lsp-position): (eglot--lsp-position-to-point): Use it.
bhankas
pushed a commit
to bhankas/emacs
that referenced
this issue
Sep 18, 2022
Also close joaotavora/eglot#125. Idea and much of design contributed by Michał Krzywkowski <[email protected]> This introduces the variable eglot-move-to-column-function. According to the standard, LSP column/character offsets are based on a count of UTF-16 code units, not actual visual columns. So when LSP says position 3 of a line containing just \"aXbc\", where X is a multi-byte character, it actually means `b', not `c'. This is what the function `eglot-move-to-lsp-abiding-column' does. However, many servers don't follow the spec this closely, and thus this variable should be set to `move-to-column' in buffers managed by those servers. * eglot.el (eglot-move-to-column-function): New variable. (eglot-move-to-lsp-abiding-column): New function. (eglot--lsp-position-to-point): Use eglot-move-to-column-function.
bhankas
pushed a commit
to bhankas/emacs
that referenced
this issue
Sep 19, 2022
Also close joaotavora/eglot#125. Idea and much of design contributed by Michał Krzywkowski <[email protected]> This introduces the variable eglot-move-to-column-function. According to the standard, LSP column/character offsets are based on a count of UTF-16 code units, not actual visual columns. So when LSP says position 3 of a line containing just \"aXbc\", where X is a multi-byte character, it actually means `b', not `c'. This is what the function `eglot-move-to-lsp-abiding-column' does. However, many servers don't follow the spec this closely, and thus this variable should be set to `move-to-column' in buffers managed by those servers. * eglot.el (eglot-move-to-column-function): New variable. (eglot-move-to-lsp-abiding-column): New function. (eglot--lsp-position-to-point): Use eglot-move-to-column-function.
bhankas
pushed a commit
to bhankas/emacs
that referenced
this issue
Sep 19, 2022
Also close #125. Idea and much of design contributed by Michał Krzywkowski <[email protected]> This introduces the variable eglot-move-to-column-function. According to the standard, LSP column/character offsets are based on a count of UTF-16 code units, not actual visual columns. So when LSP says position 3 of a line containing just \"aXbc\", where X is a multi-byte character, it actually means `b', not `c'. This is what the function `eglot-move-to-lsp-abiding-column' does. However, many servers don't follow the spec this closely, and thus this variable should be set to `move-to-column' in buffers managed by those servers. * eglot.el (eglot-move-to-column-function): New variable. (eglot-move-to-lsp-abiding-column): New function. (eglot--lsp-position-to-point): Use eglot-move-to-column-function. #124: joaotavora/eglot#124 #125: joaotavora/eglot#125
jollaitbot
pushed a commit
to sailfishos-mirror/emacs
that referenced
this issue
Oct 12, 2022
Also close joaotavora/eglot#125. Idea and much of design contributed by Michał Krzywkowski <[email protected]> This introduces the variable eglot-move-to-column-function. According to the standard, LSP column/character offsets are based on a count of UTF-16 code units, not actual visual columns. So when LSP says position 3 of a line containing just \"aXbc\", where X is a multi-byte character, it actually means `b', not `c'. This is what the function `eglot-move-to-lsp-abiding-column' does. However, many servers don't follow the spec this closely, and thus this variable should be set to `move-to-column' in buffers managed by those servers. * eglot.el (eglot-move-to-column-function): New variable. (eglot-move-to-lsp-abiding-column): New function. (eglot--lsp-position-to-point): Use eglot-move-to-column-function. GitHub-reference: fix joaotavora/eglot#124
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using clangd:
circle_are
is highlighted, callingeglot-code-actions
on this diagnostic and applying a fix results in:The text was updated successfully, but these errors were encountered: