Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

Allow working directory to be specified #877

Closed
wants to merge 2 commits into from

Conversation

jprosevear
Copy link

Motivation

Relates to #655 and Shopify/ruby-lsp#1510

I have a mono repo that has a rails project (API) in server/ and a react SPA in client so I don't need multiple ruby project/workspace support. This allows me to push a work space setting and get all the LSP benefits.

Implementation

Separated working dir from workspace dir.

Created a configuration setting for absolute or relative working dir. If relative, join it to the project workspace directory.

Automated Tests

No existing tests covering workspace dir.

Manual Tests

Move a full ruby project into a subdirectory and launch vscode from the root. Ensure

@jprosevear jprosevear requested a review from a team as a code owner November 4, 2023 13:25
@vinistock
Copy link
Member

Thank you for the PR. As mentioned in #655 (comment), we're going to prefer Shopify/ruby-lsp#1510 since that's the way VS Code supports this type of scenario out of the box.

Conceptually, the server and client folders are indeed two separate workspaces, given that they are separate projects with different programming languages. I'm working on a few refactors that will allow for multiple workspace support and then it should just be a matter of configuring a multi-workspace with client and server and everything should work out of the box.

@vinistock vinistock closed this Nov 8, 2023
@jprosevear
Copy link
Author

Yes, I understood from the earlier tickets, but the timeline was unclear (been on hold since Feb?) so I put something together as an interim step that would help a subset of the use cases (including mine)

@gi
Copy link

gi commented Dec 4, 2023

@vinistock, please consider reopening. This feature is highly desirable to me, and it seems @jprosevear and others, that Shopify/ruby-lsp#1510 would support but forces users to split one project into many.

For example, I have a multi-root project:

  • project-1
    • client
    • server
  • project-2

I like this setup, but colleagues often open just project-1. I don't want to be required to have a workspace split like this:

  • project-1
  • project-1/client => doesn't this also show just as client
  • project-1/server => doesn't this also show just as server
  • project-2

What if I have other projects like the above? Shopify/ruby-lsp#1510 is a great start, but it doesn't solve all of the problem in the most elegant way.

@vinistock
Copy link
Member

Is it not possible to configure how you name the workspaces? I think you can do that in the configs. Here's the VS Code documentation on workspaces, which has a section on multi-root workspaces and how to configure them.

In general, if something is supported out of the box by VS Code, we'll avoid re-building a slightly different version of the feature ourselves. It's a significant increase in complexity and maintenance cost that's not worth the benefit.

For example, if we built the ability selecting arbitrary root folders into the Ruby LSP, we'd also need to figure out what to do with launch configurations.

@jprosevear
Copy link
Author

See also Shopify/ruby-lsp#1510 for my best try

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants