You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reinstalled languageserver from GitHub (remotes::install_github)
Updated jsonlite to 2.0.0
Root cause hypothesis
The languageserver appears to run with --vanilla flag internally, which skips all profile files including Rprofile.site. This prevents any runtime fix from being applied before jsonlite encounters the NativeRoutineMap class.
Suggested fix
Either:
Don't use --vanilla when spawning the languageserver R process, or
Add a built-in handler for NativeRoutineMap class in the extension/languageserver
Description
When using the R extension, I consistently receive these error messages:
Failed to get list of R functions. Make sure that jsonlite is installed and r.rpath.windows points to a valid R executable.R library paths: C:/R_libs/4.5 C:/Program Files/R/R-4.5.2/library Error: No method asJSON S3 class: NativeRoutineMapThe error occurs even when just selecting lines of code in the editor (without executing), suggesting it's triggered by autocomplete/hover features.
Environment
Attempted fixes (none worked)
Added S3 method fix for
asJSON.NativeRoutineMapin:~/.RprofileRprofile.site(R's site profile).RprofileSet
R_PROFILE_USERas system environment variableConfigured
r.lsp.args: ["--no-save", "--no-restore"]Reinstalled languageserver from GitHub (
remotes::install_github)Updated jsonlite to 2.0.0
Root cause hypothesis
The languageserver appears to run with
--vanillaflag internally, which skips all profile files includingRprofile.site. This prevents any runtime fix from being applied before jsonlite encounters theNativeRoutineMapclass.Suggested fix
Either:
--vanillawhen spawning the languageserver R process, orNativeRoutineMapclass in the extension/languageserverforce = TRUEin jsonlite calls (similar to fix in PR Useforce=TRUEwhen viewing data.frame and list #1255)Minimal reproducible example
The error occurs on any R file when the extension tries to provide autocomplete suggestions.