Skip to content

Conversation

@auduchinok
Copy link
Member

@auduchinok auduchinok commented Jun 2, 2025

This PR replaces the manual context creation with locating a {caret} mark in the source in more tests. It makes it much easier to write new editor-related tests and should also prevent mistakes that are easy to make when providing the context by hand. It continues the work started in #18524 and #18609.

To make it easier to use the FCS APIs it introduces several new types:

  • SourceContext: contains info about the cursor position and the line text
  • ResolveContext: contains data needed for resolve-related features (getting a symbol, tooltip, overloads, etc)
  • CodeCompletionContext: similar to ResolveContext but has code completion-specific differences

It also introduces new Checker module that provides test helpers for working with these new contexts. We may evolve these helpers into a newer FCS API in future, as it makes it significantly easier to work with these contexts than to provide things like the cursor coordinates separately.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 2, 2025

✅ No release notes required

@auduchinok auduchinok force-pushed the fcs-tests-checker branch 3 times, most recently from 5434a63 to bba05f3 Compare June 2, 2025 21:05
@auduchinok auduchinok force-pushed the fcs-tests-checker branch from bba05f3 to 7aa0c5c Compare June 2, 2025 21:23
@auduchinok
Copy link
Member Author

It's ready 🙂

Copy link
Member

@T-Gro T-Gro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love this.

I only ever had to do a handful of a new completion/tooltip tests, but the test setup with the repetitive line of code entry, and having to manually adjust coordinates, was very annoying and hard to one-shot correctly.

I also believe the {caret} DSL now with the boilerplate removed will be easier for use also for non-humans :))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants