Skip to content

Documentation missing for references to things defined in the same file #1261

@cemerick

Description

@cemerick

Given an input, a.ml:

(** f docs *)
let f = ()

(** g docs *)
let g = ()

let h = g

When the point is on the reference to g, all is well:

$ ocamlmerlin single document -verbosity 0 -position 7:9 < a.ml | jq .value
"g docs"

However, if we change h to be let h = f, the documentation for f is not returned:

$ ocamlmerlin single document -verbosity 0 -position 7:9 < a.ml | jq .value
"No documentation available"

If we remove the documentation comment for g though (note the changed line number to correspond), the documentation for f is found:

$ ocamlmerlin single document -verbosity 1 -position 6:9 < a.ml | jq .value
"f docs"

It seems that, for lookups of things defined in the same file, merlin will not return documentation for any but the final documented definition.

(Originally reported in ocamllabs/vscode-ocaml-platform#519, where @ulugbekna suggested the actual failure pattern.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions