Skip to content

Commit

Permalink
fix: Prevent duplicate actions
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Apr 3, 2024
1 parent 9e25052 commit cf9d03c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sideline-lsp.el
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ Execute CALLBACK to display candidates in sideline."
(or (not kind?)
(s-match sideline-lsp-actions-kind-regex kind?)))
actions)))
(setq sideline-lsp--ht-code-actions (ht-create))
(ht-clear sideline-lsp--ht-code-actions)
(dolist (action actions)
(-let*
((title (->> (lsp:code-action-title action)
Expand All @@ -162,6 +162,7 @@ Execute CALLBACK to display candidates in sideline."
(when (or (not sideline-lsp-ignore-duplicate)
(not (member title (ht-keys sideline-lsp--ht-code-actions))))
(ht-set sideline-lsp--ht-code-actions title code-action))))
(sideline-delete-backend-ovs 'sideline-lsp)
(funcall callback (ht-keys sideline-lsp--ht-code-actions)))

(provide 'sideline-lsp)
Expand Down

0 comments on commit cf9d03c

Please sign in to comment.