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

🐛 LSP proxied connections cannot have dedicated configuration #5084

Closed
1 task done
siketyan opened this issue Feb 11, 2025 · 5 comments
Closed
1 task done

🐛 LSP proxied connections cannot have dedicated configuration #5084

siketyan opened this issue Feb 11, 2025 · 5 comments
Labels
S-Needs triage Status: this issue needs to be triaged

Comments

@siketyan
Copy link
Member

siketyan commented Feb 11, 2025

Environment information

CLI:
  Version:                      1.9.4
  Color support:                true

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

Environment:
  BIOME_LOG_PATH:               unset
  BIOME_LOG_PREFIX_NAME:        unset
  BIOME_CONFIG_PATH:            unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v23.7.0"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "pnpm/8.15.5"

Biome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    false
  VCS disabled:                 true

Workspace:
  Open Documents:               0

What happened?

Biome has lsp-proxy subcommand to open a connection to the global Biome daemon, and proxies to the LSP client. The Biome daemon is launched once per Biome version, and it takes --config-path parameter for specifying the configuration path.

When I am working two projects that have different configurations, I cannot apply the second configuration once the first project launched a daemon with its configuration.

Related Issues:

Expected result

Biome's LSP proxy should launch a daemon per configuration, or a LSP proxy connection sends the configuration path to the daemon in a session scope.

Biome already supports Workspace feature on LSP, so including the configuration path in a workspace/configuration request will also resolve this.

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@siketyan siketyan added the S-Needs triage Status: this issue needs to be triaged label Feb 11, 2025
@ematipico
Copy link
Member

ematipico commented Feb 11, 2025

The Biome LSP already listens to workspace/didChangeWorkspaceFolder.

Given that, the LSP proxy shouldn't accept --config-path, and if the editor client supports workspaces, Biome should be able to recognize that and set each workspace folder as a separator project, which can or cannot have their own configuration.

@siketyan
Copy link
Member Author

@ematipico

Is there any way to specify their own configuration path without the --config-path flag? In my understand, using workspace integration on the LSP automatically find a configuration on their basis, while customised configuration path is not supported.

biome-intellij finds a config file and sets to the flag even if the project have biome.json at the workspace root, which leads this issue: https://github.com/biomejs/biome-intellij/blob/d31370c03407313c8b43e0f979d75bf602464a1a/src/main/kotlin/com/github/biomejs/intellijbiome/BiomePackage.kt#L49

How should biome-intellij handle the configuration path correctly?

@ematipico
Copy link
Member

That's a limitation that we have at the moment, so I won't consider this a bug but probably a new feature.

We could evaluate a new option, e.g. --fallback-config-path, which can be used for any workspace project as a fallback in case no configuration biome.json is found inside the project. If no fallback configuration is found, the default resolution is used.

It can become quite complex, but I believe it can suite the LSP workspace projects.

As for the biome-intellij plugin, I don't have an answer for you. I'm not directly involved with the developments. I would expect the LSP to handle that, if the client decides to do their own resolution... well, things get complicated 😓

@siketyan
Copy link
Member Author

siketyan commented Feb 11, 2025

@ematipico
Just an idea, can we start with adding an option of configuration path to the response of workspace/configuration on LSP? If so, I'll do that. (I will create a new issue for that)

@siketyan
Copy link
Member Author

Closing this as I created a task issue #5089.

@siketyan siketyan closed this as not planned Won't fix, can't repro, duplicate, stale Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-Needs triage Status: this issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants