Opening Find in an unrelated webview activates vscode-R and shows `R: (not attached)` in non-R workspaces
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- typescript, vscode
- Lĩnh vực
- developer-experience, tooling
Hướng nghiên cứu
Bắt đầu với package.json và các đóng góp cho menu editor/title của editor.action.webvieweditor.showFind, sau đó tái hiện việc kích hoạt từ bản xem trước Markdown bằng phím tắt Find đã được báo cáo. Kiểm tra exthost.log để tìm sự kiện kích hoạt; được xem là hoàn tất khi một webview không liên quan không còn kích hoạt vscode-R hoặc hiển thị R: (not attached), trong khi các webview R vẫn giữ hành động Find của chúng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- 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
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của REditorSupport/vscode-R
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
REditorSupport/vscode-R#1687 · 4 bình luận · 3 reaction ·
-
feature-request
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
REditorSupport/vscode-R#1763 ·
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 65/100
REditorSupport/vscode-R#1756 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
REditorSupport/vscode-R#1755 · 2 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
REditorSupport/vscode-R#1751 · 1 bình luận ·
Tất cả issue của REditorSupport/vscode-R
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
-
security
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
IBM/node-sdk-core#373 ·
-
e2e-failure ready-to-code
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
-
chore
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100