Box-module auto-complete only works if one uses VSCode or Vim. It does not have any known adverse effects on RStudio Desktop or Posit Workbench.
Introduction
Rhino utilizes box modules to manage large code bases. A disadvantage of box modules is the lack of syntax auto-complete support in RStudio or VSCode. In VSCode, auto-complete is provided by languageserver which allows for external parsers. {box.lsp}
is an extension to languageserver to provide function name and function argument auto-complete support for box modules. Please refer to the box.lsp documentation for its current capabilities.
Steps
- Install
languageserver
:renv::install("languageserver")
.languageserver
is a developer tool, it is not advised to add it todependencies.R
or torenv.lock
. - If you initialized your Rhino app with version 1.10.0 or later, proceed to step 4.
- If you are using an existing Rhino app with version < 1.10.0:
- Install
box.lsp
to project dependencies:rhino::pkg_install("box.lsp")
. - Run
box.lsp::use_box_lsp()
to update your project’s.Rprofile
file withbox.lsp
configuration.
- Install
- Restart the R session (restart VSCode) to reload
.Rprofile
.