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

Hover doesn't include odoc content for definitions in the same file #519

Closed
cemerick opened this issue Feb 4, 2021 · 5 comments
Closed
Labels
type: bug Something isn't working

Comments

@cemerick
Copy link

cemerick commented Feb 4, 2021

More explicitly, if a documented function is defined in foo.ml, hovers on references to it in bar.ml will show that documentation, but hovers on references to it later in foo.ml will not.

@ulugbekna
Copy link
Collaborator

ulugbekna commented Feb 4, 2021

It is more like only the last type/value definition's documentation is available when we hover over type/value in the same file.

image

image

image

But that's an issue with merlin:

For constructor A:

 ❯ ocamlmerlin single document -position 13:17 -verbosity 0 < src/t0.ml | jq
{
  "class": "return",
  "value": "No documentation available",
  "notifications": [],
  "timing": {
    "clock": 5,
    "cpu": 5,
    "query": 0,
    "pp": 0,
    "reader": 2,
    "ppx": 0,
    "typer": 3,
    "error": 0
  }
}

For function f:

❯ ocamlmerlin single document -position 13:40 -verbosity 0 < src/t0.ml | jq
{
  "class": "return",
  "value": "identity fn",
  "notifications": [],
  "timing": {
    "clock": 5,
    "cpu": 5,
    "query": 0,
    "pp": 0,
    "reader": 2,
    "ppx": 0,
    "typer": 3,
    "error": 0
  }
}

Aside from that: it seems we render the documentation incorrectly for doc string "documentation for the [A] ctor\ndocumentation for the type" from merlin Document.

@cemerick
Copy link
Author

cemerick commented Feb 4, 2021

@ulugbekna the documentation content you're seeing in hovers is exactly what I would expect (modulo the relatively minor lack of separation between the type and ctor documentation). Likewise with your claim re: #520.

Now it seems I have either a misconfiguration or something similar.

Anyone have any ideas as to what to look for?

@ulugbekna
Copy link
Collaborator

ulugbekna commented Feb 4, 2021 via email

@cemerick
Copy link
Author

cemerick commented Feb 5, 2021

Thank you very much @ulugbekna, I didn't grok what you were showing in your screenshots at first!

As you can see, I've filed an issue in the merlin project. I'll leave it up to the team here as to whether this issue should be left open to track the effect of the merlin issue's eventual resolution or not.

@tmattio tmattio added the type: bug Something isn't working label Feb 8, 2021
@ulugbekna
Copy link
Collaborator

Fixed in ocaml/merlin#1265

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants