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

Don't trigger code action requests for background views #2108

Merged
merged 2 commits into from
Nov 8, 2022

Conversation

rchl
Copy link
Member

@rchl rchl commented Oct 31, 2022

Servers like typescript trigger textDocument/publishDiagnostics for all open files on making any changes. Our DocumentSyncListener triggered code action request in that case.

Changed so that code action request is only made if the view is visible.

Since the code action response can be affected by changed diagnostics, make sure that the code action request is then also made when view is activated later.

We should have been triggering code action request on view activation anyway as otherwise we have relied on textDocument/publishDiagnostics triggering it which is not guaranteed.

Also made sure that on_load_async triggers on_activated_async which triggers code actions/code lenses/semantic tokens because when file is initially focused the view is not registered yet so we have missed all the logic currently in on_activated_async.

Fixes #2101

@rchl
Copy link
Member Author

rchl commented Nov 8, 2022

Will take no feedback as "no issues" :)

@rchl rchl merged commit 0267a1a into main Nov 8, 2022
@rchl rchl deleted the fix/inactive-code-action branch November 8, 2022 20:07
rchl added a commit that referenced this pull request Jan 16, 2023
* main:
  Don't trigger code action requests for background views (#2108)
  Ignore diagnostics for files in folder_exclude_patterns (#2113)
  Remove unnecessary is_range_equal function (#2114)
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.

Don't trigger code action requests for background documents
1 participant