From 9951dc5861f1603c3309dee2679416a56c787b95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felici=C3=A1n=20N=C3=A9meth?= Date: Wed, 16 Oct 2019 14:30:34 +0100 Subject: [PATCH] Add a test for vscode-json-languageserver's completions --- eglot-tests.el | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/eglot-tests.el b/eglot-tests.el index 5984816f..3d0d4324 100644 --- a/eglot-tests.el +++ b/eglot-tests.el @@ -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"))