Comments (4)
Update on my debugging endeavors:
I cloned the git project. Somehow after a while vscode detected a devenv project, so I installed that extension and shortly afterwards docker on WSL2 (ugh).
Seemingly I can debug the extension now, but it won't yet find the correct python with sphinx and also not the esbonio deployment which I think is part of the project, no?
Is there a way to avoid this huge tooling overhead, yet still debug the extension?
Speaking of which, since the devenv is running a linux, I won't be able to reproduce the Windows-specific partition problem I wanted to diagnose, I think.
from esbonio.
Thank you for trying to debug this!
Before I get into the debugging setup, have you tried running the extension with esbonio.logging.level
set to debug
? The sever logs quite a lot of information so you should be able to get more details from the Esbonio
Output channel in VSCode.
If I had to guess, I would expect that the server needs to do something in order to take into account the partition where the project is located when spawning the Sphinx subprocess - I don't suppose you'd know what that "something" would be?
Apologies for the broken devenv, it's very new and I'm yet to get it working completely myself! 😅
One of the reasons I'm experimenting with the devcontainer is to try and streamline the process of setting up the development environment, which for the VSCode extension is a little involved.
Speaking of which, since the devenv is running a linux, I won't be able to reproduce the Windows-specific partition problem I wanted to diagnose, I think.
Correct.
Unfortunately, I don't have time right now to write down the steps in detail but wanted to acknowledge your issue at least. Aside from the usual node project steps, setting up the environment boils down to reconstructing the missing esbonio deployment in the bundled/libs
folder. You might be able to figure it out from the Makefile
in the code/
folder.
I'll try and get more detailed steps written up either later today or tomorrow :)
from esbonio.
Hello, here is an excerpt of the debug log:
[esbonio.Configuration] SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['c:\\Users\\<user>\\AppData\\Local\\Programs\\Python\\Python312\\python.exe'], build_command=['sphinx-build', '-M', 'html', 'src', 'build'], env_passthrough=[], cwd='', python_path=[])
[esbonio.Configuration] Previous: None
[esbonio.Configuration] Current: SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['c:\\Users\\<user>\\AppData\\Local\\Programs\\Python\\Python312\\python.exe'], build_command=['sphinx-build', '-M', 'html', 'src', 'build'], env_passthrough=[], cwd='', python_path=[])
[esbonio.Configuration] ConfigChangeEvent(scope='file:///f%3A/projects/personal/sphinx-projects/sphinx-extension', value=SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['c:\\Users\\<user>\\AppData\\Local\\Programs\\Python\\Python312\\python.exe'], build_command=['sphinx-build', '-M', 'html', 'src', 'build'], env_passthrough=[], cwd='', python_path=[]), previous=None)
[esbonio.SphinxManager] Cwd: f:\projects\personal\sphinx-projects\sphinx-extension
[esbonio.SphinxManager] Build command: ['sphinx-build', '-M', 'html', 'src', 'build']
[esbonio.SphinxManager] Client created for scope file:///f%3A/projects/personal/sphinx-projects/sphinx-extension
[esbonio.SphinxManager] SphinxClient[b988b981-a84e-4e0a-b053-740586589a95]: None -> ClientState.Starting
[esbonio.SphinxManager] Starting sphinx agent: c:\Users\<user>\AppData\Local\Programs\Python\Python312\python.exe -m sphinx_agent
[esbonio.ProjectManager] No applicable project for uri: file:///f%3A/projects/personal/sphinx-projects/sphinx-extension/src/index.rst
[esbonio.ProjectManager] No applicable project for uri: file:///f%3A/projects/personal/sphinx-projects/sphinx-extension/src/index.rst
Running Sphinx v7.3.7
[esbonio.SphinxManager] Unable to start SphinxClient: path is on mount 'C:', start on mount 'F:'
Traceback (most recent call last):
File "c:\Users\<user>\.vscode-insiders\extensions\swyddfa.esbonio-0.94.0\bundled\libs\esbonio\server\features\sphinx_manager\client_subprocess.py", line 210, in start
self.sphinx_info = await self.protocol.send_request_async(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pygls.exceptions.JsonRpcInternalError: path is on mount 'C:', start on mount 'F:'
[esbonio.SphinxManager] SphinxClient[b988b981-a84e-4e0a-b053-740586589a95]: ClientState.Starting -> ClientState.Errored
from esbonio.
Looking at the logs, the error is triggered when the server spawns the Sphinx process, it tries to compute a relative path between the Sphinx project and some bundled JS files the server needs to make previews work - which of course can't work across partitions. I have a proof of concept fix, so it should be possible to rework things to not need the relative path.
Here are some notes on setting up the development environment in case you are still interested in trying that.
- Open a terminal in the
code/
folder - Run
npm ci
to install JS dependencies - Run
npm run compile
to compile the extension - Run
python -m pip install -t ./bundled/libs --no-cache-dir --implementation py --no-deps --upgrade -r ./requirements.txt
to install esbonio's Python dependencies - Now on linux I would run
ln -s $(pwd)/../lib/esbonio/esbonio bundled/libs/esbonio
to link thecode/bundled/libs/esbonio
folder with the development version of the server in thelib/esbonio/esbonio
. But I know on Windows symlinks work differently... so maybe just copy-pasting the files across is enough to get things working.
That should be all the dependencies taken care of, so you should be able to use the VSCode Extension
debug config to start a debug session 🤞
from esbonio.
Related Issues (20)
- Re-implement `sphinx.configOverrides`
- Improve sync scrolling resolution
- Add option(s) to control when preview reloads
- Investigate preview handling of anchor links
- Fails to start server HOT 3
- Preview of rst files not working HOT 19
- Suppress directive completions when typing closing backticks
- Suggest `eval-rst` directive when typing in MyST synatx
- `ValueError` when typing directive options in MyST
- `KeyError` related to deleted files in the sphinx agent
- Server does not end progress when the build fails HOT 1
- Rebuild files that contain diagnostics
- `:name:` + `:numref:` links do not update properly HOT 2
- It's impossible to configure the server for projects located on a Windows network share
- [Feature]: Make clickable paths to .uml files (for the uml directive) HOT 2
- It's hard to debug errors in the sphinx agent
- Support for Jupyter-Book HOT 2
- Print statement in Sphinx event callback breaks esbonio HOT 2
- Exception JsonRpcInternalError HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esbonio.