[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eglot dbb5dd4 57/69: Slightly more robust completion te
From: |
João Távora |
Subject: |
[elpa] externals/eglot dbb5dd4 57/69: Slightly more robust completion tests |
Date: |
Sun, 20 Oct 2019 08:21:53 -0400 (EDT) |
branch: externals/eglot
commit dbb5dd4055416ddcc1862d4214641159ad511af3
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>
Slightly more robust completion tests
Give snippet-related tests a change of passing by ensuring pyls
produces snippets. It doesn't do taht anymore by default, so we
explicitly configure its jedi_completion pluging to do so, using
eglot-workspace-configuration.
* eglot-tests.el (company): Require it, but don't fail.
(eglot--test-python-buffer): New helper var.
(snippet-completions): Improve test.
(snippet-completions-with-company): New test.
(company-candidates): Shoosh a warning.
---
eglot-tests.el | 42 +++++++++++++++++++++++++++++++++++++++---
1 file changed, 39 insertions(+), 3 deletions(-)
diff --git a/eglot-tests.el b/eglot-tests.el
index 2d9f783..5984816 100644
--- a/eglot-tests.el
+++ b/eglot-tests.el
@@ -29,6 +29,7 @@
(require 'ert-x) ; ert-simulate-command
(require 'edebug)
(require 'python) ; python-mode-hook
+(require 'company nil t)
;; Helpers
@@ -461,19 +462,54 @@ Pass TIMEOUT to `eglot--with-timeout'."
(call-interactively 'xref-find-definitions)
(should (looking-at "foo(): pass")))))
+(defvar eglot--test-python-buffer
+ "\
+def foobarquux(a, b, c=True): pass
+def foobazquuz(d, e, f): pass
+")
+
(ert-deftest snippet-completions ()
"Test simple snippet completion in a python LSP"
(skip-unless (and (executable-find "pyls")
(functionp 'yas-minor-mode)))
(eglot--with-fixture
- '(("project" . (("something.py" . "setatt"))))
+ `(("project" . (("something.py" . ,eglot--test-python-buffer))))
(with-current-buffer
(eglot--find-file-noselect "project/something.py")
(yas-minor-mode 1)
- (should (eglot--tests-connect))
+ (let ((eglot-workspace-configuration
+ `((:pyls . (:plugins (:jedi_completion (:include_params t)))))))
+ (should (eglot--tests-connect)))
(goto-char (point-max))
+ (insert "foobar")
(completion-at-point)
- (should (looking-back "setattr(")))))
+ (beginning-of-line)
+ (should (looking-at "foobarquux(a, b)")))))
+
+(defvar company-candidates)
+
+(ert-deftest snippet-completions-with-company ()
+ "Test simple snippet completion in a python LSP"
+ (skip-unless (and (executable-find "pyls")
+ (functionp 'yas-minor-mode)
+ (functionp 'company-complete)))
+ (eglot--with-fixture
+ `(("project" . (("something.py" . ,eglot--test-python-buffer))))
+ (with-current-buffer
+ (eglot--find-file-noselect "project/something.py")
+ (yas-minor-mode 1)
+ (let ((eglot-workspace-configuration
+ `((:pyls . (:plugins (:jedi_completion (:include_params t)))))))
+ (should (eglot--tests-connect)))
+ (goto-char (point-max))
+ (insert "foo")
+ (company-mode)
+ (company-complete)
+ (should (looking-back "fooba"))
+ (should (= 2 (length company-candidates)))
+ ;; this last one is brittle, since there it is possible that
+ ;; pyls will change the representation of this candidate
+ (should (member "foobazquuz(d, e, f)" company-candidates)))))
(ert-deftest hover-after-completions ()
"Test documentation echo in a python LSP"
- [elpa] externals/eglot 2372bc8 30/69: Fixed extra ) in python example snippet (#287), (continued)
- [elpa] externals/eglot 2372bc8 30/69: Fixed extra ) in python example snippet (#287), João Távora, 2019/10/20
- [elpa] externals/eglot 6d87de1 35/69: Treat null/nil server capabilities as false, João Távora, 2019/10/20
- [elpa] externals/eglot 7f31f29 36/69: Use gopls server as the default for Go (#304), João Távora, 2019/10/20
- [elpa] externals/eglot 4548202 28/69: Simplify eldoc usage (#269), João Távora, 2019/10/20
- [elpa] externals/eglot 36b7cf32 38/69: Fix #272: also use signature label offsets for parameter info, João Távora, 2019/10/20
- [elpa] externals/eglot 059ea59 43/69: Optionally shutdown after killing last buffer of managed project (#309), João Távora, 2019/10/20
- [elpa] externals/eglot 59ba0b1 39/69: New README section on how to best report bugs to Eglot, João Távora, 2019/10/20
- [elpa] externals/eglot ce983d1 47/69: Revert "Treat null/nil server capabilities as false", João Távora, 2019/10/20
- [elpa] externals/eglot 4693abf 50/69: Fix #258: Allow user to set idle time to wait before processing changes, João Távora, 2019/10/20
- [elpa] externals/eglot 14ab804 54/69: Fix #318: unbreak xref-find-definitions, João Távora, 2019/10/20
- [elpa] externals/eglot dbb5dd4 57/69: Slightly more robust completion tests,
João Távora <=
- [elpa] externals/eglot 3604173 64/69: Unbreak eglot--setq-saving if symbol is unbound, João Távora, 2019/10/20
- [elpa] externals/eglot a11a41b 63/69: Use of company-capf backend in eglot-managed buffers, João Távora, 2019/10/20
- [elpa] externals/eglot 6e93622 27/69: Fix #273: leniently handle invalid positions sent by some servers, João Távora, 2019/10/20
- [elpa] externals/eglot 254fee0 46/69: Use more pyls and less rls in tests, João Távora, 2019/10/20
- [elpa] externals/eglot 0e5e08d 51/69: Support goto-{declaration, implementation, typeDefinition}, João Távora, 2019/10/20
- [elpa] externals/eglot 5a21670 59/69: Fix bug in workspace/didChangeWatchedfiles, João Távora, 2019/10/20
- [elpa] externals/eglot 9359c15 58/69: Close #316: add support for the Ada Language Server, João Távora, 2019/10/20
- [elpa] externals/eglot d6508e0 29/69: Fix #273: fix a typo, João Távora, 2019/10/20
- [elpa] externals/eglot 28ecd5d 34/69: Change the default of eglot-move-to-column-function, João Távora, 2019/10/20
- [elpa] externals/eglot 7a70c97 33/69: Require array package to use current-line (#294), João Távora, 2019/10/20