Open DavisVaughan opened 2 months ago
In Positron I think it makes sense for this functionality to be fulfilled by F12, i.e. jump-to-definition. And if we do implement View()
for functions, it would be nice if it worked exactly the same way as F12? I.e. follow source references if any, create virtual doc otherwise.
Cf "Generalised source availability" section of https://github.com/posit-dev/positron/issues/408
I'd love to see View(function-name)
work as @DavisVaughan suggested. I really like this feature in RStudio and it's one thing I miss in Positron so far. Would the F12/jump-to-definition proposal work for base R functions? At the moment, if I press F12 on the name of a base R function in Positron, I see No reference found for 'function-name'
.
Would the F12/jump-to-definition proposal work for base R functions?
yep, currently needs more infrastructure to implement it but you can already get a feel of how it'd work by running this in the console:
debugonce(data.frame)
data.frame()
This will drop you in the debugger (jump-to-def wouldn't). You can type Q
in the console to quit it.
Thanks. That would be neat. I would still find it really handy to have a way of pulling that up from the R console as well, either with View() or with F12.
So you can look at their sources in a temporary editor pane, ideally recognized as an R file with syntax highlighting