-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Mimic VS Code Experimental devices #11323
Mimic VS Code Experimental devices #11323
Conversation
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 haven't seen experimental commands exposed in Theia anywhere else, so keen to understand if this is OK.
Usually we lag far enough behind that the question of keeping up with experimental API rarely arises :-). In general I don't see any problem with it, but we'll have to watch for changes on the VSCode side to make sure that we adjust if they decide to change names before they finalize the API.
Regarding the code, one question I have is whether we should expose the interfaces somewhere (similar to the separate file in VSCode) in case we want to use them somewhere.
Signed-off-by: robmor01 <[email protected]>
Don't worry, I'll be watching these like a hawk!
I've updated the PR to expose these interfaces, but I'd probably recommend anyone using this functionality uses the "official" types (e.g. @types/w3c-web-usb). Users would also need to explicitly cast the return value of any executed command to the correct type due to the nature of how commands are executed. |
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.
Works for me and corresponds to the same commands in VSCode.
* Add experimental device access from VS Code Signed-off-by: thegecko <[email protected]> * Expose interfaces Signed-off-by: robmor01 <[email protected]>
What it does
VS Code has just added experimental support for requesting access to
WebUSB
,WebSerial
andWebHID
devices as outlined in microsoft/vscode#116761The implementation is here and exposed as commands here.
This PR reflects these additions by exposing the same functionality in Theia via the commands:
workbench.experimental.requestUsbDevice
workbench.experimental.requestSerialPort
workbench.experimental.requestHidDevice
These are added so that extensions utilising the experimental commands will work in Theia and VS Code alike.
I haven't seen experimental commands exposed in Theia anywhere else, so keen to understand if this is OK.
How to test
Execute the commands to request access to a device.
Review checklist
Reminder for reviewers