Skip to content

refactor(merlin): retain file configuration metadata - #16522

Merged
anmonteiro merged 6 commits into
ocaml:mainfrom
anmonteiro:editor-mode/file-configuration-metadata
Oct 18, 2026
Merged

anmonteiro merged 6 commits into
ocaml:mainfrom
anmonteiro:editor-mode/file-configuration-metadata

Conversation

@anmonteiro

@anmonteiro anmonteiro commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

Retain compilation mode, source kind, and counterpart metadata for plural Merlin lookup, while preserving legacy File behavior.

Follows #16536. Preparation for single-context editor support; originally anmonteiro#111.

Codex session: 019ea5b2-acde-7141-bcbd-e3c833c8eefe.

@anmonteiro anmonteiro added no changelog merlin Merlin editor support and its interface with dune single-context-universal labels Oct 4, 2026
@anmonteiro
anmonteiro force-pushed the editor-mode/file-configuration-metadata branch 2 times, most recently from cd8043c to bdf499f Compare October 4, 2026 22:08
@anmonteiro
anmonteiro force-pushed the editor-mode/file-configuration-metadata branch from bdf499f to 3e07a8f Compare October 4, 2026 23:43
@anmonteiro
anmonteiro changed the base branch from main to anmonteiro/merlin-fallback-source-kind October 4, 2026 23:43
@anmonteiro
anmonteiro force-pushed the anmonteiro/merlin-fallback-source-kind branch from b0f1d08 to 7f017fe Compare October 5, 2026 00:50
@anmonteiro
anmonteiro force-pushed the editor-mode/file-configuration-metadata branch from 3e07a8f to d901132 Compare October 5, 2026 00:50
@anmonteiro
anmonteiro force-pushed the anmonteiro/merlin-fallback-source-kind branch from 7f017fe to 394901f Compare October 5, 2026 02:26
@anmonteiro
anmonteiro force-pushed the editor-mode/file-configuration-metadata branch from d901132 to 727452f Compare October 5, 2026 02:34
@anmonteiro
anmonteiro force-pushed the anmonteiro/merlin-fallback-source-kind branch from 394901f to 08efd19 Compare October 5, 2026 04:51
@anmonteiro
anmonteiro force-pushed the editor-mode/file-configuration-metadata branch from 727452f to c0b7788 Compare October 5, 2026 04:51
anmonteiro added a commit that referenced this pull request Oct 5, 2026
Select the correct Merlin reader for preprocessed filenames while
preserving legacy fallback and copy-line lookup.

Fixes the reader-selection case covered by #16537; compatibility tests
are in #16540. Prerequisite for #16522.

Signed-off-by: Antonio Nuno Monteiro <[email protected]>
@anmonteiro
anmonteiro deleted the branch ocaml:main October 5, 2026 05:20
@anmonteiro anmonteiro closed this Oct 5, 2026
@anmonteiro anmonteiro reopened this Oct 5, 2026
@anmonteiro
anmonteiro changed the base branch from anmonteiro/merlin-fallback-source-kind to main October 5, 2026 05:38
@anmonteiro
anmonteiro force-pushed the editor-mode/file-configuration-metadata branch 2 times, most recently from 737a2b5 to b406321 Compare October 5, 2026 05:45
@rgrinberg

Copy link
Copy Markdown
Member

Why is there such a null build penalty even for projects that don't use melange?

@anmonteiro

anmonteiro commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator Author

Source-kind and counterpart metadata is collected for OCaml configurations too. The avoidable cost is rebuilding a full-path source-file set per configuration, plus a fallback-kind map per module.

I have a small optimization ready locally: reuse the source tree's filename sets and compare the two possible fallback keys directly. On the same Dune checkout, null @install --release minor allocation is 98.04M words on the base, 98.43M on this PR, and 98.25M with the optimization. Times overlap around 0.95s; I cannot establish a reliable timing regression or improvement locally. The generated metadata is byte-for-byte unchanged in the 2,000-module fixture.

@anmonteiro

Copy link
Copy Markdown
Collaborator Author

damn codex really went and replied, i'm digging into it and won't merge with this perf regression

anmonteiro added a commit that referenced this pull request Oct 12, 2026
anmonteiro added a commit that referenced this pull request Oct 12, 2026
anmonteiro added a commit that referenced this pull request Oct 12, 2026
Extracted from #16522.

Signed-off-by: Antonio Nuno Monteiro <[email protected]>
@anmonteiro
anmonteiro force-pushed the editor-mode/file-configuration-metadata branch from 8f2d5d9 to 717e035 Compare October 12, 2026 02:49
Sudha247 pushed a commit to tarides/dune that referenced this pull request Oct 14, 2026
Sudha247 pushed a commit to tarides/dune that referenced this pull request Oct 14, 2026
Sudha247 pushed a commit to tarides/dune that referenced this pull request Oct 14, 2026
@anmonteiro
anmonteiro force-pushed the editor-mode/file-configuration-metadata branch from 717e035 to 1d06b5e Compare October 18, 2026 18:49
anmonteiro added a commit that referenced this pull request Oct 18, 2026
Persist only the module metadata Merlin needs while preserving filename
lookup behavior.

From anmonteiro#245; related to #16522.

01a12d8e-c091-7010-b0cd-3fdc40400e80

Signed-off-by: Antonio Nuno Monteiro <[email protected]>
Retain compilation mode in processed configurations and expose typed plural lookup with source kind and counterpart metadata.

Signed-off-by: Antonio Nuno Monteiro <[email protected]>
@anmonteiro
anmonteiro force-pushed the editor-mode/file-configuration-metadata branch from 1d06b5e to e49b3bc Compare October 18, 2026 21:18
@anmonteiro
anmonteiro merged commit f38afb6 into ocaml:main Oct 18, 2026
37 checks passed
@Alizter Alizter added this to the 3.26.0 milestone Oct 19, 2026
anmonteiro added a commit that referenced this pull request Nov 4, 2026
Preserve all copy-line destinations across compilation modes, including
sandboxed copies and source reassignment.

Upstreams anmonteiro#218; follow-up to #16522.

Codex session: `019ea5b2-acde-7141-bcbd-e3c833c8eefe`.

Signed-off-by: Antonio Nuno Monteiro <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merlin Merlin editor support and its interface with dune no changelog single-context-universal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants