-
Notifications
You must be signed in to change notification settings - Fork 92
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
Implement executeCommand
for rstudioapi as OpenRPC contract
#2356
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
13f130a
Implement `executeCommand` for rstudioapi as OpenRPC contract
juliasilge 7f196b0
RPC params need snake case (plus clarify params)
juliasilge 95cb5e4
Have to return something over comm
juliasilge 344b907
Use notification service for "show message" RPC notification
juliasilge 5f4aef6
Merged origin/main into rstudioapi-execute-command
juliasilge 2ee5d26
Bump ark to 0.1.61
juliasilge b05fbab
Bump Python submodule
juliasilge File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Submodule positron-python
updated
from 25895a to b0d8ac
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -527,7 +527,7 @@ | |
}, | ||
"positron": { | ||
"binaryDependencies": { | ||
"ark": "0.1.60" | ||
"ark": "0.1.61" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we'll quickly run into the need of passing arguments? These could be implemented as a
Array<any>
in the OpenRPC contract (IIRC we have support for this, or at least partial support) and then applied with the spread syntax.This means a downside of
executeCommand
compared to a normal request is decreased type-checking of arguments.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
None of the commands I am using so far have any arguments, so I would prefer to leave this as is for now, until we need args here and can test it out better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my view we should keep this executeCommand as the RStudio API emulator -- it accepts only RStudio command IDs and maps them to VS Code commands and/or emulates them in some other way.
If we want an API that accepts VS Code/Positron command IDs and semantics (can take args and return values), I think that'd be a wholly separate API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah OK, that is different from how this is implemented now; right now this accepts only VS Code commands. We had a discussion about that here in amalthea.
What do you think on this? Should we go with Davis' suggestion there and move the mapping from RStudio commands to VS Code commands over here in Positron?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also was thinking that the RStudio API emulation would remain fully contained in Ark. From that perspective, the fact that the emulation happens to use this new UI comm API for executing VS Code commands would be an implementation detail.
(In any case, regarding extending to supporting arguments I agree it's better left to another PR)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clearly reasonable people can disagree on this 😄 but I want to join Lionel in gently advocating for the current implementation, i.e. rstudioapi emulation belongs in Ark.