[Bug]: vscode-R 3.0.1: code from other project files silently executed in R session via sess
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 12/100
- Tipo de issue
- Bug
- Clareza
- Precisa de esclarecimento
- Status de atividade
- Ativa
- Stack de tecnologia
- r, typescript
- Domínio
- developer-experience
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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
- Linguagem predominante
- TypeScript
- Estrelas
- 1.2k
- Forks
- 151
- Merge médio
- 18h 16min
- PRs com merge (30d)
- 70
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de REditorSupport/vscode-R
-
[Bug]: indentation clash (formatter vs lintr)Talvez já em andamento @renkun-ken assumiu há 13 dias. Abertabug
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 92/100
REditorSupport/vscode-R#1883 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
REditorSupport/vscode-R#1846 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
(feat) Additional Arrow supportTalvez já em andamento @Fred-Wu assumiu há 17 dias. Abertaenhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
REditorSupport/vscode-R#1785 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 48/100
REditorSupport/vscode-R#1914 · 4 comentários ·
Mantenedores costumam responder em até 1 dia
-
Explore a standalone, dependency-free R package for the Data Viewer backendTalvez já em andamento @eitsupi assumiu há 19 dias. Aberta
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
REditorSupport/vscode-R#1860 · 14 comentários · 1 reação · 1 responsável ·
Mantenedores costumam responder em até 1 dia
Todas as issues de REditorSupport/vscode-R
Issues semelhantes
-
triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
Mantenedores costumam responder em até 1 dia
-
🎙️ task - drop the raw `./node_modules/.bin/rhachet roles boot` line from bhuild's feedback templateAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
ehmpathy/rhachet-roles-bhuild#639 ·
Mantenedores costumam responder em até 1 dia
-
e2e-failure ready-to-code
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
redhat-developer/rhdh-plugin-export-overlays#4650 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
Mantenedores costumam responder em até 13 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
omdsh-dev/DSH-better-sidebar#1098 ·
Mantenedores costumam responder em até 2 dias