Skip to content

Commit

Permalink
Finish the implementation of related-tests
Browse files Browse the repository at this point in the history
add a review comment about the preview function
  • Loading branch information
petr-tik committed May 3, 2021
1 parent a6f05c2 commit c8613db
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions clients/lsp-rust.el
Original file line number Diff line number Diff line change
Expand Up @@ -973,12 +973,12 @@ Cannot reuse `lsp-rust-analyzer--select-runnable' because the runnables endpoint
responds with Runnable[], while relatedTests responds with TestInfo[], which is a wrapper
over runnable. Also, this method doesn't set the `lsp-rust-analyzer--last-runnable' variable"
(-if-let* ((resp (lsp-rust-analyzer--related-tests))
(runnables (mapcar (lambda (runnable) (gethash "runnable" runnable)) resp)))
;; TODO use dolist or some other iterator to extract all of them
;; since the endpoint returns a list of hash tables that
;; stores &rust-analyzer:Runnable as a value under key
;; "runnable"
;; we need to unpack them first
(runnables (seq-map
(-lambda ((&rust-analyzer:RelatedTests :runnable)) runnable)
resp)))
;; TODO Is it possible to bind
;; C-SPC preview similar to what ivy-configured doom has with
;; ivy-call-and-recenter
(lsp--completing-read
"Select test: "
runnables
Expand Down

0 comments on commit c8613db

Please sign in to comment.