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 something similar to 'workspace/didChangeConfiguration' in LSP #546

Open
1 of 4 tasks
jdneo opened this issue Jun 15, 2023 · 4 comments
Open
1 of 4 tasks

Comments

@jdneo
Copy link
Contributor

jdneo commented Jun 15, 2023

Describe the use-case for this feature

Suppose that the Build Server is talking to Gradle daemon. Users can specify some settings like The JDK used to launch the daemon, and some arguments when using the Tooling API.

Now there is no BSP request that can notify the server some of the settings has been changed.

What do you propose

Introduce a new request that notifys that some settings has been changed. Similar to https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/#workspace_didChangeConfiguration

I've checked to make sure there isn't already a way to support this in the current protocol

  • I've checked the existing protocol and there isn't a way to do this currently

Maintainer approval (This is for the maintainers)

  • Jetbrains
  • Metals
  • Scala Center
@adpi2
Copy link
Member

adpi2 commented Jun 15, 2023

We already have the workspace/reload request to instruct the server to reload the configuration. Isn't that what you need? What is the difference?

@jdneo
Copy link
Contributor Author

jdneo commented Jun 15, 2023

The gap is that, we cannot put the value of the settings as the request body of workspace/reload.

Maybe take a deep look of the Gradle Tooling API can better illustrate the issue: https://docs.gradle.org/current/javadoc/org/gradle/tooling/GradleConnector.html#connect--

From the API, you can find some method like useGradleUserHomeDir()​, useGradleVersion()​, etc...

Imagine that in the IDE, there will be some setting fields to let user specify the Gradle user home dir or Gradle version, then we need a mechanism to let build server know those settings. Meanwhile, when user updates them, a notification needs to be sent to the build server. The notification should contain the new values of those settings - because there is no way to let the build server ask it from client either.

@adpi2
Copy link
Member

adpi2 commented Jun 15, 2023

The gap is that, we cannot put the value of the settings as the request body of workspace/reload.

Thanks for the clarification. Would it solve the issue if we add a data field, or settings field, in the params of workspace/reload?

@jdneo
Copy link
Contributor Author

jdneo commented Jun 16, 2023

Yes, but might not be the best?

Just my personal understanding of workspace/reload: This notification is used to notify the build server that the configuration files are changed. For example, user edits build.gradle, the build server needs to be notified to reload/resync according to the new build.gradle.

While for the settings, they are different things compare to the configuration files like build.gradle. I'm worrying that things will become not clear if we reuse workspace/reload to handle two different kinds of things.

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