-
Notifications
You must be signed in to change notification settings - Fork 122
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
Option to activate code lens does not work reliably #1222
Comments
The patch on ocamllabs/vscode-ocaml-platform#1321 seems reasonable, on all editors except vscode it is quite easy to set settings on start. While implementing configuration fetching would be quite annoying. |
I agree that having the client send the configuration looks like the simplest fix, but it's a shame that the solution would be client-specific. It's very surprising that the protocol does not consider sending configuration as part of the initialization of the server... but I am stuck in my attempt to fix it on the server side right now. The documentation says, about the
I tried to send a @rgrinberg does that mean anything to you ? Is that a limitation of the current implementation or am I doing something wrong ? let on_notification ... =
....
| Initialized ->
(* Clients often do not send initial configuration to the server so we
request it after initialization *)
let+ state =
let params =
ConfigurationParams.create
~items:
ConfigurationItem.
[ create ~section:"ocaml.server.codelens" ()
; create ~section:"ocaml.server.extendedHover" ()
]
in
let+ result =
Server.request server (Server_request.WorkspaceConfiguration params)
in
let state = Server.state server in
match result with
| [ codelens; hover ] ->
let data = json_decoding_thigns ... in
{ state with
configuration =
{ state.configuration with data = { codelens; extended_hover } }
}
| _ -> state
in
state |
@voodoos at least from reading on the spec, it seems like the "client" solution was the old solution, before the 3.6.0 version.
But yeah it seems like |
Related to #1160 and ocamllabs/vscode-ocaml-platform#1157 (comment) I believe |
I find this spec. comment a bit puzzling: pulling from the server is not the correct option for reacting to client-side config changes, and most servers will still have to listen to |
This issue was reported by @EduardoRFS in #1221 (comment)
Codelens was disabled by default in #1134 and an option was added to enable it back.
This option won't be taken into account when the server is started, one have to toggle it off and on after the server starts to effectively activate codelenses.
The text was updated successfully, but these errors were encountered: