Repository navigation
Add file-resolution and caret-based lookup tests verifying which handler file Go to Handler resolves for a MediatR request - #123
Merged
Conversation
kzryzstof
marked this pull request as draft
September 7, 2026 23:34
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 6.0.0 to 6.0.1. - [Release notes](https://github.com/actions/setup-java/releases) - [Commits](actions/setup-java@v6.0.0...v6.0.1) --- updated-dependencies: - dependency-name: actions/setup-java dependency-version: 6.0.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ating the handler search (#121)
kzryzstof
marked this pull request as ready for review
September 19, 2026 13:38
… to Handler Adds a way to verify which handler file the plugin resolves for a given request, both by name lookup (AssertHandlerFilesFor, run across the shared MediatR v12/v13/v14 fixture) and by placing a real caret via SDK text-control support and resolving the PSI node under it, mirroring how GoToHandlerAction gets its selected identifier in production. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_0184Nxbg3pykkbbRL1E1o15M
The JetBrains test framework reuses one LookupTestBase instance across every [Test] method in a fixture (solution loading is too expensive to redo per test), so _expectedHandlerNames and _expectedHandlerFilePaths survived from whichever assertion ran last. Once a caret-file-lookup test set _expectedHandlerFilePaths, every later name-based test in the same fixture instance silently ran the file-path branch of DoTest against its stale expectation instead of its own assertion, failing CI with mismatched expected/actual handler paths. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_0184Nxbg3pykkbbRL1E1o15M
…tion scenarios Adds tests for caret placement scenarios on identifiers not resolving to handlers, including namespace identifiers and MediatR `Send` calls. Refactors test logic to handle cases with no expected handler matches.
Renames `TestName` to `TestMethodName` for better alignment with its purpose and to prevent ambiguity in test logic.
Introduces `MediatRCallsite` and `MediatorCallsite` classes to handle MediatR request sending with `CustomClassRequest` and `NewMediatorRequest`.
…ediatR naming conventions Renames classes and file references in GoToHandlerCaretTests to align with the MediatR naming standard, ensuring uniformity across test files.
kzryzstof
force-pushed
the
features/caret-based-handler-lookup-test
branch
from
September 19, 2026 13:54
ea17d39 to
cc2456f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds coverage for the plugin's "Go to Handler" navigation: tests that verify which handler file gets resolved for a given MediatR request, not just which handler type. One variant checks this by request name across the shared MediatR v12/v13/v14 fixtures; the other places a real caret on the request and resolves the underlying PSI node through the SDK's own caret-to-element utility, closer to how the plugin's action itself locates the selected request in the editor.
Changes
LookupTestBase.AssertHandlerFilesFor(...): resolves a request's handler(s) and asserts the relative file path(s) they're declared in, reusing the existingTestSolutionFiles.MediatRfixture set.MediatR.Requests.Tests.cs: newFindHandlers_CaretOnRequest_HandlerFileReturnedtest using the above.GoToHandlerCaretTests(+ V12/V13/V14 variants): places a{caret}marker on a request type in a dedicated fixture, resolves the PSI identifier under it viaTextControlToPsi.GetElement<IIdentifier>, and asserts the resolved handler's file.test/data/GoToHandlerCaretTests/Request.cs(with{caret}marker) andHandler.cs.Related
Generated by describe-pr skill v1.1.0