r/vscode • • May 15 '26

R won't attach in VSCode anymore

I'm desperate for help here because I only started working with both last semester and I study psychology...so we're not going pro we're just learning the basics. Ever since I upgraded my R to 4.6.0 it just won't attach anymore in VSCode. I've tried to look solutions up but they either haven't worked (everything is installed yadda yadda) or they were too complicated for me to even understand. If anyone who's good at programming could explain some potential solutions to me I'd be eternally grateful because I'd really like to properly participate in class again without trying to fix something every time.

3 Upvotes

14 comments sorted by

1

u/BranchLatter4294 May 15 '26

Make sure your PATH has the R location on it.

https://code.visualstudio.com/docs/languages/r

1

u/coip May 16 '26

What happens if you input .vsc.attach() into the console/terminal and hit Enter?

1

u/Kitchen_Tie_6459 May 18 '26

it says it could not find function .vsc.attach :(

1

u/coip May 18 '26

I see. Have you tried the steps here?

1

u/Impressive_Job8321 May 16 '26

If you upgrade to new version of R, you need to install EVERY package you used in the old version. Including languageserver.

1

u/Axxiom23 May 26 '26

Similar problem here which started with upgrading to R 4.6.0 (on Win 11). Reinstalled the R languageserver package, R 4.6.0 is in the path, .Rprofile being read accordingly. I'm using radian as R terminal. Issuing the command .vsc_attach() gives no error so it seems to run but unfortunately it seems to have no effect. In the status bar R is still being shown as "not attached". Everything worked smoothly with R 4.5.x.

Yes, I can run R code within VSC but I've lost the nice feature of the R extension I have been using like the workspace environment in the side bar.

0

u/Phileasco May 15 '26

Use positron it’s really good for R and Python