REditorSupport / languageserver

An implementation of the Language Server Protocol for R
Other
591 stars 93 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?

argxltuijnder commented 1 month ago

While not necessarily looking for monorepo support. I am too looking for support of R packages in a subdirectory.

When I develop an R package it is usually within a subdirectory of compared to the root of the project. Since I want to keep my package root clean an separate from all the other stuff that might come looking in project development (dockerfiles, ci-files, client-documentation, etc...)

Having the ability to point the LSP towards the directory in which my R package lives would be REALLY great!