Skip to content

Commit

Permalink
Make sure sorting works when there is no range
Browse files Browse the repository at this point in the history
Fixes #17
  • Loading branch information
yyoncho committed Apr 19, 2021
1 parent 74a02f8 commit c2c6974
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions helm-lsp.el
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,14 @@ With a prefix ARG invalidates the cache first."
(propertize (format ":%s:%s" line character) 'face 'lsp-details-face))
full-path start))))
(-sort (-lambda ((full-path-1 _ (&Diagnostic :range
(&Range :start (&Position :line l1 :character c1))))
(&Range? :start (&Position? :line l1 :character c1))))
(full-path-2 _ (&Diagnostic :range
(&Range :start (&Position :line l2 :character c2)))))
(&Range? :start (&Position? :line l2 :character c2)))))
(if (string= full-path-1 full-path-2)
(if (= l1 l2) (< c1 c2) (< l1 l2))
(cond
((not l1) t)
((not l2) nil)
(t (if (eq l1 l2) (< c1 c2) (< l1 l2))))
(string< full-path-1 full-path-2)))))))


Expand Down

0 comments on commit c2c6974

Please sign in to comment.