Skip to content

Commit

Permalink
Add a test for vscode-json-languageserver's completions
Browse files Browse the repository at this point in the history
  • Loading branch information
nemethf authored and joaotavora committed Oct 16, 2019
1 parent 8a17c29 commit 9951dc5
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions eglot-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,28 @@ pyls prefers autopep over yafp, despite its README stating the contrary."
(= severity 1))
diagnostics)))))))))

(ert-deftest json-basic ()
"Test basic autocompletion in vscode-json-languageserver"
(skip-unless (executable-find "vscode-json-languageserver"))
(eglot--with-fixture
'(("project" .
(("p.json" . "{\"foo.b")
("s.json" . "{\"properties\":{\"foo.bar\":{\"default\":\"fb\"}}}")
(".git" . nil))))
(with-current-buffer
(eglot--find-file-noselect "project/p.json")
(yas-minor-mode)
(goto-char 2)
(insert "\"$schema\": \"file://"
(file-name-directory buffer-file-name) "s.json\",")
(let ((eglot-server-programs
'((js-mode . ("vscode-json-languageserver" "--stdio")))))
(goto-char (point-max))
(should (eglot--tests-connect))
(completion-at-point)
(should (looking-back "\"foo.bar\": \""))
(should (looking-at "fb\"$"))))))

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

0 comments on commit 9951dc5

Please sign in to comment.