File tree 2 files changed +21
-1
lines changed
2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -840,4 +840,23 @@ line 3 words here and here
840
840
(should (equal (line-number-at-pos ) (1+ hint-line)))
841
841
(should (equal (current-column ) hint-col))))))))
842
842
843
+ (ert-deftest lsp-test-server-provides-code-lens ()
844
+ " lsp-mode accepts code lenses from the server and displays them."
845
+ (let ((line 2 ))
846
+ (lsp-test-schedule-response
847
+ " textDocument/codeLens"
848
+ (vconcat (list `(:range (:start (:line , line :character 0 )
849
+ :end (:line , line :character 1 ))
850
+ :command (:title " My command"
851
+ :command " myCommand" )))))
852
+ (lsp-mock-run-with-mock-server
853
+ (lsp-test-sync-wait (lsp-test-all-overlays 'lsp-lens ))
854
+ (let ((lenses (lsp-test-all-overlays 'lsp-lens )))
855
+ (should (eq (length lenses) 1 ))
856
+ (message " %s " (overlay-properties (car lenses)))
857
+ (should (string-match-p " My command"
858
+ (overlay-get (car lenses) 'after-string )))
859
+ (goto-char (overlay-start (car lenses)))
860
+ (should (equal (line-number-at-pos ) (- line 1 )))))))
861
+
843
862
; ;; lsp-mock-server-test.el ends here
Original file line number Diff line number Diff line change 84
84
:codeActionProvider t
85
85
:declarationProvider t
86
86
:definitionProvider t
87
- :inlayHintProvider t )
87
+ :inlayHintProvider t
88
+ :codeLensProvider (:resolveProvider ()))
88
89
" Capabilities of the server." )
89
90
90
91
(defun greeting (id )
You can’t perform that action at this time.
0 commit comments