-
Notifications
You must be signed in to change notification settings - Fork 78
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
Notify LSP of workspace config when starting #1321
Conversation
It seems like this is the old method of sending configurations.
It's likely that supporting this is a good idea as old LSPs are still gonna be working. |
Could you split the PR in two parts ? First the "send config on start fix" and then the new configuration option. Thanks |
c5eca0b
to
7b25341
Compare
Done, also pushed changelog |
7b25341
to
93cb7d2
Compare
@smorimoto as you're already here can we get this reviewed and hopefully merged? |
Let me just take a look at this! 🙂 |
At least to me this looks a right fix. |
@mnxn or @ulugbekna could you review this? |
@@ -2,7 +2,7 @@ open Import | |||
|
|||
type t | |||
|
|||
val make : unit -> t | |||
val make : ?codelens:bool -> ?extended_hover:bool -> unit -> t |
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.
Please don't use optional arguments unless there's a specific reason
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.
My bad, was just copying the pattern from somewhere else in the codebase.
LanguageClient.OcamllspSettings.create
But now that I think about it, this is a binding and that's likely the reason why it is using optional parameters.
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.
LanguageClient.OcamllspSettings.create
That one is weird as well. It's our own private API, what's it doing inside the vscode API bindings?
But now that I think about it, this is a binding and that's likely the reason why it is using optional parameters.
What do you mean by "binding"?
@@ -23,6 +23,9 @@ val ocaml_version_exn : t -> Ocaml_version.t | |||
|
|||
val start_language_server : t -> unit Promise.t | |||
|
|||
val set_configuration : | |||
t -> ?codelens:bool -> ?extended_hover:bool -> unit -> unit |
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.
Ditto
Logic looks fine. |
Context
Currently the extension doesn't notify the LSP of configurations, this means that since ocaml/ocaml-lsp#1134 codelens are disabled whenever you start VSCode, even if you explicitly opt-in to codelens.
This is also true for disabling dune diagnostics like #1320.
Warning
This PR enables codelens again by default, as they're enabled in the manifest of the extension, I feel like this may be desirable anyway so I didn't change it, but if the extension wants to disable it by default, is just a matter of changing this https://github.com/ocamllabs/vscode-ocaml-platform/blob/master/package.json#L267
Related
ocaml.server.duneDiagnostics
to disable dune diagnostics reporting #1320