Support for third party extension #1081
Merged
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.
Pull request type
Please check the type of change your PR introduces:
What is the current behavior?
Using DevToys 2.0, we can't easily create an extension as a third-party developer.
What is the new behavior?
DevToys.API
project while preparing to publish it on NuGet.org. It is now unlisted on https://www.nuget.org/packages/DevToys.Api/AppHelper
that retrieves a specified command line argument.CommandLineLauncherService
so it uses the new helper method fromAppHelper
.MefComposer
so it looks for a--extraplugin:
command line argument. This argument can be used to indicate DevToys should load an extra plugin that isn't installed in the app. This will be useful to let third party developers debug an extension without having to clone the DevToys repository..app
on MacOS. I realized it wasn't working as I never updated it since we switch from MacCatalyst to AppKit.Other information
We can now debug a third party extension on Windows Mac and Linux from VS, VS Code and Rider:
Video:
https://github.com/DevToys-app/DevToys/assets/3747805/e5834d56-8fe9-4c5c-926d-cc8e254fb654
Hot Reload
Hot Reload is supported when developing third party extension. But a user action is needed. User needs to click on the following button in DevToys UI to reload the extension.
This button is only displayed when DevToys is attached to a debugger. Ultimately, this button throws away the UI of the tool and rebuild it. That's it. And it works! 😁
In addition, in VS Code, an experimental option needs to be turned ON:
See https://www.poppastring.com/blog/hot-reload-for-c-dev-kit
Here is a sample Extension project:
Sample Extension.zip
To use it:
On Windows
DevToysDebugEntryPoint
. The value must be like<your_path>/DevToys.Windows.exe
. For example,C:/Program Files/DevToys/DevToys.Windows.exe
.On MacOS
nano ~/.zshrc
DevToysDebugEntryPoint
. The value must be like<your_path>/DevToys.MacOS.app/Contents/MacOS/DevToys.MacOS
.For example, add to the file
export DevToysDebugEntryPoint="/Users/JohnDoe/Applications/DevToys.MacOS.app/Contents/MacOS/DevToys.MacOS"
.source ~/.zshrc
to apply the changes.On Linux
nano ~/.bashrc
DevToysDebugEntryPoint
. The value must be like<your_path>/DevToys.Linux
.For example, add to the file
export DevToysDebugEntryPoint=$HOME/DevToys/DevToys.Linux
.source ~/.bashrc
to apply the changes.Quality check
Before creating this PR: