[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/elpa 8b94cf4 02/71: Per #397: Add new eglot-lsp-abiding
From: |
João Távora |
Subject: |
[elpa] externals/elpa 8b94cf4 02/71: Per #397: Add new eglot-lsp-abiding-column test |
Date: |
Wed, 16 Dec 2020 11:42:12 -0500 (EST) |
branch: externals/elpa
commit 8b94cf467b9894e5c623bca1ebe2052d960edf5a
Author: theothornhill <theodorthornhill@icloud.com>
Commit: João Távora <joaotavora@gmail.com>
Per #397: Add new eglot-lsp-abiding-column test
Co-authored-by: João Távora <joatoavora@gmail.com>
* eglot-tests.el: (eglot-lsp-abiding-column): add test
to check for utf-16 non-ascii characters and character
offset.
---
eglot-tests.el | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/eglot-tests.el b/eglot-tests.el
index 29770c6..d516891 100644
--- a/eglot-tests.el
+++ b/eglot-tests.el
@@ -631,6 +631,30 @@ pyls prefers autopep over yafp, despite its README stating
the contrary."
(should (looking-back "\"foo.bar\": \""))
(should (looking-at "fb\"$"))))))
+(ert-deftest eglot-lsp-abiding-column ()
+ "Test basic `eglot-lsp-abiding-column' and
`eglot-move-to-lsp-abiding-column'"
+ (skip-unless (executable-find "clangd"))
+ (eglot--with-fixture
+ '(("project" .
+ (("foo.c" . "const char write_data[] =
u8\"🚂🚃🚄🚅🚆🚈🚇🚈🚉🚊🚋🚌🚎ðŸšðŸšžðŸšŸðŸš 🚡🛤🛲\";"))))
+ (let ((eglot-server-programs
+ '((c-mode . ("clangd")))))
+ (with-current-buffer
+ (eglot--find-file-noselect "project/foo.c")
+ (setq-local eglot-move-to-column-function
#'eglot-move-to-lsp-abiding-column)
+ (setq-local eglot-current-column-function #'eglot-lsp-abiding-column)
+ (eglot--sniffing (:client-notifications c-notifs)
+ (eglot--tests-connect)
+ (end-of-line)
+ (insert "p ")
+ (eglot--signal-textDocument/didChange)
+ (eglot--wait-for (c-notifs 2) (&key params &allow-other-keys)
+ (should (equal 71 (cadddr (cadadr (aref (cadddr params) 0))))))
+ (beginning-of-line)
+ (should (eq eglot-move-to-column-function
#'eglot-move-to-lsp-abiding-column))
+ (funcall eglot-move-to-column-function 71)
+ (should (looking-at "p")))))))
+
(ert-deftest eglot-ensure ()
"Test basic `eglot-ensure' functionality"
(skip-unless (executable-find "pyls"))
- [elpa] branch externals/elpa created (now 4edd478), João Távora, 2020/12/16
- [elpa] externals/elpa 8b94cf4 02/71: Per #397: Add new eglot-lsp-abiding-column test,
João Távora <=
- [elpa] externals/elpa 1056ef5 03/71: Close #413: update dependencies and copyright years, João Távora, 2020/12/16
- [elpa] externals/elpa d99a447 12/71: Close #439: Hide eldoc-message on empty hover info, João Távora, 2020/12/16
- [elpa] externals/elpa af32ebf 06/71: Close #444: use text-mode for plaintext markup, João Távora, 2020/12/16
- [elpa] externals/elpa ef6c483 13/71: Fix #452: also check types when destructuring LSP objects, João Távora, 2020/12/16
- [elpa] externals/elpa 487cde5 18/71: Close #443: kind of honour eldoc-echo-area-use-multiline-p, João Távora, 2020/12/16
- [elpa] externals/elpa 22aa27c 01/71: Close #397: Simplify a bit of code, João Távora, 2020/12/16
- [elpa] externals/elpa 8900a35 04/71: Prevent "Cant guess python-indent-offset..." messages in tests, João Távora, 2020/12/16
- [elpa] externals/elpa dd48f4a 08/71: * eglot.el (eglot-put-doc-in-help-buffer): Tiny docstring fix., João Távora, 2020/12/16
- [elpa] externals/elpa e5cf30e 09/71: Close #435: create match xrefs when possible, João Távora, 2020/12/16
- [elpa] externals/elpa ad3f049 24/71: Close #417: minimally document relation with project.el, João Távora, 2020/12/16