swyddfa / esbonio

A language server for working with Sphinx projects.
https://docs.esbon.io/
121 stars 21 forks source link

`:name:` + `:numref:` links do not update properly #812

Open decimad opened 1 month ago

decimad commented 1 month ago

Expected behavior

When provided following rst code (numfig = True):

Below are timing diagrams of two constellations with differing producer and consumer periods: :math:`\tau_c = \tau_p` (:numref:`examples.buffer_sharing.figure.timing_double_rate_equal`) and :math:`\tau_c = 2.5\tau_c` (snip).
For both constellations the sensible scenarios **cycle early/cycle late** and **drop early/drop late** are shown. Numbers shown inside the buffer access indicators identify the index of the buffer that is accessed.

.. figure:: images/examples.buffer_sharing.timing_double_rate_equal.svg
    :name:  examples.buffer_sharing.figure.timing_double_rate_equal
    :align: center
    :scale: 180

    Timing diagram for double buffering with :math:`\tau_c = \tau_p`.
    The consumer synchronizes to the producer cycle by issuing wait operations via ``buffer_sink_wait()``.

Should build without error and link the figure properly.

Actual behavior

A fresh esbonio build without pre-existing build directory will link the figure correctly. However, after changing the :name: property and the :numref: accordingly, the link will fail with warning undefined label: 'examples.buffer_sharing.figure.timing_double_rate_unequal'. This happens until the build tree was deleted (ie. a restart of the language server does not help).

Log output

No response

(Optional) Settings from conf.py

No response

alcarney commented 1 month ago

This sounds like it could be a similar issue to #705, hopefully fixing that will also fix this issue 🤞

decimad commented 1 month ago

It might actually be the case, that this is a problem within sphinx itself, as I saw similar behavior from the command prompt today. I will investigate this further in the coming days...