Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flush errors after namer and resolver #7796

Draft
wants to merge 16 commits into
base: master
Choose a base branch
from
Draft

Flush errors after namer and resolver #7796

wants to merge 16 commits into from

Conversation

ilyailya
Copy link
Collaborator

@ilyailya ilyailya commented Mar 30, 2024

The PR flushes errors after running the namer and the resolver.
The change also adds cache for the errors, preventing Sorbet from losing errors due to additional flushes

Motivation

This would make Sorbet feel more responsive, as errors would be displayed more quickly in LSP mode.

I tested the PR on Stripe's codebase by inserting a specific piece of code and tracking the timing of error reports through LSP logs

    include # this is a namer error

    B = T.type_alias { String }


    class A < B # this is resolver error
    end
Error flushing mode Time until Namer error, s Time until Resolver error, s
Only after typecheck 12.29 12.29
After namer, resolver and typechek 6.3 11.4

Test plan

See included automated tests.

@ilyailya ilyailya force-pushed the iz/error-flush branch 3 times, most recently from e2c75f1 to 6921707 Compare May 4, 2024 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant