[Bug]: vscode-R 3.0.1: code from other project files silently executed in R session via sess
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 12/100
- Issue 類型
- 缺陷
- 描述清晰度
- 需要釐清
- 活躍度
- 活躍
- 技術堆疊
- r, typescript
研究方向
Start by checking whether the foreign code comes from the session watcher: toggle the r.sessionWatcher setting and see if the stray assignments stop, then inspect the sess.workspace task callback registered via sess::.runtime_add_task_callback. The issue does not name a file in the extension to change, and the cause is unconfirmed. Done would mean a reproducible trigger is identified and the extension no longer executes code absent from the console or history. Expect the work to involve the R session interaction and the workspace viewer, which needs domain knowledge.
由索引模型根據 Issue 內容生成。
描述
Area
Session watcher or workspace viewer
Bug description
With vscode-R 3.0.1 and its sess session connection, code I did not send is executed in my live R session. Objects defined in other files of the same project silently appear in the global environment, or overwrite objects I just created. On other occasions the whole workspace has been wiped.
The executed code never appears in the console or the R history. The same workflow in R run from Terminal.app, outside VS Code, stays clean.
I run code line by line from a single R script in a single VS Code window. Restarting R, restarting VS Code, rebooting, and using brand-new scripts did not help.
- An object overwritten between two consecutive commands. I fit lm1 and called emmeans() on it immediately. In between, lm1 was replaced by a different model:
> lm1 <- lmer(speakerstance ~ stance + (1 | ResponseId), data = dtl, REML = F)
> stance <- emmeans(lm1, specs = "stance")
Error in emmeans(lm1, specs = "stance") :
No variable named stance in the reference grid
> summary(lm1)
Formula: compelling ~ reasonable + (1 | ResponseId) + (1 | scen)
Data: dtl
Subset: !is.na(reasonable)
The replacement matches a line in an older version of analysis.R in the same project folder, per VS Code's local file history:
lm1 <- lmer(compelling ~ reasonable + (1 | ResponseId) + (1 | scen), data = dtl, REML = F, subset = !is.na(reasonable))
- Objects appearing that I never created. In a fresh session, difficulty and full (both lmerModLmerTest) appeared in the workspace without my running any code that defines them.
- The foreign code was not sent through the terminal. It appears in neither the console nor the R history (savehistory()).
- The foreign model was fit in the live session, not loaded from a file.
> find("lm1")
[1] ".GlobalEnv"
> environment(formula(lm1))
<environment: R_GlobalEnv>
-
No other startup code or hooks could explain it.
• ~/.Rprofile only defines and attaches two ggplot theme functions.
• There is no project .Rprofile, no .RData, and no Rprofile.site.
• The only task callbacks are "1" (from cli::.onLoad) and "sess.workspace" (from sess::.runtime_add_task_callback).
• No MCP or agent packages are loaded. -
It does not reproduce outside VS Code. The same script, packages and data, run line by line in R from Terminal.app, showed only the objects I created. ls() was clean, and emmeans() on lm1 worked as expected.
Steps to reproduce
start an R terminal with sess connected, run a script line by line, and foreign objects eventually appear.
Expected behavior
That the objects I declared remain the ones that I declared.
Environment
| Component | Version |
|---|---|
| R | 4.5.3 (aarch64-apple-darwin20) |
| vscode-R | 3.0.1 (with sess) |
| VS Code | 1.142.0 (Universal) |
| macOS | Tahoe 26.6.2 |
Relevant R package versions
Relevant VS Code settings
"[r]": {
"editor.defaultFormatter": "REditorSupport.r",
},
"r.plot.useHttpgd": true,
"r.workspaceViewer.removeHiddenItems": true,
"r.sessionWatcher": true,
Logs and additional context
No response
- 主要語言
- TypeScript
- 星號
- 1.2k
- 分支
- 151
- 平均合併
- 1 天 8 小時
- 30 天內合併 PR
- 76
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
REditorSupport/vscode-R 的其他 Issue
-
[Bug]: indentation clash (formatter vs lintr)可能已有人在做 @renkun-ken 於 1 天前認領。 未關閉bug
難度 1/5 1 小時以內 新手友好度 92/100
REditorSupport/vscode-R#1883 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 68/100
REditorSupport/vscode-R#1846 · 2 則留言 ·
維護者通常 1 天內回覆
-
(feat) Additional Arrow support可能已有人在做 @Fred-Wu 於 6 天前認領。 未關閉enhancement
難度 2/5 1-3 小時 新手友好度 72/100
REditorSupport/vscode-R#1785 · 2 則留言 ·
維護者通常 1 天內回覆
-
Explore a standalone, dependency-free R package for the Data Viewer backend可能已有人在做 @eitsupi 於 8 天前認領。 未關閉
難度 5/5 一週以上 新手友好度 35/100
REditorSupport/vscode-R#1860 · 11 則留言 · 1 個 reaction · 已指派 1 人 ·
維護者通常 1 天內回覆
-
難度 5/5 一週以上 新手友好度 12/100
REditorSupport/vscode-R#1859 ·
維護者通常 1 天內回覆
查看 REditorSupport/vscode-R 的全部 Issue
相似的 Issue
-
frontend
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 86/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 75/100
ranxianglei/billion-context#4172 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 75/100
awslabs/threat-composer#362 ·
維護者通常 1 天內回覆
-
Area/Cloud Needs Triage Type/Bug
難度 1/5 1-3 小時 新手友好度 86/100
wso2/product-integrator#2847 ·
維護者通常 1 天內回覆