Comments (2)
With Sphinx version 7.2.6 everything works fine
To be honest, I'm surprised this worked for you before.
The most common way for a language server like esbonio
to communicate with an editor is to print()
messages to stdout. Unfortunately, this means nothing else in the server process can use print()
as it will interfere with the communication between client and server - as you are seeing here.
The upcoming 1.0
release will move Sphinx out into a separate process which opens up the possibility to use a different communication mechanism. However the easiest solution for the time being is to work around this.
You could either use a logger from Sphinx's logging system
from sphinx.util.logging import getLogger
logger = getLogger("name")
def test_before_read_docs(a, b, c):
logger.info("test")
pass
def setup(app) -> dict[str, str | bool]:
app.connect("env-before-read-docs", test_before_read_docs)
return {"version": "0.1", "parallel_read_safe": False}
Or you could try printing to stderr instead
import sys
def test_before_read_docs(a, b, c):
print(test", file=sys.stderr)
pass
def setup(app) -> dict[str, str | bool]:
app.connect("env-before-read-docs", test_before_read_docs)
return {"version": "0.1", "parallel_read_safe": False}
Hope that helps!
from esbonio.
Switching from using print
to the sphinx logger solves the issue, thank you very much!
I am also very confused why this problem only showed up since the latest Sphinx release.
Again, thanks for your help.
from esbonio.
Related Issues (20)
- Investigate preview handling of anchor links
- Fails to start server HOT 3
- Preview of rst files not working HOT 22
- 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 all progress tokens HOT 2
- Rebuild files that contain diagnostics
- JsonRpcInternalError path mount HOT 4
- `:name:` + `:numref:` links do not update properly HOT 2
- It's impossible to configure the server for projects located on a Windows network share HOT 1
- [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
- `dump_config` doesn't handle all values correctly HOT 12
- Runtime error when defining Sphinx tag HOT 4
- Flaky test
- Cannot clear `docs/_build` directory due to locked database files HOT 4
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.