]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Add test for clearing existing popups with ":LspHover"
authorAndreas Louv <andreas@louv.dk>
Mon, 3 Apr 2023 12:30:30 +0000 (14:30 +0200)
committerAndreas Louv <andreas@louv.dk>
Mon, 3 Apr 2023 12:37:32 +0000 (14:37 +0200)
test/clangd_tests.vim

index 5ceabb4c23f2a26ff6753d157027559bf113d614..f86fb8fcbbfa003d67deb43dac8c045d38358484 100644 (file)
@@ -947,6 +947,8 @@ def g:Test_LspHover()
     void f2(void)
     {
       f1(5);
+      char *z = "z";
+      f1(z);
     }
   END
   setline(1, lines)
@@ -960,7 +962,19 @@ def g:Test_LspHover()
   cursor(7, 1)
   :LspHover
   assert_equal([], popup_list())
+
+  # Show current diagnostic as to open another popup.
+  # Then we can test that LspHover closes all existing popups
+  cursor(10, 6)
+  :LspDiagCurrent
+  assert_equal(1, popup_list()->len())
+  :LspHover
+  assert_equal(1, popup_list()->len())
+  popup_clear()
+
   :%bw!
+
+
 enddef
 
 # Test for :LspShowSignature