REditorSupport / languageserver

An implementation of the Language Server Protocol for R
Other
564 stars 91 forks source link

Support dir-nested R packages (monorepo support) #619

Open Tal500 opened 1 year ago

Tal500 commented 1 year ago

Currently this language server have two modes (AFAIK):

  1. If the workspace is an R package, i.e. have a "NAMESPACE" file), then the whole code of the package will be loaded and parsed.
  2. If not, only the opened files in the editor will be parsed.

While this is a good default behavior in my opinion, I suggest to generalize this and give more control for the user, so in the same workspace there could be many (or even only one) R packages in nested directory.

My suggestion is to introduce a new option to the user configuration, say nested.packages.depth. This option is a number specifying what is the maximal nested directory depth that the language server will scan for R package. Some special cases:

What do you think?