ocaml/ocaml-lsp

Take class methods into account for suggestions

yannl35133 opened this issue · 1 comments

When you ask for completion after having written let f (x : < a_method : 'a >) = x#, you get no useful suggestion, while the only possibility is in fact a_method as per the type of x.
This kind of suggestions already happens for record fields, and as far as I can see (I'm not an emacs user) it works on emacs for methods.

Thanks for your report @yannl35133. It looks like typing the first letter of the method does trigger meaningful completion. It looks like it is indeed an issue with the server.

Relevant Merlin test:
https://github.com/ocaml/merlin/blob/main/tests/test-dirs/completion/issue1575.t

Query log:

[Trace - 16:53:45] Sending request 'textDocument/completion - (619)'.
Params: {
    "textDocument": {
        "uri": "..."
    },
    "position": {
        "line": 1,
        "character": 35
    },
    "context": {
        "triggerKind": 1
    }
}


[Trace - 16:53:45] Received response 'textDocument/completion - (619)' in 4ms.
Result: {
    "isIncomplete": false,
    "items": []
}