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

Take class methods into account for suggestions #1358

Closed
yannl35133 opened this issue Aug 21, 2024 · 1 comment · Fixed by #1363 or ocaml/opam-repository#26995
Closed

Take class methods into account for suggestions #1358

yannl35133 opened this issue Aug 21, 2024 · 1 comment · Fixed by #1363 or ocaml/opam-repository#26995
Labels
bug Something isn't working

Comments

@yannl35133
Copy link

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.

@voodoos
Copy link
Collaborator

voodoos commented Aug 22, 2024

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": []
}

@voodoos voodoos added the bug Something isn't working label Aug 22, 2024
voodoos added a commit to voodoos/ocaml-lsp that referenced this issue Aug 23, 2024
Object methods are not completed
@voodoos voodoos linked a pull request Aug 23, 2024 that will close this issue
voodoos added a commit to voodoos/ocaml-lsp that referenced this issue Aug 23, 2024
voodoos added a commit to voodoos/ocaml-lsp that referenced this issue Aug 23, 2024
voodoos added a commit to voodoos/ocaml-lsp that referenced this issue Aug 26, 2024
voodoos added a commit to voodoos/ocaml-lsp that referenced this issue Aug 26, 2024
voodoos added a commit to voodoos/opam-repository that referenced this issue Nov 29, 2024
CHANGES:

## Features

- Add custom
  [`ocamllsp/typeSearch`](/ocaml-lsp-server/docs/ocamllsp/typeSearch-spec.md) request (ocaml/ocaml-lsp#1369)

- Make MerlinJump code action configurable (ocaml/ocaml-lsp#1376)

- Add custom [`ocamllsp/jump`](/ocaml-lsp-server/docs/ocamllsp/merlinJump-spec.md) request (ocaml/ocaml-lsp#1374)

## Fixes

- Fix fd leak in running external processes for preprocessing (ocaml/ocaml-lsp#1349)

- Fix prefix parsing for completion of object methods (ocaml/ocaml-lsp#1363, fixes ocaml/ocaml-lsp#1358)

- Remove some duplicates in the `selectionRange` answers (ocaml/ocaml-lsp#1368)
voodoos added a commit to voodoos/opam-repository that referenced this issue Nov 29, 2024
CHANGES:

## Features

- Add custom
  [`ocamllsp/typeSearch`](/ocaml-lsp-server/docs/ocamllsp/typeSearch-spec.md) request (ocaml/ocaml-lsp#1369)

- Make MerlinJump code action configurable (ocaml/ocaml-lsp#1376)

- Add custom [`ocamllsp/jump`](/ocaml-lsp-server/docs/ocamllsp/merlinJump-spec.md) request (ocaml/ocaml-lsp#1374)

## Fixes

- Fix fd leak in running external processes for preprocessing (ocaml/ocaml-lsp#1349)

- Fix prefix parsing for completion of object methods (ocaml/ocaml-lsp#1363, fixes ocaml/ocaml-lsp#1358)

- Remove some duplicates in the `selectionRange` answers (ocaml/ocaml-lsp#1368)
voodoos added a commit to voodoos/opam-repository that referenced this issue Nov 29, 2024
CHANGES:

## Features

- Add custom
  [`ocamllsp/typeSearch`](/ocaml-lsp-server/docs/ocamllsp/typeSearch-spec.md) request (ocaml/ocaml-lsp#1369)

- Make MerlinJump code action configurable (ocaml/ocaml-lsp#1376)

- Add custom [`ocamllsp/jump`](/ocaml-lsp-server/docs/ocamllsp/merlinJump-spec.md) request (ocaml/ocaml-lsp#1374)

## Fixes

- Fix fd leak in running external processes for preprocessing (ocaml/ocaml-lsp#1349)

- Fix prefix parsing for completion of object methods (ocaml/ocaml-lsp#1363, fixes ocaml/ocaml-lsp#1358)

- Remove some duplicates in the `selectionRange` answers (ocaml/ocaml-lsp#1368)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants