Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Failed to get list of R functions: No method asJSON S3 class: NativeRoutineMap

已关闭
#1,672 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 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 内容生成。

描述

bug needs information

Description

When using the R extension, I consistently receive these error messages:

  1. Failed to get list of R functions. Make sure that jsonlite is installed and r.rpath.windows points to a valid R executable.

  2. 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)

  1. Added S3 method fix for asJSON.NativeRoutineMap in:

    • ~/.Rprofile
    • Rprofile.site (R's site profile)
    • OneDrive shared .Rprofile
  2. Set R_PROFILE_USER as system environment variable

  3. Configured r.lsp.args: ["--no-save", "--no-restore"]

  4. Reinstalled languageserver from GitHub (remotes::install_github)

  5. 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:

  1. Don't use --vanilla when spawning the languageserver R process, or
  2. Add a built-in handler for NativeRoutineMap class in the extension/languageserver
  3. Use force = TRUE in 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

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

REditorSupport/vscode-R 的其他 Issue

查看 REditorSupport/vscode-R 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。