Skip to content
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

Add support for multiple extension hosts #3182

Merged
merged 8 commits into from
May 17, 2024

Conversation

jmcphers
Copy link
Collaborator

@jmcphers jmcphers commented May 17, 2024

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 method managesRuntime 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:

    "extensions.experimental.affinity": {
        "vscode.positron-r": 1,
        "ms-python.python": 1
    },

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").

image

@jmcphers jmcphers requested a review from juliasilge May 17, 2024 18:07
Copy link
Contributor

@juliasilge juliasilge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a LOT of state to keep track of! 😮

Working as expected:

Screenshot 2024-05-17 at 4 48 54 PM

@jmcphers jmcphers merged commit b35cece into main May 17, 2024
1 check passed
@jmcphers jmcphers deleted the feature/multiple-session-managers branch May 17, 2024 23:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants