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

Support for multi-workspaces mode #225

Open
sluongng opened this issue Apr 23, 2024 · 2 comments
Open

Support for multi-workspaces mode #225

sluongng opened this issue Apr 23, 2024 · 2 comments

Comments

@sluongng
Copy link

We have a user with a setup where they would open VSCode in a "workspace mode" and in that workspace, there are several different Bazel projects.

For example:

parent/
parent/bazel-proj1/
parent/bazel-proj2/

when opened in this mode, starpls does not work.

It seems like it failed to detect the Bazel project's root dir, which could be detected by running bazel info workspace inside the same dir as the file being opened.

@withered-magic
Copy link
Owner

withered-magic commented Apr 23, 2024

Currently have some work in progress for this feature!

But maybe a clarifying question to help me move forward - is it expected that the nested repositories inherit configuration for files like .bazelrc, .bazelversion, etc. from the root workspace, or do the nested repositories have their own sets of those files? I saw that in bazel-contrib/vscode-bazel#383 sometimes that the expected behavior from the end user is that the nested repositories inherit configs from these files, even though I don't think Bazel actually does this by default, so maybe we'd need some custom logic on the LSP side to handle this if it's desired behavior

@sluongng
Copy link
Author

I don't think there is a use case for a "workspace-level" config like that. We should simply follow the WORKSPACE detection logic of Bazelisk https://github.com/bazelbuild/bazelisk/blob/24651abd7c833829b585373cd540a30cd98e7dfd/ws/ws.go#L9-L34

Once Bazelisk has downloaded the appropriate bazel version, then just run bazelisk info workspace to determine the setting.

Users could always override their .bazelrc via $HOME/.bazelrc and/or /etc/bazelrc and/or an explicit --bazelrc flag

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

No branches or pull requests

2 participants