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)
- 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
- The reStructureText extension preview functionality is defunct. The reStructureText team says this is esbonio issue. HOT 5
- Release and development version both do not display preview HOT 10
- Cannot use esbonio with `ablog` extension
- Scrolling editor no longer syncs with previewer after preview scroll HOT 2
- Scrolling the previewer by a single line can cause the previewer to scrol to the next or previous section heading HOT 3
- Fail to render preview HOT 6
- Extension does not work with Sphinx 8.0.2 HOT 3
- Manually closing backticks should not result in double backticks HOT 4
- Running Esbonio Preview on Codespaces doesn't work HOT 6
- Esbonio VS Code Reviewer's Guide HOT 2
- Esbonio web site HTTPS is down HOT 1
- 1.0 when? HOT 1
- VS Code extension release notes should explicitly show bundled esbonio version HOT 3
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.