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

Eagerly activate workspaces for opened files #2283

Merged
merged 2 commits into from
Jul 12, 2024

Conversation

vinistock
Copy link
Member

Motivation

Fixes the issue reported in #1897 (comment)

In a multi-root workspace configuration, if you have a Ruby file opened for a secondary workspace, we don't eagerly activate that workspace, despite the file already being opened. You need to switch to another Ruby file for that workspace to have the language server activate, which is a bit odd.

Implementation

Started eagerly activating the workspace for the currently opened file if it's a Ruby file and if the workspace associated with it is not the same as the first one (to avoid any duplicate activations).

@vinistock vinistock added bugfix This PR will fix an existing bug vscode This pull request should be included in the VS Code extension's release notes labels Jul 10, 2024
@vinistock vinistock self-assigned this Jul 10, 2024
@vinistock vinistock requested a review from a team as a code owner July 10, 2024 19:20
@vinistock vinistock requested review from andyw8 and st0012 July 10, 2024 19:20
Copy link
Member

@st0012 st0012 left a comment

Choose a reason for hiding this comment

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

Just a question 👍

vscode/src/rubyLsp.ts Outdated Show resolved Hide resolved
@vinistock vinistock force-pushed the vs/eagerly_activate_workspaces_for_opened_files branch from 7908f3b to 22cc312 Compare July 11, 2024 21:17
scheme: "file",
language: "ruby",
});
const documentSelector = SUPPORTED_LANGUAGE_IDS.map((language) => ({
Copy link
Member

Choose a reason for hiding this comment

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

Should this be plural? documentSelectors?

Copy link
Member Author

Choose a reason for hiding this comment

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

I matched the type name, which is DocumentSelector and is an array of entries.

@vinistock vinistock merged commit a6ddd5b into main Jul 12, 2024
37 checks passed
@vinistock vinistock deleted the vs/eagerly_activate_workspaces_for_opened_files branch July 12, 2024 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This PR will fix an existing bug vscode This pull request should be included in the VS Code extension's release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants