swyddfa / esbonio

A language server for working with Sphinx projects.

Home Page:https://docs.esbon.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Empty outline for specific two level heading rst document with substitution definition

davbeek opened this issue · comments

The following rst document has an empty outline, with message "The active editor cannot provide outline information":

=========
Top level
=========

Second level
============

.. |pict| image:: test.png

The substitution definition |pict| is not used in the text, using it or not makes no difference for the empty outline.

Strangely enough, the following rst document does give a normal outline:

Top level
=========

Second level
------------

.. |pict| image:: test.png

Looks like the outline code for directives needs to be able to also handle substitutions, should be easy enough to fix :)

Strangely enough, the following rst document does give a normal outline

It is strange… no idea why that it is but it seems to be related to docutils version, v0.18.1 fails in both scenarios for me, but with v0.19 i see the behaviour you describe… 🤷

This should now be fixed in v0.14.1 of the language server which is now available on PyPI and the conda package will hopefully be available in a few hours from now.

Feel free to re-open this if the problem persists.

Great, after deleting the cache and recompiling, every page with substitutions now has an outline. Thanks!