Failed to get list of R functions: No method asJSON S3 class: NativeRoutineMap
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- r, typescript
调研方向
在 Windows 11 的 VS Code R 文件中触发自动补全或悬停,以重现该故障,然后检查扩展的 languageserver 进程是如何启动的,以及配置的 r.lsp.args。比较涉及 --vanilla、jsonlite 和 NativeRoutineMap 的行为,并使用报告中的环境作为基线。当自动补全或悬停期间不再出现 function-list 错误时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
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: NativeRoutineMap
The error occurs even when just selecting lines of code in the editor (without executing), suggesting it's triggered by autocomplete/hover features.
Environment
- OS: Windows 11 x64
- VS Code version: (1.107.1)
- vscode-R extension version: 2.8.6
- R version: 4.5.2 (2025-10-31 ucrt)
- jsonlite version: 2.0.0
- languageserver version: 0.3.16
Attempted fixes (none worked)
-
Added S3 method fix for
asJSON.NativeRoutineMapin:~/.RprofileRprofile.site(R's site profile)- OneDrive shared
.Rprofile
-
Set
R_PROFILE_USERas system environment variable -
Configured
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 --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
--vanillawhen spawning the languageserver R process, or - Add a built-in handler for
NativeRoutineMapclass in the extension/languageserver - Use
force = TRUEin jsonlite calls (similar to fix in PR #1255)
Minimal reproducible example
The error occurs on any R file when the extension tries to provide autocomplete suggestions.
- 主要语言
- TypeScript
- 星标
- 1.2k
- 派生
- 139
- 平均合并
- 22 小时
- 30 天内合并 PR
- 23
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
REditorSupport/vscode-R 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 84/100
REditorSupport/vscode-R#1687 · 4 条评论 · 3 个 reaction ·
维护者通常 1 天内回复
-
feature-request
难度 4/5 3-5 天 新手友好度 48/100
REditorSupport/vscode-R#1780 ·
维护者通常 1 天内回复
-
REditorSupport/vscode-R#1772 · 4 条评论 · 已指派 2 人 ·
维护者通常 1 天内回复
-
feature-request
难度 4/5 3-5 天 新手友好度 45/100
REditorSupport/vscode-R#1763 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 35/100
REditorSupport/vscode-R#1755 · 2 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 REditorSupport/vscode-R 的全部 Issue
相似的 Issue
-
resources
难度 2/5 1-3 小时 新手友好度 72/100
railmapgen/rmg-palette#2445 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
danielmiessler/LifeOS#2242 ·
维护者通常 5 天内回复
-
good first issue hacktoberfest help wanted translation
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
callstackincubator/appduct#129 ·
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 88/100