Skip to content

Commit

Permalink
testing getting column
Browse files Browse the repository at this point in the history
  • Loading branch information
theothornhill committed Jan 4, 2020
1 parent 5c3b2d3 commit 11ffcb9
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions eglot-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,8 @@ pyls prefers autopep over yafp, despite its README stating the contrary."
(("foo.c" . "const char write_data[] = u8\"πŸš‚πŸšƒπŸš„πŸš…πŸš†πŸšˆπŸš‡πŸšˆπŸš‰πŸšŠπŸš‹πŸšŒπŸšŽπŸšπŸšžπŸšŸπŸš πŸš‘πŸ›€πŸ›²\";"))))
(let ((eglot-server-programs
'((c-mode . ("clangd")))))
(setq eglot-move-to-column-function #'eglot-move-to-lsp-abiding-column
eglot-current-column-function #'eglot-lsp-abiding-column)
(with-current-buffer
(eglot--find-file-noselect "project/foo.c")
(eglot--sniffing (:client-notifications c-notifs)
Expand All @@ -647,17 +649,10 @@ pyls prefers autopep over yafp, despite its README stating the contrary."
(insert "p")
(eglot--signal-textDocument/didChange)
(eglot--wait-for (c-notifs 2) (&key params &allow-other-keys)
(should (equal '(:range
(:start
(:line 0 :character 71)
:end
(:line 0 :character 71))
:rangeLength 0 :text "p")
(aref (cadddr params) 0))))
(eglot-move-to-lsp-abiding-column 72)
(should (equal 71 (cadddr (cadadr (aref (cadddr params) 0))))))
(eglot-move-to-lsp-abiding-column 71)
(should (string= (thing-at-point 'symbol t) "p")))))))


(ert-deftest eglot-ensure ()
"Test basic `eglot-ensure' functionality"
(skip-unless (executable-find "pyls"))
Expand Down

0 comments on commit 11ffcb9

Please sign in to comment.