Activate extension when a R script file is opened outside of a workspace
还没有人认领这个 Issue。
评估
- 难度
- 1/5
- 预计耗时
- 1 小时以内
- 新手友好度
- 55/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- r, typescript, vscode
调研方向
打开 package.json 并检查 activationEvents 数组,从现有的 workspaceContains、command 和 webview 条目开始。添加对 R 语言的激活,使独立的 R 脚本能够启动扩展,然后验证在工作区外打开 R 文件时扩展的功能会启用。
由索引模型根据 Issue 内容生成。
描述
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
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
REditorSupport/vscode-R 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 84/100
REditorSupport/vscode-R#1687 · 4 条评论 · 3 个 reaction ·
-
feature-request
难度 4/5 3-5 天 新手友好度 45/100
REditorSupport/vscode-R#1763 ·
-
bug
难度 3/5 1-2 天 新手友好度 65/100
REditorSupport/vscode-R#1756 ·
-
难度 4/5 3-5 天 新手友好度 35/100
REditorSupport/vscode-R#1755 · 2 条评论 ·
-
难度 4/5 3-5 天 新手友好度 48/100
REditorSupport/vscode-R#1751 · 1 条评论 ·
查看 REditorSupport/vscode-R 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
receptron/mulmoterminal#2264 ·
-
documentation
难度 2/5 1-3 小时 新手友好度 78/100
components-web-app/docs#96 ·
-
enhancement
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 68/100
simonsobs/tileviewer#114 ·
-
难度 2/5 1-3 小时 新手友好度 75/100