Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#1,672 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
r, typescript

Hướng nghiên cứu

Tái hiện lỗi trong một tệp R của VS Code trên Windows 11 bằng cách kích hoạt tính năng tự động hoàn thành hoặc hover, sau đó kiểm tra cách tiến trình languageserver của extension được khởi chạy và các r.lsp.args đã cấu hình. So sánh hành vi liên quan đến --vanilla, jsonlite và NativeRoutineMap, đồng thời sử dụng môi trường được báo cáo làm baseline. Hoàn thành khi lỗi function-list không còn xuất hiện trong lúc tự động hoàn thành hoặc hover.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
1.2k
Fork
139
Merge trung bình
23 giờ 31 phút
Pull request đã merge (30 ngày)
13

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của REditorSupport/vscode-R

Tất cả issue của REditorSupport/vscode-R

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.