Skip to content

Fix complete record field#2028

Merged
voodoos merged 6 commits intoocaml:mainfrom
ikostia:fix-complete-record-field
Jan 23, 2026
Merged

Fix complete record field#2028
voodoos merged 6 commits intoocaml:mainfrom
ikostia:fix-complete-record-field

Conversation

@ikostia
Copy link
Copy Markdown
Contributor

@ikostia ikostia commented Jan 22, 2026

Summary

This PR addresses issue #2026 .
It adds both a bug demonstration (via tests/test-dirs/server-tests/record-field-completion.t) and a later fix.

The bug itself is related to incomplete cache fingerprinting logic resulting in irrelevant entries being pulled from the reader phase cache when for_completion varies between consequent requests.

Test plan

  • a new CRAM test is written
  • existing tests pass

Copy link
Copy Markdown
Collaborator

@xvw xvw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks a lot!
I it deserve a CHANGE entry.

@ikostia ikostia force-pushed the fix-complete-record-field branch from 1327ed5 to e0b2d7e Compare January 22, 2026 16:50
Copy link
Copy Markdown
Collaborator

@xvw xvw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot!

Copy link
Copy Markdown
Collaborator

@voodoos voodoos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a very nice usage improvement, thanks @ikostia !

@ikostia
Copy link
Copy Markdown
Contributor Author

ikostia commented Jan 23, 2026

@xvw do you know what the CI failures are about? Unknown OCaml version 5.4.0 seems suspiciously like CI setup issues.

@xvw
Copy link
Copy Markdown
Collaborator

xvw commented Jan 23, 2026

@xvw do you know what the CI failures are about? Unknown OCaml version 5.4.0 seems suspiciously like CI setup issues.

It is related to merl-an, it should not blocked the merge. No worry!

Since we merged #2027, you can just resolve conflict (on the CHANGES I guess) and it can be merged.

@ikostia ikostia force-pushed the fix-complete-record-field branch from 3bcdd40 to c4a6d36 Compare January 23, 2026 11:56
@voodoos voodoos merged commit d11cf63 into ocaml:main Jan 23, 2026
ikostia added a commit to ikostia/oxcaml-merlin that referenced this pull request Jan 26, 2026
Lucccyo pushed a commit to Lucccyo/oxmerlin that referenced this pull request Feb 10, 2026
voodoos added a commit to voodoos/opam-repository that referenced this pull request Feb 27, 2026
CHANGES:

  + merlin library
    - Add "Other" variant to locate-types result (ocaml/merlin#2025)
    - Don't include `option` in locate-types result for optional parameters (ocaml/merlin#2027)
    - Fix record field autocompletion (ocaml/merlin#2028)
    - Signature help should not loop over the parameters once it is finished (ocaml/merlin#2023)

  + tests
    - Add a reproduction case for ocaml/merlin#1214, the issue has been resolved before (ocaml/merlin#2022)
    - Add reproduction case for ocaml/merlin#1763 but it is not failing anymore (ocaml/merlin#2021)
    - Add a test to reproduce [Locate command fails on multi-line type definitions](ocaml/merlin#1987) (ocaml/merlin#2020)
    - Add a regression test for issue ocaml/merlin#2019 (ocaml/merlin#2030)
voodoos added a commit to voodoos/opam-repository that referenced this pull request Apr 9, 2026
CHANGES:

Thu Apr 09 09:59:38 WAT 2026

  + merlin library
    - Implement new refactor-extract-region command for extracting region to a fresh let binding (warning: this feature is still experimental) (ocaml/merlin#1948)
    - Add "Other" variant to locate-types result (ocaml/merlin#2025)
    - Don't include `option` in locate-types result for optional parameters (ocaml/merlin#2027)
    - Fix record field autocompletion (ocaml/merlin#2028)
    - Signature help should not loop over the parameters once it is finished (ocaml/merlin#2023)
    - Fix bugs on signature help about labelled and optional parameters (ocaml/merlin#2032)
    - Add `-end-position` parameter for `enclosing` (ocaml/merlin#2029)
    - Signature help should appear even if the 'in' is not written (ocaml/merlin#2036)
    - Improve type enclosing behavior on various class and object related items
      (ocaml/merlin#2053)
  + merlin binary
    - Define PATH_MAX to 4096 if undefined (eg. hurd) (ocaml/merlin#2039)
  + test suite
    - Add a reproduction case for ocaml/merlin#1214, the issue has been resolved before (ocaml/merlin#2022)
    - Add reproduction case for ocaml/merlin#1763 but it is not failing anymore (ocaml/merlin#2021)
    - Add a test to reproduce [Locate command fails on multi-line type definitions](ocaml/merlin#1987) (ocaml/merlin#2020)
    - Add a regression test for issue ocaml/merlin#2019 (ocaml/merlin#2030)

merlin 5.6.1
Sat Dec 20 11:15:42 CET 2025

  + merlin binary
    - Fix a plethora of minor issues with the C code (ocaml/merlin#1998)
  + merlin library
    - Signature help should not appear on the function name (ocaml/merlin#1997)
    - Fix completion not working for inlined records labels (ocaml/merlin#1978, fixes ocaml/merlin#1977)
    - Perform buffer indexing only if the query requires it (ocaml/merlin#1990 and ocaml/merlin#1991)
    - Stop unnecessarily forcing substitutions when initializing short-paths graph (ocaml/merlin#1988)
    - Fix Mocaml.with_printer didn't update replacement_printer_doc (ocaml/merlin#2010)
  + test suite
    - Add a test to ensure the behavior showed in issue ocaml/merlin#1517 is no longer relevant (ocaml/merlin#1995)
    - Add a test to ensure the code fragment exhibited in issue ocaml/merlin#1118 no longer makes Merlin crash (ocaml/merlin#1996)
    - Add a test case illustrating how a snippet produces two unrelated errors in issue ocaml/merlin#2000. (ocaml/merlin#2003)
    - Add a test reproducing issue ocaml/merlin#1983 where `document` command which sometime concatenates consecutive variants and labels (ocaml/merlin#2005)
    - Signature-help should trigger on unfinished `let ... in` bindings (ocaml/merlin#2009)

merlin 5.6
Sat Oct 04 15:10:42 CEST 2025

  + merlin binary
    - Add `locate-types` command (ocaml/merlin#1951)
  + merlin library
    - Implement new refactor-extract-region command for extracting region to a fresh let binding (ocaml/merlin#1948)
    - Fix `merlin_reader` for OpenBSD (ocaml/merlin#1956)
    - Improve recovery of mutually recursive definitions (ocaml/merlin#1962, ocaml/merlin#1963, fixes ocaml/merlin#1953)
    - Support for OCaml 5.4 (ocaml/merlin#1974)
  + vim plugin
    - Fix error when `:MerlinOccurrencesProjectWide` fails to gather code previews (ocaml/merlin#1970)
  + test suite
    - Add more short-paths tests cases (ocaml/merlin#1904)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants