Repository navigation
Tell interface files from implementation files again in editor analysis - #9337
Conversation
Changelog🐛 Bug fix
Semantic Diff1 commit · Full page ✏️ Tell interface files from implementation files again in editor analysis8aa74ec · cknitt + Claude · Nov 19, 2026, 17:01 UTC · edited
References modified (a value with an interface) // ReferencesWithInterface.res
let x = 2
// ReferencesWithInterface.resi
let x: int
…
ReferencesWithInterface.resi 0:4
-ReferencesWithInterface.resi 0:4
+ReferencesWithInterface.res 0:4Definition modified (from a declaration in a .resi)
-DefinitionWithInterface.resi
+DefinitionWithInterface.resReview
|
✅ Compiler benchmarksAllocated wordsIn total: 639,850,034 → 639,849,724 (±0.00%). Generated projects: 629,813,421 → 629,814,170 (±0.00%). None of the 265 benchmarks changed by 0.1% or more. InstructionsIn total: 9,210,476,629 → 9,210,476,629 (±0.00%). None of the 33 benchmarks changed by 0.1% or more. Output sizeIn total: 25,919,386 → 25,919,386 (±0.00%). None of the 13 benchmarks changed by 0.1% or more. Pull request 8aa74ec compared with base 91d74a0 in this run. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9337 +/- ##
==========================================
+ Coverage 82.12% 82.15% +0.02%
==========================================
Files 456 456
Lines 65661 65656 -5
==========================================
+ Hits 53926 53939 +13
+ Misses 11735 11717 -18
🚀 New features to boost your workflow:
|
3829206 to
4a2062b
Compare
rescript
@rescript/belt
@rescript/darwin-arm64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/runtime
@rescript/win32-x64
commit: |
|
Developer playground preview: https://rescript-lang.github.io/rescript/dev-playground/?version=pr-9337 |
0457ec2 to
0aa4953
Compare
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Why:
Since #8436, `Uri.is_interface` passes its arguments to
`Filename.check_suffix` in the wrong order, so it always returns false.
Editor analysis then pairs a `.resi` declaration with itself instead of
with its `.res` side: references list the `.resi` location twice and
miss the `.res` one, rename edits the `.resi` twice and leaves the
`.res` unchanged, and go to definition from a `.resi` declaration stays
in the interface.
References modified (a value with an interface):
Example:
// ReferencesWithInterface.res
let x = 2
// ReferencesWithInterface.resi
let x: int
Before (text): references of x from the .resi
…
ReferencesWithInterface.resi 0:4
ReferencesWithInterface.resi 0:4
After (text): references of x from the .resi
…
ReferencesWithInterface.resi 0:4
ReferencesWithInterface.res 0:4
Definition modified (from a declaration in a .resi):
Before (text): tests/analysis_tests/tests/src/DefinitionWithInterface.resi
DefinitionWithInterface.resi
After (text): tests/analysis_tests/tests/src/DefinitionWithInterface.resi
DefinitionWithInterface.res
Review: Why `String.ends_with ~suffix:Literals.suffix_resi`? Its
labeled argument cannot be swapped the way the positional arguments of
`Filename.check_suffix` were, and the compiler's `.resi` constant says
what is meant. It tests the URI's path (`Lsp.Uri.to_path`), which
ignores query and fragment, instead of the whole encoded URI.
`Shared_types.get_cmt_path`, which picks the `.cmti` for an interface
URI, had its own copy of the test and now calls `Uri.is_interface`.
Review: Which snapshots change? Cross, DefinitionWithInterface.resi,
Jsx2, References, ReferencesWithInterface.resi and
RenameWithInterface.resi: each duplicate `.resi` entry becomes the
`.res` entry, and definitions from a `.resi` reach the implementation,
as they did before #8436.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kbf3gGbYDy2DBe5YmGdHTL
Signed-off-by: Christoph Knittel <ck@cca.io>
0aa4953 to
8aa74ec
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Since #8436,
Uri.is_interfacepasses its arguments toFilename.check_suffixin the wrong order, so it always returns false. Editor analysis then pairs a.resideclaration with itself instead of with its.resside: Find References lists the.resilocation twice and misses the.resone, Rename edits the.resitwice and leaves the.resunchanged, and go to definition from a.resideclaration stays in the interface.The fix tests the URI's path with
String.ends_with ~suffix:Literals.suffix_resi, whose labeled argument can't be swapped.Shared_types.get_cmt_path, which had its own copy of the test, now callsUri.is_interface.Tests: the existing snapshots Cross, DefinitionWithInterface.resi, Jsx2, References, ReferencesWithInterface.resi and RenameWithInterface.resi change. Each duplicate
.resientry becomes the.resentry, and definitions from a.resireach the implementation again.#9332 is stacked on this PR.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Kbf3gGbYDy2DBe5YmGdHTL