Skip to content

Conversation

@liam923
Copy link
Contributor

@liam923 liam923 commented Jan 10, 2025

This PR does two things:

  1. Fix a bug with Merlin's detection of stale occurrences. Currently, depending on the layout of a repository, Merlin may not line up file paths correctly.
  2. Currently, Merlin discards any occurrences it thinks might be stale. This PR changes this so that the stale occurrences are reported, but flagged as being stale.

The net effect for an end user should be nothing - the stale occurrences should still be reported by their editor. But this enables future LSP/editor work.

The reason these two items are in the same PR is:

  • Doing just (1) would result in stale occurrences no longer being reported at all.
  • Doing just (2) would be hard to test.

I encourage reviewing commit-by-commit. The tests pass after each commit, and changes (1) and (2) are separated into separate commits.

Copy link
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.

Thanks Liam, these changes look good to me.

There might be a bit of work to rebase it on main with the types changes in Index_format.

@voodoos
Copy link
Collaborator

voodoos commented Feb 26, 2025

Oh I see that you already merged origin/main yesterday. I will have another look.

@voodoos voodoos force-pushed the report-stale-occurrences branch from 39e47c1 to 691ef37 Compare February 28, 2025 17:09
@voodoos voodoos merged commit 56992c4 into ocaml:main Feb 28, 2025
5 checks passed
voodoos added a commit to voodoos/opam-repository that referenced this pull request Jun 24, 2025
CHANGES:

Tue Jun 24 16:10:42 CEST 2025

  + merlin library
    - Expose utilities to manipulate typed-holes in `Merlin_analysis.Typed_hole`
      (ocaml/merlin#1888)
    - `locate` can now disambiguate between files with identical names and contents
      (ocaml/merlin#1882)
    - `occurrences` now reports stale files (ocaml/merlin#1885)
    - `inlay-hints` fix inlay hints on function parameters (ocaml/merlin#1923)
    - Fix issues with ident validation and Lid comparison for occurrences (ocaml/merlin#1924)
    - Handle class type in outline (ocaml/merlin#1932)
    - Handle locally defined value in outline (ocaml/merlin#1936)
    - Fix a typer issue triggering assertions in the short-paths graph (ocaml/merlin#1935,
      fixes ocaml/merlin#1913)
    - Downstreamed a typer fix from 5.3.X that would trigger assertions linked
      to scopes bit masks when backtracking the typer cache (ocaml/merlin#1935)
    - Add a new selection field to outline results that contains the location of
      the symbol itself. (ocaml/merlin#1942)
    - Fix destruct hanging when printing patterns with (::). (ocaml/merlin#1944, fixes
      ocaml/ocaml-lsp#1489)
    - Reproduce and fix a handful of jump-to-definition (locate) issues  (ocaml/merlin#1930,
      fixes ocaml/merlin#1580 and ocaml/merlin#1588, workaround for ocaml/merlin#1934)
  + ocaml-index
    - Improve the granularity of index reading by segmenting the marshalization
      of the involved data-structures. (ocaml/merlin#1889)
  + test suite
    - Add a test case illustrating wrong open order proposed in issue ocaml/merlin#1900. (ocaml/merlin#1901)
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.

2 participants