Skip to contents

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

  1. Install languageserver: renv::install("languageserver"). languageserver is a developer tool, it is not advised to add it to dependencies.R or to renv.lock.
  2. If you initialized your Rhino app with version 1.10.0 or later, proceed to step 4.
  3. If you are using an existing Rhino app with version < 1.10.0:
    1. Install box.lsp to project dependencies: rhino::pkg_install("box.lsp").
    2. Run box.lsp::use_box_lsp() to update your project’s .Rprofile file with box.lsp configuration.
  4. Restart the R session (restart VSCode) to reload .Rprofile.