-
Notifications
You must be signed in to change notification settings - Fork 337
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
bloop jvm settings #3746
bloop jvm settings #3746
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for starting to dig into this @zmerr! Keep in mind that one other thing we'll need to think about is how to handle this when Bloop is already running. We'll probably want to write the new settings, then restart Bloop to ensure it's taken into account.
metals/src/main/scala/scala/meta/internal/metals/MetalsLanguageServer.scala
Outdated
Show resolved
Hide resolved
@ckipp01 Now everything on the server side is implemented. Can you please take a second look? |
ah, one more thing: in the metals standup today, it was agreed upon that I put a checkbox on metals settings asking the user whether they want to manually enter the Jvm properties in the Metal extension’s settings, or they just want the contents of their bloop global json file to be used for that… |
I was thinking about something a bit different:
|
@tgodzik then can’t it potentially cause some kind of error later in Bloop or another tool reading the file, due to an unrecognized key? |
Ach, you are right, I hoped it would just get ignored. We could add an additional file (kind of a lock file) like |
@tgodzik Ok, then I would go with that approach… I hope in the updates or reinstallations of Bloop, it won’t get erased… Also, what if the user later modifies the json file after the I would say, let’s just persist the time at which we are modifying the bloop json file by reading its "last modified time" value after we create or write to it in the metals server internal files, then in the next times, we compare the modification date to our persisted one, to see if it was us who modified it... |
We could do that yeah, might be a good approach and otherwise ask the user about it. |
a039adf
to
b507d12
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! The approach looks solid, I left some overall comments, but nothing major.
Did you manage to make it work with the VS Code extension?
metals/src/main/scala/scala/meta/internal/metals/BloopServers.scala
Outdated
Show resolved
Hide resolved
metals/src/main/scala/scala/meta/internal/metals/MetalsLanguageServer.scala
Outdated
Show resolved
Hide resolved
metals/src/main/scala/scala/meta/internal/metals/BloopServers.scala
Outdated
Show resolved
Hide resolved
metals/src/main/scala/scala/meta/internal/metals/BloopServers.scala
Outdated
Show resolved
Hide resolved
metals/src/main/scala/scala/meta/internal/metals/BloopServers.scala
Outdated
Show resolved
Hide resolved
metals/src/main/scala/scala/meta/internal/metals/BloopServers.scala
Outdated
Show resolved
Hide resolved
metals/src/main/scala/scala/meta/internal/metals/BloopServers.scala
Outdated
Show resolved
Hide resolved
metals/src/main/scala/scala/meta/internal/metals/Messages.scala
Outdated
Show resolved
Hide resolved
metals/src/main/scala/scala/meta/internal/metals/BloopServers.scala
Outdated
Show resolved
Hide resolved
metals/src/main/scala/scala/meta/internal/metals/BloopServers.scala
Outdated
Show resolved
Hide resolved
dd3c276
to
e70b717
Compare
@ckipp01 do you think this should be done for other editors as well? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job on this so far @zmerr! I've left a few suggestions, questions, and nits.
@ckipp01 do you think this should be done for other editors as well?
So since this is using existing LSP methods already this should already work as is for other editors. For example in nvim-metals
I just needed to add the newly created bloopJvmProperties
as a possible configuration value and everything else just worked ™️
metals/src/main/scala/scala/meta/internal/metals/BloopServers.scala
Outdated
Show resolved
Hide resolved
metals/src/main/scala/scala/meta/internal/metals/UserConfiguration.scala
Show resolved
Hide resolved
metals/src/main/scala/scala/meta/internal/metals/BloopServers.scala
Outdated
Show resolved
Hide resolved
metals/src/main/scala/scala/meta/internal/metals/Messages.scala
Outdated
Show resolved
Hide resolved
metals/src/main/scala/scala/meta/internal/metals/BloopServers.scala
Outdated
Show resolved
Hide resolved
metals/src/main/scala/scala/meta/internal/metals/BloopServers.scala
Outdated
Show resolved
Hide resolved
metals/src/main/scala/scala/meta/internal/metals/BloopServers.scala
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work so far! I left some more ideas, mostly because doing this PR right would help a lot of people.
metals/src/main/scala/scala/meta/internal/metals/BloopServers.scala
Outdated
Show resolved
Hide resolved
metals/src/main/scala/scala/meta/internal/metals/BloopServers.scala
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just tested it locally and everything looks great!
Could you rebase your PR on the newest changes? We can merge afterwards, thanks!
… bloop global json file
…ange on the client's metals settings
added dialogue for whether to use the global bloop file or user settings
f39abb3
to
ef82ff0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's merge this!
It resolves #2697
It is for getting bloop JVM settings from user config and then writing it in the global bloop json file.