posit-dev / positron

Positron, a next-generation data science IDE
https://positron.posit.co
Other
2.82k stars 90 forks source link

Feature: Support for plumber annotations #5367

Open thomasp85 opened 1 week ago

thomasp85 commented 1 week ago

The support for roxygen annotations should be extended to also include plumber annotations, thus understanding the various plumber tags as well as working with the #* comment.

We might consider only supporting plumber tag lookup for #* to gently steer people towards this and keep a better separation between roxygen and plumber annotations

avila commented 2 days ago

I am not sure if here is the best place to comment, but I noticed a small bug with the roxygen annotations, when issuing ctrl+enter to run the next expression. Only in particular cases, such as when the roxygen annotation is not the first comment in a given section, it works as expected (or as I am used to from RStudio), otherwise, each roxygen annotation line is sent to the console line by line. Please see the screencast that shows what I mean.

I didn't know about plumber annotations, but they work fine, I might just use them from now on... It is actually a minor bug that I am not sure I should open a new issue for it. Should I?

https://github.com/user-attachments/assets/3b59cc81-9250-49ff-bccb-e66efc8d18da

Code for reprex ```r # Running`workbench.action.positronConsole.executeCode` via `Ctrl+Enter` (x <- 0) # normal comments are skipped (x <- x+1) #* plumber annotations as well (x <- x+1) #' This is a roxygen annotation (or a comment) #' These are nice for longer comments (auto new line, highlights, etc) (x <- x+1) ## If the roxygen annotation is not the first comment in a given area, #' it works fine as well... #' This is a roxygen annotation (or a comment) #' These are nice for longer comments (auto new line, highlights, etc) (x <- x+1) ```
Positron Version / Info ``` Positron Version: 2024.12.0 build 41 Code - OSS Version: 1.93.0 Commit: 39536c265d6828a68291984d0d359170316d055e Date: 2024-11-18T02:42:16.243Z Electron: 30.4.0 Chromium: 124.0.6367.243 Node.js: 20.15.1 V8: 12.4.254.20-electron.0 OS: Linux x64 6.11.9-amd64 ```
juliasilge commented 2 days ago

I opened https://github.com/posit-dev/positron/issues/5423 to track this, @avila. Thanks! 🙌