Add LSP support for ESS R

This commit is contained in:
Seong Yong-ju 2020-02-01 17:06:15 +09:00
parent 58c6aea7c5
commit d496f27741
3 changed files with 17 additions and 4 deletions

View file

@ -106,7 +106,7 @@ Modules that bring support for a language or group of languages to Emacs.
+ elm - TODO
+ emacs-lisp - TODO
+ erlang - TODO
+ [[file:../modules/lang/ess/README.org][ess]] - TODO
+ [[file:../modules/lang/ess/README.org][ess]] =+lsp= - TODO
+ [[file:../modules/lang/faust/README.org][faust]] - TODO
+ [[file:../modules/lang/fsharp/README.org][fsharp]] - TODO
+ [[file:../modules/lang/go/README.org][go]] =+lsp= - TODO

View file

@ -4,8 +4,15 @@ This module adds support for various statistics languages, including R, S-Plus,
SAS, Julia and Stata.
* Table of Contents :TOC:
- [[Appendix][Appendix]]
- [[Keybindings][Keybindings]]
- [[#prequisites][Prequisites]]
- [[#appendix][Appendix]]
- [[#keybindings][Keybindings]]
* Prequisites
This module has sevral optional dependencies:
+ [[https://github.com/jimhester/lintr][lintr]]: Enables R linting.
+ [[https://github.com/REditorSupport/languageserver][languageserver]]: Enables LSP support in an R buffer (with =+lsp= flag).
* Appendix
** Keybindings

View file

@ -19,9 +19,15 @@
ess-style 'DEFAULT
ess-history-directory (expand-file-name "ess-history/" doom-cache-dir))
(set-docsets! 'ess-r-mode "R")
(if (featurep! +lsp)
(add-hook 'ess-r-mode-hook #'lsp!)
(set-lookup-handlers! 'ess-r-mode
:documentation #'ess-display-help-on-object))
(set-repl-handler! 'ess-r-mode #'+ess/open-r-repl)
(set-repl-handler! 'ess-julia-mode #'+ess/open-julia-repl)
(set-lookup-handlers! '(ess-r-mode ess-julia-mode)
(set-lookup-handlers! 'ess-julia-mode
:documentation #'ess-display-help-on-object)
(set-evil-initial-state! 'ess-r-help-mode 'normal)