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

The request for documentation of function argument gives documentation for whole function #1809

Open
Kakadu opened this issue Aug 6, 2024 · 1 comment
Labels

Comments

@Kakadu
Copy link

Kakadu commented Aug 6, 2024

I could guess why it works this way, but I believe this may be misleading in some cases.
The test should look like that

  $ cat >test2.ml <<EOF
  > (** some doc *)
  > let foo ?(pp=(fun _ _ -> ())) () =
  >   Format.pp_print_list pp Format.std_formatter []
  > EOF
  $ cat test2.ml
  (** some doc *)
  let foo ?(pp=(fun _ _ -> ())) () =
    Format.pp_print_list pp Format.std_formatter []
  $ ocamlc test2.ml

  $ $MERLIN single document -position 3:23 -filename test2.ml < test2.ml
  {
    "class": "return",
    "value": "some doc",
    "notifications": []
  }
  $ $MERLIN single document -position 3:24 -filename test2.ml < test2.ml
  {
    "class": "return",
    "value": "some doc",
    "notifications": []
  }
  $ $MERLIN single document -position 3:25 -filename test2.ml < test2.ml
  {
    "class": "return",
    "value": "some doc",
    "notifications": []
  }

I reproduced this on 414 branch

voodoos added a commit to voodoos/merlin that referenced this issue Aug 30, 2024
voodoos pushed a commit to voodoos/merlin that referenced this issue Aug 30, 2024
@voodoos
Copy link
Collaborator

voodoos commented Aug 30, 2024

Thanks for the report and the reproduction @Kakadu

This does look like a bug, I don't see why we would report the function documentation when hovering on one of it's parameter usages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants