Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OpenRPC methods for open_workspace and workspace_folder #2501

Merged
merged 4 commits into from
Mar 21, 2024

Conversation

juliasilge
Copy link
Contributor

Intent

Addresses #1312

Approach

Chugging along with OpenRPC methods 🚂

QA Notes

Goes along with posit-dev/ark#272

@juliasilge juliasilge changed the title Add OpenRPC for rstudioapi::getActiveProject() Add OpenRPC methods for open_workspace and workspace_folder Mar 20, 2024
@juliasilge juliasilge marked this pull request as ready for review March 20, 2024 21:41
@juliasilge
Copy link
Contributor Author

juliasilge commented Mar 20, 2024

@juliasilge juliasilge requested a review from jmcphers March 20, 2024 22:03
*
* Returns the path to the workspace folder, or first folder if there are multiple.
*/
export function workspaceFolder(): Thenable<string | null>;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need our own API for this? (naively, it seems like extensions could use https://code.visualstudio.com/api/references/vscode-api#workspace.workspaceFolders)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extensions definitely could use that, yes, but I believe what we need here is to have this available in our methods namespace, to be able to call it from a runtime (not from the extension). Let me know if I am misunderstanding, or missing a better way to do it!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, this is positron.d.ts, so it's the interface exposed to extensions rather than runtimes. I think you can delete this (and the associated changes that support it) and just leave the UI comm supporting bits.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK yep, I now understand what contributed to my misunderstanding on this, and actually this makes way more sense now to me. Thank you!

@juliasilge juliasilge merged commit ca32e90 into main Mar 21, 2024
1 check passed
@juliasilge juliasilge deleted the rstudioapi-get-active-project branch March 21, 2024 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants