Skip to content

Add a setting to Include the renv library (not the cache) to libPaths #1683

@unfriedj-basycon

Description

@unfriedj-basycon

Is your feature request related to a problem? Please describe.
I am working with a project that has a dedicated renv, where some packages live directly in renv::paths$library() and are not just links to the renv::paths$cache(). I am trying to get the LSP to know about them.
My current workaround is to put .libPaths(c(renv::paths$library(), .libPaths())) in the local .Rprofile.

Describe the solution you'd like
I would like to have a setting, similar to the existing "r.useRenvLibPath" that does the above.

Describe alternatives you've considered
The existing "r.useRenvLibPath" setting includes the renv::paths$cache(), e.g. here
This does not work because it does not contain some packages in my project renv.

Additional context
I am not sure why you would ever want the cache over the project-specific library?
This also makes the LSP see packages from the whole renv cache, which might not even be from the current project.
Maybe the option should be updated to always use library? (Of course the library path might not exist in some projects, and that needs to be dealt with gracefully).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions