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

Activate extension when a R script file is opened outside of a workspace

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

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

Đánh giá

Độ khó
1/5
Thời gian dự kiến
Dưới một giờ
Mức phù hợp với người mới
55/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
r, typescript, vscode

Hướng nghiên cứu

Mở package.json và kiểm tra mảng activationEvents, bắt đầu với các mục workspaceContains, command và webview hiện có. Thêm kích hoạt cho ngôn ngữ R để một tập lệnh R độc lập khởi động extension, sau đó xác minh rằng việc mở một tệp R bên ngoài workspace sẽ bật các tính năng của extension.

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

Mô tả

feature-request

Is your feature request related to a problem? Please describe.

I often use the vscode-R extension without opening a workspace. Currently, the vscode-R extension is activated when a workspace containing R scripts is opened. The extension does not activate when opening a single R script file outside of a workspace. This means that I have to force the extension to activate so that I can have the autocomplete and popup help features working. I force the extension to activate by opening the R Help feature which I think works due to the onWebviewPanel:rhelp activation event.

Describe the solution you'd like

The following patch to the package.json file activates the extension when an R script file is opened outside of a workspace folder. Having the onLanguage:r line is consistent with other extensions, namely the Python and C/C++ extensions from Microsoft.

--- package.json.orig	2025-07-04 08:48:57.676941500 -0500
+++ package.json	2025-07-04 08:51:26.174039600 -0500
@@ -31,7 +31,8 @@
 	"activationEvents": [
 		"workspaceContains:**/*.{rproj,Rproj,r,R,rd,Rd,rmd,Rmd}",
 		"onCommand:r.runSelectionInActiveTerm",
-		"onWebviewPanel:rhelp"
+		"onWebviewPanel:rhelp",
+		"onLanguage:r"
 	],
 	"main": "./dist/extension",
 	"contributes": {

Describe alternatives you've considered

Force the vscode-R extension to activate by opening the R Help feature in the extension. Not ideal as it involves an extra step. The above patch makes the extension available seamlessly when working outside of vscode workspaces.

Additional context

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

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.