Skip to content

Use a workspace to port map instead of single value file #3502

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

Merged

Conversation

vinistock
Copy link
Member

@vinistock vinistock commented May 16, 2025

Motivation

There's currently a bug that if you open a second VS Code window, it will override our port file with a new value, disconnecting the first window from being able to report test statuses.

We can solve this problem by using a JSON file instead of a single value file and then writing to it a map of workspaceFilePath => port.

That way, the only time there's a disconnect is if you open the same exact workspace in two different editor windows, which I believe is fine. Trying to use vscode.env.sessionId would be difficult because the LSP reporter instance doesn't have a way to know what session owns the execution - especially when running manually through the terminal.

Implementation

Started writing a map of workspaceFilePath => port and, in the reporter side, started reading it. We kept the reading of the old file just to avoid breaking changes while this rolls out.

Copy link
Member Author


How to use the Graphite Merge Queue

Add the label graphite-merge to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@vinistock vinistock self-assigned this May 16, 2025
@vinistock vinistock added vscode This pull request should be included in the VS Code extension's release notes bugfix This PR will fix an existing bug labels May 16, 2025 — with Graphite App
@vinistock vinistock marked this pull request as ready for review May 16, 2025 20:19
@vinistock vinistock requested a review from a team as a code owner May 16, 2025 20:19
@vinistock vinistock added the server This pull request should be included in the server gem's release notes label May 16, 2025
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.

Instead of writing to tmp folders, does it make sense to write it to each workspace's .ruby-lsp folder instead?

@vinistock vinistock force-pushed the 05-16-use_a_workspace_to_port_map_instead_of_single_value_file branch from 34b7772 to dddd045 Compare May 20, 2025 15:21
@vinistock
Copy link
Member Author

Instead of writing to tmp folders, does it make sense to write it to each workspace's .ruby-lsp folder instead?

All workspaces under the current VS Code instance report to the same port, so it made more sense to me to not tie it to any specific workspace. Otherwise, we'd need to write the port file to all workspaces even if you're not using the test explorer there.

@vinistock vinistock requested a review from st0012 May 20, 2025 15:23
@vinistock vinistock merged commit d4c4d6e into main May 20, 2025
44 checks passed
@vinistock vinistock deleted the 05-16-use_a_workspace_to_port_map_instead_of_single_value_file branch May 20, 2025 17:37
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 server This pull request should be included in the server gem's release notes 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