Opening Find in an unrelated webview activates vscode-R and shows `R: (not attached)` in non-R workspaces
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 55/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- typescript, vscode
调研方向
先从 package.json 和 editor.action.webvieweditor.showFind 的 editor/title 菜单贡献入手,然后使用报告中的 Find 快捷键从 Markdown 预览中复现激活过程。检查 exthost.log 中的激活事件;当无关的 webview 不再激活 vscode-R 或显示 R: (not attached),而 R webview 仍保留其 Find 操作时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
The R extension activates and shows its session status bar item R: (not attached)
even in a workspace with no R files, simply because I triggered the Find widget
in an unrelated webview, such as a Markdown preview.
On my Windows machine, R itself is not installed at all — I only installed the
vscode-R extension. That alone is enough for R: (not attached) to show up once Find
is opened in an unrelated webview, so this is purely about extension activation, not
about any R file, R session, or R runtime.
The likely trigger is that package.json contributes the built-in command
editor.action.webvieweditor.showFind (titled "R: Find in WebView"). This command is
then used in editor/title menus gated by r.browser.active / r.helpPanel.active.
Since VS Code 1.74.0, a command contributed in package.json implicitly activates the
extension when that command is invoked. Because editor.action.webvieweditor.showFind
is the shared built-in webview Find command, invoking Find in any webview
(Markdown preview, release notes, etc.) activates vscode-R, not just R's own
help/browser panels.
Confirmed in exthost.log:
ExtensionService#_doActivateExtension REditorSupport.r, startup: false,
activationEvent: 'onCommand:editor.action.webvieweditor.showFind'
To Reproduce
- Open a folder that contains no R-related files (
.R,.Rmd,.Rproj, etc.). - Open a webview-based editor with a Find widget, e.g. a Markdown preview.
- Focus that preview and press
Cmd+Fon macOS /Ctrl+Fon Windows or Linux.
In my environment, this invokes the built-ineditor.action.webvieweditor.showFind. - The vscode-R extension activates and
R: (not attached)appears in the status
bar, despite no R file or R session being present. It stays visible until the
window is reloaded.
I have reproduced this on both macOS (Cmd+F) and Windows (Ctrl+F), so it does
not appear to be platform-specific.
Can you fix this issue by yourself? (We appreciate the help)
No, but I am happy to test a fix or provide more logs.
(If yes,) can we assist you with anything?
N/A
(If applicable) Please attach setting.json
On macOS, the only R setting I customized is:
"r.rpath.mac": "/usr/local/bin/R"
r.sessionWatcher is left at its default value, true.
On Windows, my settings.json has no r.* keys at all, and R is not installed.
Only the vscode-R extension is present. The bug still reproduces.
Expected behavior
The extension should not activate, and the session status bar item should not appear,
merely because Find was opened in an unrelated webview.
The "R: Find in WebView" action should be scoped to R's own webviews only, without
contributing the shared built-in webview Find command id in a way that causes global
activation from unrelated webviews.
Possible approaches:
- avoid contributing the built-in command id
editor.action.webvieweditor.showFind
directly incontributes.commands; - use a vscode-R wrapper command that is only exposed for R webviews and internally
calls the built-in Find command; - or hide the session status bar item unless an R-related editor, workspace, session,
or webview is actually relevant.
This seems related in spirit to #1572 / #1579, where R UI was made conditional so it
does not appear in unrelated workspaces.
Screenshots
The status bar shows R: (not attached) in a workspace with no R files. I can attach
a screenshot if useful.
Environment (please complete the following information):
- OS: reproduced on both macOS and Windows
- VS Code Version: 1.122.1
- R Version: N/A — reproduces with no R session involved. On Windows, R is not even
installed; only the vscode-R extension is present. - vscode-R version: 2.8.8
Additional context
When r.sessionWatcher is enabled, which is the default, activation creates and shows
the session status bar item. Therefore, once vscode-R is activated by the unrelated
webview Find command, R: (not attached) remains visible for the rest of the window
session, even though the current workspace/editor is unrelated to R.
- 主要语言
- TypeScript
- 星标
- 1.2k
- 派生
- 139
- 平均合并
- 22 小时
- 30 天内合并 PR
- 23
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
REditorSupport/vscode-R 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 84/100
REditorSupport/vscode-R#1687 · 4 条评论 · 3 个 reaction ·
维护者通常 1 天内回复
-
feature-request
难度 4/5 3-5 天 新手友好度 48/100
REditorSupport/vscode-R#1780 ·
维护者通常 1 天内回复
-
REditorSupport/vscode-R#1772 · 4 条评论 · 已指派 2 人 ·
维护者通常 1 天内回复
-
feature-request
难度 4/5 3-5 天 新手友好度 45/100
REditorSupport/vscode-R#1763 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 35/100
REditorSupport/vscode-R#1755 · 2 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 REditorSupport/vscode-R 的全部 Issue
相似的 Issue
-
check:passed streams:add
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
Fission-AI/OpenSpec#1986 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
nestjs/docs.nestjs.com#3554 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
publicodes/publicodes#868 ·
-
namespace operations
难度 1/5 1 小时以内 新手友好度 78/100
EclipseFdn/open-vsx.org#13488 ·
维护者通常 2 天内回复