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 @@ -835,4 +835,23 @@ line 3 words here and here
835
835
(should (equal (line-number-at-pos ) (1+ hint-line)))
836
836
(should (equal (current-column ) hint-col))))))))
837
837
838
+ (ert-deftest lsp-test-server-provides-code-lens ()
839
+ " lsp-mode accepts code lenses from the server and displays them."
840
+ (let ((line 2 ))
841
+ (lsp-test-schedule-response
842
+ " textDocument/codeLens"
843
+ (vconcat (list `(:range (:start (:line , line :character 0 )
844
+ :end (:line , line :character 1 ))
845
+ :command (:title " My command"
846
+ :command " myCommand" )))))
847
+ (lsp-mock-run-with-mock-server
848
+ (lsp-test-sync-wait (lsp-test-all-overlays 'lsp-lens ))
849
+ (let ((lenses (lsp-test-all-overlays 'lsp-lens )))
850
+ (should (eq (length lenses) 1 ))
851
+ (message " %s " (overlay-properties (car lenses)))
852
+ (should (string-match-p " My command"
853
+ (overlay-get (car lenses) 'after-string )))
854
+ (goto-char (overlay-start (car lenses)))
855
+ (should (equal (line-number-at-pos ) (- line 1 )))))))
856
+
838
857
; ;; 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