Skip to content

Conversation

@alcarney
Copy link
Member

@alcarney alcarney commented May 24, 2025

  • Call workspace/diagnostic/refresh when sphinx builds complete to ensure timely updates to diagnostics
  • Fallback to push based diagnostics when the client does not support workspace/diagnostic/refresh

Closes #998

alcarney added 4 commits June 27, 2025 18:45
Due to timing issues between the background sphinx build and
`textDocument/diagnostic` requests from the client, the only way to
provide a good experience is to issue `workspace/diagnostic/refresh`
requests each time a build completes to force the client to ask for an
update.

Taking advantage of the better `initialize` request handling in
`pygls` v2, we only register our pull-model diagnostic support when
the client advertises all of the capabilities we need to provide a
good experience.
syncing diagnostics on app creation has the side-effect of purging all
the diagnostics that were recorded the last time the sphinx agent was
used for the project.

Instead, only sync the diagnostics when a build completes
This allows diagnostics recorded from the previous editing session to
be provided
Where we would call `sync_diagnostics` in the push model, use the same
trigger to send a refresh request to the clients that support it. This
should ensure diagnostics are reported in a more timely fashion.
@alcarney alcarney force-pushed the refresh-diagnostics branch from 2465cbd to 7fdaa07 Compare June 27, 2025 17:49
@alcarney alcarney marked this pull request as ready for review June 27, 2025 17:57
@alcarney alcarney merged commit dc433f9 into swyddfa:develop Jun 27, 2025
22 of 24 checks passed
@alcarney alcarney deleted the refresh-diagnostics branch June 27, 2025 17:59
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.

No diagnostics and symbols

1 participant