Ark: Can't use Cmd+Enter with fallback srcrefs because the virtual doc is a text file
When stepping through a function without srcrefs with the debugger, Ark creates fallback srcrefs on the fly that point to a virtual document. This document doesn't have a .R extension which reduces the functionality inside these files, for instance no colour styling. More importantly, this prevents executing code with Cmd+Enter. For instance, run the following and try to evaluate 1 +2 with Cmd+Enter:
foo <- function() {
browser()
1 + 2
}
foo()
You get this error:
Davis mentioned this is because this fallback path is using the DAP to manage the virtual docs, and this isn't flexible enough to specify an extension. Maybe we could instead use a comment directive that we could detect in the frontend to set the correct language? Or manage the vdocs ourselves like we (will) do in https://github.com/posit-dev/amalthea/pull/251.
You can't use CMD+Enter in the RStudio one either, I actually don't think that is that important to get right otherwise I would have complained to Kevin about it by now 😆
I was surprised it didn't work in a real usage case.
This issue was brought up in https://github.com/posit-dev/positron-beta/discussions/148
Yea you have convinced me.
As discussed in slack and in other places, it is also with it to make it a "real" R file for highlighting purposes and probably other LSP features
Likely need to merge https://github.com/posit-dev/amalthea/pull/251 first - that will probably actually make the situation a little better too
Verified Fixed
Positron Version(s) : 2025.07.0-200
OS Version : OSX
Test scenario(s)
Verified with steps outlined in https://github.com/posit-dev/ark/pull/852
Link(s) to TestRail test cases run or created: