Affected files: .obsidian/workspace.json Thèse/Axes/Phylogénie/Modèle mixte avec arbre phylogénétique.md Thèse/Packages/R/colSBM.md Thèse/Résolution des problèmes/vscode-R qui s'attache mal.md
1.4 KiB
1.4 KiB
La solution vient de Github de vscode-R cette issue
Had the same issue after updating R from 4.5.2 to 4.6.0. .vsc.attach() could not be found anymore.
The root cause is that R 4.6.0 no longer calls .First.sys() during startup. The extension's init.R relies on overwriting .First.sys to initialize the session watcher, so the attach function never gets defined.
Fix that worked for me (in init.R of the extension, for me located at ~/.windsurf/extensions/reditorsupport.r-2.8.8-universal/R/session/init.R):
- Change the assign call from
.First.systo.First:
- assign(".First.sys", init_last, envir = globalenv())
+ assign(".First", init_last, envir = globalenv())
- Remove the old.First.sys lines:
- old.First.sys <- .First.sys
and inside init_last:
- old.First.sys()
- Update the cleanup at the end of init_last:
- rm(".First.sys", envir = globalenv())
+ rm(".First", envir = globalenv())
After restarting the R terminal everything attaches correctly again. This should probably be patched in the extension since R 4.6.0 deprecated .First.sysentirely.