Skip to content

fix(lsp): resolve hover on the right side of arrow expressions#3157

Open
ivanauth wants to merge 2 commits into
authzed:mainfrom
ivanauth:fix/issue-2990-arrow-rhs-hover
Open

fix(lsp): resolve hover on the right side of arrow expressions#3157
ivanauth wants to merge 2 commits into
authzed:mainfrom
ivanauth:fix/issue-2990-arrow-rhs-hover

Conversation

@ivanauth

@ivanauth ivanauth commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Changes

  • Replace the arrow RHS short-circuit in SchemaPositionMapper.relationReferenceChain with proper resolution via Definition.AllowedSubjectRelations, so hover and go-to-definition work on the right side of .any, .all, and ->.
Screenshot 2026-06-05 at 6 04 43 PM Screenshot 2026-06-05 at 6 35 19 PM

Closes #2990

@ivanauth ivanauth requested a review from a team as a code owner June 5, 2026 20:30
@github-actions github-actions Bot added the area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools) label Jun 5, 2026
@codecov

codecov Bot commented Jun 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 67.53247% with 50 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/development/schema_position_mapper.go 67.54% 34 Missing and 16 partials ⚠️

📢 Thoughts on this report? Let us know!

The schema position mapper short-circuited when the cursor sat on the
right-hand side of an arrow expression (`.any(member)`, `.all(member)`,
or `parent->member`), so editors backed by the LSP server returned no
hover and no go-to-definition for arrow RHS identifiers.

Replace the short-circuit with proper resolution: look up the LHS
relation's allowed direct target types via Definition.AllowedSubjectRelations
and find the RHS name on each target namespace, returning all matches
when the LHS permits multiple target types. Generator errors from the
resolver are propagated rather than swallowed. The downstream
relation/permission rendering path is unchanged.

Add table-driven coverage for ->, .any, .all, permission resolution,
subject-subrelation LHS (group#member), multi-target match behavior,
and the no-match negative case, plus a composable-schema test that
pins arrow RHS behavior for imported target namespaces.
@ivanauth ivanauth force-pushed the fix/issue-2990-arrow-rhs-hover branch from d909d72 to 9a5624c Compare June 5, 2026 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LSP doesn't provide diagnostics on hover when using .any or .all or ->

1 participant