Use vscode-messenger library for vscode messages #299
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.
What it does
Use vscode-messenger library for communication of extension and webviews.
The extension returns also a Diagnostic object (appended to the vscode-trace-extension's
ExternalAPI
so that message exchanges can be logged using the VS Code Messenger Developer Tool. This is purely for trouble shooting purposes.Fixes #78.
Note: There is a non-backward compatible change for third-party extension using interfacing the
vscode-trace-extension
with this change. The messenger library is usingmethod
instead ofcommand
for message keys. Downstream projects will need to update their callback methods (seemessage.method
below).How to test
Run and use the extension. No change in behavior is expected.
Follow-ups
Use vscode-messenger capabilities to send messages directly
webview
<->webview
/set of webviews
instead of going through the extension host which forwards them is using node signals as described here. This would simplify webview synchronization. However, the implementation for persisting of webview states (e.g. selected experiment) need to be changed. Not using Node signals would affect the external API of the vscode-trace-extension, regardingonSignalManagerSignal
andonSignalManagerSignal
as described here, and this has to be addressed when implementing it.We can also use message types
Request
andResponse
instead ofNotification
where applicable.We also have the possibility to introduce typing of the message data.
Review checklist