-
Notifications
You must be signed in to change notification settings - Fork 233
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
Completion for object methods #1575
Completion for object methods #1575
Comments
ack. You should be write a one-file test similar to:
Then run the test:
Promote the result:
|
@voodoos Would greatly appreciate if you could have a look at this bug. It seems like a pretty big deal that autocomplete on object method names is broken. It seems like it used to work before. I tried to explore this issue in code but didn't make much progress. |
Yes, it looks like this issue is a bit subtle to fix because we cannot easily fold on methods available in the environment. |
If it is any help, even recent versionf of |
That's an interesting pointer, thank you ! |
CHANGES: Fri May 26 15:23:42 CEST 2023 + merlin binary - Allow monadic IO in dot protocol (ocaml/merlin#1581) - Add a `scope` option to the `occurrences` command in preparation for the upcoming `project-wide-occurrences` feature (ocaml/merlin#1596) - Construct bool-typed holes as `false` instead of `true` in the `construct` command, for consistency (ocaml/merlin#1599). - Add a hook to configure system command for spawning ppxes when Merlin is used as a library. (ocaml/merlin#1585) - Implement an all-or-nothing cache for the PPX phase (ocaml/merlin#1584) - Cleanup functors caches when backtracking, to avoid memory leaks (ocaml/merlin#1609, fixes ocaml/merlin#1529 and ocaml-lsp#1032) - Fix `construct` results ordering for sum types sand poly variants (ocaml/merlin#1603) - Fix object method completion not working (ocaml/merlin#1606, fixes ocaml/merlin#1575) - Improve context detection for package types (ocaml/merlin#1608, fixes ocaml/merlin#1607) - Fix incorrect locations for string literals (ocaml/merlin#1574) - Fixed an issue that caused `errors` to erroneously alert about missing `cmi` files (ocaml/merlin#1577) - Prevent destruct from crashing on closed variant types (ocaml/merlin#1602, fixes ocaml/merlin#1601) - Improve longident parsing (ocaml/merlin#1612, fixes ocaml/merlin#945) + editor modes - emacs: call the user's configured completion UI in `merlin-construct` (ocaml/merlin#1598) + test suite - Add missing dependency to a test using ppxlib (ocaml/merlin#1583) - Add tests for the new PPX phase cache (ocaml/merlin#1584) - Add and update tests for `construct` ordering (ocaml/merlin#1603)
CHANGES: Fri May 26 15:23:42 CEST 2023 + merlin binary - Allow monadic IO in dot protocol (ocaml/merlin#1581) - Add a `scope` option to the `occurrences` command in preparation for the upcoming `project-wide-occurrences` feature (ocaml/merlin#1596) - Construct bool-typed holes as `false` instead of `true` in the `construct` command, for consistency (ocaml/merlin#1599). - Add a hook to configure system command for spawning ppxes when Merlin is used as a library. (ocaml/merlin#1585) - Implement an all-or-nothing cache for the PPX phase (ocaml/merlin#1584) - Cleanup functors caches when backtracking, to avoid memory leaks (ocaml/merlin#1609, fixes ocaml/merlin#1529 and ocaml-lsp#1032) - Fix `construct` results ordering for sum types sand poly variants (ocaml/merlin#1603) - Fix object method completion not working (ocaml/merlin#1606, fixes ocaml/merlin#1575) - Improve context detection for package types (ocaml/merlin#1608, fixes ocaml/merlin#1607) - Fix incorrect locations for string literals (ocaml/merlin#1574) - Fixed an issue that caused `errors` to erroneously alert about missing `cmi` files (ocaml/merlin#1577) - Prevent destruct from crashing on closed variant types (ocaml/merlin#1602, fixes ocaml/merlin#1601) - Improve longident parsing (ocaml/merlin#1612, fixes ocaml/merlin#945) + editor modes - emacs: call the user's configured completion UI in `merlin-construct` (ocaml/merlin#1598) + test suite - Add missing dependency to a test using ppxlib (ocaml/merlin#1583) - Add tests for the new PPX phase cache (ocaml/merlin#1584) - Add and update tests for `construct` ordering (ocaml/merlin#1603)
CHANGES: Fri May 26 15:23:42 CEST 2023 + merlin binary - Allow monadic IO in dot protocol (ocaml/merlin#1581) - Add a `scope` option to the `occurrences` command in preparation for the upcoming `project-wide-occurrences` feature (ocaml/merlin#1596) - Construct bool-typed holes as `false` instead of `true` in the `construct` command, for consistency (ocaml/merlin#1599). - Add a hook to configure system command for spawning ppxes when Merlin is used as a library. (ocaml/merlin#1585) - Implement an all-or-nothing cache for the PPX phase (ocaml/merlin#1584) - Cleanup functors caches when backtracking, to avoid memory leaks (ocaml/merlin#1609, fixes ocaml/merlin#1529 and ocaml-lsp#1032) - Fix `construct` results ordering for sum types sand poly variants (ocaml/merlin#1603) - Fix object method completion not working (ocaml/merlin#1606, fixes ocaml/merlin#1575) - Improve context detection for package types (ocaml/merlin#1608, fixes ocaml/merlin#1607) - Fix incorrect locations for string literals (ocaml/merlin#1574) - Fixed an issue that caused `errors` to erroneously alert about missing `cmi` files (ocaml/merlin#1577) - Prevent destruct from crashing on closed variant types (ocaml/merlin#1602, fixes ocaml/merlin#1601) - Improve longident parsing (ocaml/merlin#1612, fixes ocaml/merlin#945) + editor modes - emacs: call the user's configured completion UI in `merlin-construct` (ocaml/merlin#1598) + test suite - Add missing dependency to a test using ppxlib (ocaml/merlin#1583) - Add tests for the new PPX phase cache (ocaml/merlin#1584) - Add and update tests for `construct` ordering (ocaml/merlin#1603) [new release] merlin, merlin-lib and dot-merlin-reader (4.9-414) CHANGES: Fri May 26 15:23:42 CEST 2023 + merlin binary - Allow monadic IO in dot protocol (ocaml/merlin#1581) - Add a `scope` option to the `occurrences` command in preparation for the upcoming `project-wide-occurrences` feature (ocaml/merlin#1596) - Construct bool-typed holes as `false` instead of `true` in the `construct` command, for consistency (ocaml/merlin#1599). - Add a hook to configure system command for spawning ppxes when Merlin is used as a library. (ocaml/merlin#1585) - Implement an all-or-nothing cache for the PPX phase (ocaml/merlin#1584) - Cleanup functors caches when backtracking, to avoid memory leaks (ocaml/merlin#1609, fixes ocaml/merlin#1529 and ocaml-lsp#1032) - Fix `construct` results ordering for sum types sand poly variants (ocaml/merlin#1603) - Fix object method completion not working (ocaml/merlin#1606, fixes ocaml/merlin#1575) - Improve context detection for package types (ocaml/merlin#1608, fixes ocaml/merlin#1607) - Fix incorrect locations for string literals (ocaml/merlin#1574) - Fixed an issue that caused `errors` to erroneously alert about missing `cmi` files (ocaml/merlin#1577) - Prevent destruct from crashing on closed variant types (ocaml/merlin#1602, fixes ocaml/merlin#1601) - Improve longident parsing (ocaml/merlin#1612, fixes ocaml/merlin#945) + editor modes - emacs: call the user's configured completion UI in `merlin-construct` (ocaml/merlin#1598) + test suite - Add missing dependency to a test using ppxlib (ocaml/merlin#1583) - Add tests for the new PPX phase cache (ocaml/merlin#1584) - Add and update tests for `construct` ordering (ocaml/merlin#1603)
CHANGES: unreleased + merlin binary - Preview support for OCaml 5.1-alpha1. Short path is temporary disabled and inline records might not behave as expected. - Allow monadic IO in dot protocol (ocaml/merlin#1581) - Add a `scope` option to the `occurrences` command in preparation for the upcoming `project-wide-occurrences` feature (ocaml/merlin#1596) - Construct bool-typed holes as `false` instead of `true` in the `construct` command, for consistency (ocaml/merlin#1599). - Add a hook to configure system command for spawning ppxes when Merlin is used as a library. (ocaml/merlin#1585) - Implement an all-or-nothing cache for the PPX phase (ocaml/merlin#1584) - Cleanup functors caches when backtracking, to avoid memory leaks (ocaml/merlin#1609, fixes ocaml/merlin#1529 and ocaml-lsp#1032) - Fix `construct` results ordering for sum types sand poly variants (ocaml/merlin#1603) - Fix object method completion not working (ocaml/merlin#1606, fixes ocaml/merlin#1575) - Improve context detection for package types (ocaml/merlin#1608, fixes ocaml/merlin#1607) - Fix incorrect locations for string literals (ocaml/merlin#1574) - Fixed an issue that caused `errors` to erroneously alert about missing `cmi` files (ocaml/merlin#1577) - Prevent destruct from crashing on closed variant types (ocaml/merlin#1602, fixes ocaml/merlin#1601) - Improve longident parsing (ocaml/merlin#1612, fixes ocaml/merlin#945) + editor modes - emacs: call the user's configured completion UI in `merlin-construct` (ocaml/merlin#1598) + test suite - Add missing dependency to a test using ppxlib (ocaml/merlin#1583) - Add tests for the new PPX phase cache (ocaml/merlin#1584) - Add and update tests for `construct` ordering (ocaml/merlin#1603)
This feels like a notable omission, or perhaps I'm missing something:
Let us say the OCaml class of an object is known e.g.
abc : <some_class; ...>
.When I type
abc#
in the editor (with merlin or ocaml-lsp-server enabled) , I should be able to get an autocomplete on all the methods insome_class
but I don't.But it gets worse, supposing I have
foo: < bar: int -> int; baz: int -> string >
where the methods are explictly listed, even here when I dofoo#
I should be given an autocomplete which allows me to choose betweenbar
andbaz
methods, but I dont...I am using merlin 4.8-500. I've tried with ocaml-lsp-server and am aware that it uses merlin in the backend.
How can merlin help me select methods on an object?
The text was updated successfully, but these errors were encountered: