Add support for multiple extension hosts #3182
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.
Intent
This change makes it possible for Positron to work against multiple extension hosts. Though the simplest and most common configurations do not use multiple hosts, it's possible to have different extensions running on different extension hosts in some configurations. It also happens when using a remote extension host, so it's necessary for us to address this in order to support SSH configurations (see #2307). It's also a necessary first step to surviving extension host restarts (see #2683).
Addresses #2458.
Approach
The major problem introduced with multiple extension hosts is that we need to know which host is responsible for which language runtime, so most of the work here is just accounting.
The
MainThreadLanguageRuntime
object (of which there is one copy per extension host) now has a new methodmanagesRuntime
that allows the main thread to query it to see if it supports a given runtime. In most cases this will proxy through to the actual extension host to check for the associated extension.QA Notes
In your
settings.json
file, you can use this to run R and/or Python language packs on a dedicated extension host:You can confirm that you've done this correctly by using the Show Running Extensions command. Extensions running in a separate host will show a little gear icon with the name of their host. Here, the Git extension is running in the main extension host, but the R extension is running in a secondary extension host ("local process 2").