Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mouse-1 on 'N refs' #115

Merged
merged 3 commits into from
Jan 11, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix mouse-1 on 'N refs'
Using Emacs 27 on Linux, prior to this commit, when clicking on the 'N refs' annotation created by
code lens, you would get "cl--assertion-failed: Assertion failed: (functionp fetcher)".

The issue is in ccls.el, lsp-execute-command which was calling xref--show-xrefs when it should
have been calling lsp-show-xrefs. I also fixed a similar issue in ccls-code-lens.el.

See emacs-lsp/lsp-mode#3838
  • Loading branch information
John Ciolfi committed Dec 9, 2022
commit 1463b3e7b8fa7f5365ecf651218e5e65b47188aa
3 changes: 1 addition & 2 deletions ccls-code-lens.el
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@
(lambda () (interactive)
(when-let ((xrefs (lsp--locations-to-xref-items
(lsp--send-execute-command command arguments?))))
;; xref--show-xrefs takes a function since Emacs 27.
(xref--show-xrefs (if (functionp 'xref--create-fetcher) (lambda () xrefs) xrefs) nil))))
(lsp-show-xrefs xrefs nil t))))
(propertize (concat lpad title rpad)
'face 'ccls-code-lens-face
'mouse-face 'ccls-code-lens-mouse-face
Expand Down
2 changes: 1 addition & 1 deletion ccls.el
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ DIRECTION can be \"D\", \"L\", \"R\" or \"U\"."
((_server (eql ccls)) (command (eql ccls.xref)) arguments)
(when-let ((xrefs (lsp--locations-to-xref-items
(lsp--send-execute-command "ccls.xref" arguments))))
(xref--show-xrefs xrefs nil)))
(lsp-show-xrefs xrefs nil t)))

(advice-add 'lsp--suggest-project-root :before-until #'ccls--suggest-project-root)

Expand Down