Compare commits

..

2 Commits

Author SHA1 Message Date
Jeremy Dormitzer
2d38afd418 Add embark target for LSP identifiers w/ binding for code actions 2022-04-01 10:26:05 -04:00
Jeremy Dormitzer
9b5f71fcc1 Add protobuf mode 2022-04-01 10:25:51 -04:00
2 changed files with 15 additions and 0 deletions

View File

@ -81,6 +81,19 @@ targets."
("k" password-store-remove)
("U" password-store-url))
(add-to-list 'embark-keymap-alist '(password-store . embark-password-store-actions))
;; Add identifiers in LSP-mode as their own target type
(with-eval-after-load 'lsp-mode
(defun embark-target-lsp-identifier-at-point ()
(when lsp-mode
(when-let ((sym (embark-target-identifier-at-point)))
(cons 'lsp-identifier (cdr sym)))))
(add-to-list 'embark-target-finders 'embark-target-lsp-identifier-at-point)
(embark-define-keymap embark-lsp-identifier-actions
"Keymap for actions on LSP identifiers."
:parent embark-identifier-map
("a" lsp-execute-code-action))
(add-to-list 'embark-keymap-alist '(lsp-identifier . embark-lsp-identifier-actions))
(add-to-list 'embark-target-injection-hooks '(lsp-execute-code-action embark--ignore-target)))
:general
("C-." #'embark-act)
("M-." #'embark-dwim)

View File

@ -3,4 +3,6 @@
(use-package lsp-java
:hook (java-mode . lsp-deferred))
(use-package protobuf-mode)
(provide 'init-java)