swyddfa / esbonio

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

Extension does not work with Sphinx 8.0.2 #890

Open PierreMarchand20 opened 2 months ago

PierreMarchand20 commented 2 months ago

Expected behavior

Everything should work as it did with sphinx version 7.3.7.

Actual behavior

I get AttributeError: 'PosixPath' has no attribute 'decode' using sphinx 8.0.2 when saving file, and preview gives: image

Log output

ERROR: sphinx-build failed
Traceback (most recent call last):
  File "/Users/pierremarchand/Partage/web/cpp_quickstart/.venv/lib/python3.12/site-packages/docutils/utils/__init__.py", line 354, in decode_path
    path = path.decode(sys.getfilesystemencoding(), 'strict')
           ^^^^^^^^^^^
  File "/Users/pierremarchand/Partage/web/cpp_quickstart/.venv/lib/python3.12/site-packages/sphinx/util/_pathlib.py", line 99, in __getattr__
    raise AttributeError(msg)
AttributeError: 'PosixPath' has no attribute 'decode'

(Optional) Settings from conf.py

No response

alcarney commented 2 months ago

Thank you for the bug report!

Just checking which version of Esbonio are you using? Unfortunately, the 0.x release is not going to get support for Sphinx v8 (unless someone wants to backport a fix, I'm happy to accept PRs like #837)

However, I think I've fixed this particular issue in #866 for the in-development 1.0 version. I'll try and get another pre-release out over the next week so that it can be tested.

PierreMarchand20 commented 2 months ago

I have the 0.11.0. I actually made it work: I used sphinx 7.3.7 in my virtual environment so everything worked. Then I switched back to sphinx 8.0.2 and it still works. My guess is that something is cached so that we do not call this particular function.

It is something I have not yet understood with Esbonio: where is the compiled project ? If I want to clean everything, can I ?

alcarney commented 2 months ago

where is the compiled project ?

You can set the location using the esbonio.sphinx.buildDir option. By default however, the extension uses the workspace storage provided by VSCode. On my machine that is a location like /home/<username>/.config/Code/User/workspaceStorage/<hash>/swyddfa.esbonio/sphinx/

If I want to clean everything, can I ?

Sure, just delete the build folder and restart the server. There's also the esbonio.sphinx.forceFullBuild option which might be enough to clear the cached data.