You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When requesting completion for a function's optional labeled argument, which the user intends to pass with ~, OCaml-LSP's completion suggestion uses ? instead and replaces the original intended meaning, e.g.:
let f ?abc ~def () = assert false
let () = f ~
If, at the end of that snippet, the user presses TAB (or whatever completion key), OCaml-LSP suggests:
?abc : 'a option
~def : 'b
as some of the completion results. Selecting ?abc causes the code to now look like:
let () = f ?abc
whereas the expected behavior is more likely:
let () = f ~abc
This issue also occurs if the user has typed some prefix of the optional argument label first.
In Neovim ?abc doesn't even appear as a completion option. I agree with @bcc32 though; newText should be ~abc. @jfeser I'm not sure adding ?abc as an additional completion candidate adds more value than noise, as the user has already signaled how they want to pass the argument.
When requesting completion for a function's optional labeled argument, which the user intends to pass with
~
, OCaml-LSP's completion suggestion uses?
instead and replaces the original intended meaning, e.g.:If, at the end of that snippet, the user presses TAB (or whatever completion key), OCaml-LSP suggests:
as some of the completion results. Selecting
?abc
causes the code to now look like:whereas the expected behavior is more likely:
This issue also occurs if the user has typed some prefix of the optional argument label first.
Here's the event log item I got from Emacs:
I think maybe the label should remain
?abc
but thenewText
should be~abc
instead?The text was updated successfully, but these errors were encountered: