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

Postpone diagnostic collection until everything was emitted #926

Merged
merged 1 commit into from
Dec 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/esbonio/changes/925.fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The sphinx agent should now be able to collect diagnostics from extensions that make use of the `build-finished` event e.g. sphinx-needs by @AlexanderLanin
6 changes: 5 additions & 1 deletion lib/esbonio/esbonio/sphinx_agent/handlers/diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,8 @@ def setup(app: Sphinx):
# TODO: Support for Sphinx v7+
# app.connect("include-read")

app.connect("build-finished", sync_diagnostics)
# sync_diagnostics needs to run after all diagnostics have been emitted.
# This ensures proper synchronization of data, as some extensions, like
# sphinx-needs, emit diagnostics during the "build-finished" event.
# Setting priority to 900 ensures this handler runs after typical operations.
app.connect("build-finished", sync_diagnostics, priority=900)