-
Notifications
You must be signed in to change notification settings - Fork 21
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
Server does not automatically discover a project in a sub-folder of the workspace #779
Comments
Seems like it used to work in 0.92 and broke after the upgrade to 0.93. I have docs in {workspaceRoot}/.../.../.../.../docs/. My expectation is that if I try to edit or preview an .rst file, Esbonio should start walking up from that file until it sees a Sphinx folder root. It shouldn't have to discover all Sphinx projects in the entire workspace. |
Yes, #744 rewrote the sphinx process handling to be more robust, but unfortunately, introduced this bug.
That is the logic the server uses, the problem is that it's currently choosing a starting point too high in the folder hierarchy and missing the Sphinx project entirely 🤦
You may want to consider adding your docs folder as another root within your workspace. Esbonio and the language server protocol in general, (at least to my understanding) are going to make assumptions based on dealing with files that live within one of root folders of the workspace. |
I still have this issue, although not strictly this issue, because all files are at the top level of the workspace. I have followed all steps suggested in the Preview window (No Content Found).
|
Based on seeing
and
in the logs, it looks like the server is correctly finding your project, but has not triggered any builds 🤔 Unfortunately, I only have questions at this point 😅
|
Indeed, the server appears to be hanging for some reason. After a restart and saving a few times, I get:
|
Somehow my logging level was set at info. Setting back to debug, I do get an error message after Sphinx. Also, to be sure I removed the "esbonio.sphinx.buildCommand":
|
I switched back to the release version, and that also does not work anymore, so something must have changed in my setup. Trying to figure out what that is. |
I got the release version working again. An extension I used stopped working, probably due to compatibility issues with new releases of Python or Sphinx. This was indicated in the Problems tab of VSCode. After disabling the extension, the release version of Esbonio now works again, as usual, but the problems with the prerelease version, unfortunately, are still present. I also completely reinstalled conda and all Python packages, which gets me at Python 3.12.3. The Esbonio problems are similar as before. I kept the settings for the Esbonio release and prerease versions both active in the settings file:
|
Thinking about this some more and re-reading the logs, the hang looks like it's caused by the fact the server isn't getting a message back from the Sphinx process saying that it's ready. This makes the server think the Sphinx process is still starting and everything (previews, builds etc.) block waiting for this ready message that never arrives... 🤔 There could be many explanations for this... but the fact that there are no obvious error messages makes me think that something in the Sphinx process could be printing to It's a long shot, but could you try disabling your Sphinx extensions checking that there are no |
After some debugging and experimenting I found the cause of the problem was the esbonio python module. After removing esbonio from the installed packages, everything worked again. |
I can add that scrolling works nicely both ways, from preview to code and vice versa. Also, the preview keeps its position when saving and does not jump back to the beginning of the file, which is a big improvement in usability. Preview still does not work for |
Glad to hear it! It's just a shame it's so fiddly to get the new version up and running! 😅
Sounds like #782 is definitely going to be needed! |
Expected behavior
Esbonio should be able to automatically find a Sphinx project located in a sub-folder e.g.
${workspaceFolder}/docs
and make a reasonable guess at what thesphinx-build
command should be.This can be worked around by setting
esbonio.sphinx.buildCommand
in either the language client or apyproject.toml
file, but it would be ideal to not have to configure the server upfront.Actual behavior
The server searches for
conf.py
in${workspaceFolder}
and all parent folders, missing theconf.py
located underdocs/
.This is due to
self.server.configuration.scope_for(uri)
returning${workspaceFolder}
as the configuration scope 🤔Log output
No response
(Optional) Settings from conf.py
No response
The text was updated successfully, but these errors were encountered: