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

GH-2438: Bump langauge server to improve engine #2584

Merged
merged 4 commits into from Mar 9, 2024

Conversation

dantleech
Copy link
Collaborator

@dantleech dantleech commented Mar 3, 2024

Refactors the diagnostic engine.

Basically it improves it in the following ways:

  • It will remain idle until the user has stopped typing (i.e. updates stop) based ont he existing sleep parameter.
  • It fixes the behavior so that we always see the results of the latest lint (there was a race codition previously that caused stale diagnostics to be published).
  • It will only process one file at a time (the most recent one)

Note the behavior has changed to wait before starting the linters and not afterwards. Previously we eagerly ran the linters (i.e. immediately), and only published the results if they corresponded to the latest document. This made feedback much faster, but at the cost of much unneccessary work.

Changes the behavior to resemble the following:

flowchart TD 
  DocumentUpdated --> isenqueued
  isenqueued(is document waiting?) --yes--> ReplaceDocument 
  isenqueued --no--> StartLintProcess
  ReplaceDocument --> ResetSleep
  StartLintProcess --> Sleep
  Sleep --> ForEachLinter>ForEachLinter]
  ForEachLinter --> Lint
  Lint --> IsDocumentCurrent
  IsDocumentCurrent --Yes--> Publish
  IsDocumentCurrent --No-->Discard

in practice it's more complicated, but the essential part is that we do not do anything until the user has "stopped typing" for the grace period.

@dantleech dantleech merged commit c42959b into master Mar 9, 2024
10 checks passed
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