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

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

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

还没有人认领这个 Issue。

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
55/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
停滞
技术栈
r, typescript, vscode

调研方向

打开 package.json 并检查 activationEvents 数组,从现有的 workspaceContains、command 和 webview 条目开始。添加对 R 语言的激活,使独立的 R 脚本能够启动扩展,然后验证在工作区外打开 R 文件时扩展的功能会启用。

由索引模型根据 Issue 内容生成。

描述

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

主要语言
TypeScript
星标
1.2k
派生
139
平均合并
16 小时 16 分钟
30 天内合并 PR
11

贡献指南

打开贡献指南

从这里开始

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

REditorSupport/vscode-R 的其他 Issue

查看 REditorSupport/vscode-R 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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