Add lsp-ivy and helm-lsp when :tools lsp (#2162)

* Add lsp-ivy and helm-lsp when :tools lsp
* Review

- Move the packages to :tools lsp
- Add bindings to config/+evil-bindings.el (no change to +emacs since
  there was no 'code' prefix)
- Move README section
- Move the packages to :tools lsp
- Add bindings to config/+evil-bindings.el (no change to +emacs since
  there was no 'code' prefix)

* FUp filechange noise
This commit is contained in:
Gerry Agbobada 2019-12-20 00:49:27 +01:00 committed by Henrik Lissner
parent f561abff64
commit f5d1081cde
4 changed files with 42 additions and 16 deletions

View File

@ -354,23 +354,29 @@
;;; <leader> c --- code
(:prefix-map ("c" . "code")
:desc "Compile" "c" #'compile
:desc "Recompile" "C" #'recompile
:desc "Jump to definition" "d" #'+lookup/definition
:desc "Jump to references" "D" #'+lookup/references
:desc "Evaluate buffer/region" "e" #'+eval/buffer-or-region
:desc "Evaluate & replace region" "E" #'+eval:replace-region
:desc "Format buffer/region" "f" #'+format/region-or-buffer
:desc "LSP Format buffer/region" "F" #'+default/lsp-format-region-or-buffer
:desc "LSP Organize imports" "i" #'lsp-organize-imports
:desc "Jump to documentation" "k" #'+lookup/documentation
:desc "LSP Rename" "r" #'lsp-rename
:desc "Send to repl" "s" #'+eval/send-region-to-repl
:desc "Delete trailing whitespace" "w" #'delete-trailing-whitespace
:desc "Delete trailing newlines" "W" #'doom/delete-trailing-newlines
:desc "List errors" "x" #'flymake-show-diagnostics-buffer
:desc "Compile" "c" #'compile
:desc "Recompile" "C" #'recompile
:desc "Jump to definition" "d" #'+lookup/definition
:desc "Jump to references" "D" #'+lookup/references
:desc "Evaluate buffer/region" "e" #'+eval/buffer-or-region
:desc "Evaluate & replace region" "E" #'+eval:replace-region
:desc "Format buffer/region" "f" #'+format/region-or-buffer
:desc "LSP Format buffer/region" "F" #'+default/lsp-format-region-or-buffer
:desc "LSP Organize imports" "i" #'lsp-organize-imports
(:when (featurep! :completion ivy)
:desc "Jump to symbol in current workspace" "j" #'lsp-ivy-workspace-symbol
:desc "Jump to symbol in any workspace" "J" #'lsp-ivy-global-workspace-symbol)
(:when (featurep! :completion helm)
:desc "Jump to symbol in current workspace" "j" #'helm-lsp-workspace-symbol
:desc "Jump to symbol in any workspace" "J" #'helm-lsp-global-workspace-symbol)
:desc "Jump to documentation" "k" #'+lookup/documentation
:desc "LSP Rename" "r" #'lsp-rename
:desc "Send to repl" "s" #'+eval/send-region-to-repl
:desc "Delete trailing whitespace" "w" #'delete-trailing-whitespace
:desc "Delete trailing newlines" "W" #'doom/delete-trailing-newlines
:desc "List errors" "x" #'flymake-show-diagnostics-buffer
(:when (featurep! :tools flycheck)
:desc "List errors" "x" #'flycheck-list-errors))
:desc "List errors" "x" #'flycheck-list-errors))
;;; <leader> f --- file
(:prefix-map ("f" . "file")

View File

@ -9,6 +9,7 @@
- [[#plugins][Plugins]]
- [[#prerequisites][Prerequisites]]
- [[#features][Features]]
- [[#lsp-powered-project-search][LSP-powered project search]]
- [[#configuration][Configuration]]
- [[#troubleshooting][Troubleshooting]]
@ -67,6 +68,13 @@ them [[https://github.com/emacs-lsp/lsp-mode#supported-languages][in the lsp-mod
targeted language will contain brief instructions as well.
* TODO Features
** LSP-powered project search
When =:completion ivy= or =:completion helm= is active, LSP is used to search a
symbol indexed by the LSP server :
| Keybind | Description |
|-----------+-------------------------------------|
| =SPC c j= | Jump to symbol in current workspace |
| =SPC c J= | Jump to symbol in any workspace |
* TODO Configuration

View File

@ -148,3 +148,11 @@ Also logs the resolved project root, if found."
(remove-hook 'company-mode-hook #'+lsp-init-company-h t))))
:config
(setq company-lsp-cache-candidates 'auto)) ;; cache candidates for better performance
(use-package! helm-lsp
:when (featurep! :completion helm)
:commands helm-lsp-workspace-symbol helm-lsp-global-workspace-symbol)
(use-package! lsp-ivy
:when (featurep! :completion ivy)
:commands lsp-ivy-workspace-symbol lsp-ivy-global-workspace-symbol)

View File

@ -5,3 +5,7 @@
(package! lsp-ui)
(when (featurep! :completion company)
(package! company-lsp))
(when (featurep! :completion ivy)
(package! lsp-ivy))
(when (featurep! :completion helm)
(package! helm-lsp))