Skip to content

Commit

Permalink
Postpone diagnostic collection until everything was emitted
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderLanin authored and alcarney committed Dec 1, 2024
1 parent 39123f8 commit be1a4df
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
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)

0 comments on commit be1a4df

Please sign in to comment.