Skip to content
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

Theme does not work with rST Vscode Extension #163

Closed
twodrops opened this issue Sep 22, 2022 · 4 comments
Closed

Theme does not work with rST Vscode Extension #163

twodrops opened this issue Sep 22, 2022 · 4 comments

Comments

@twodrops
Copy link

I really like the immaterial theme, but it does not work with rST VsCode Extension. The problem is with the language server (Esbonio) used by the extension that it crashes with the async Google font download.

I did not find a way to turn off the font download. It would be nice, if the font download is made optional.

@2bndy5
Copy link
Collaborator

2bndy5 commented Sep 22, 2022

Can you post anything that tells us why the font is causing the extension to crash?

If it is a problem with the path to the fonts not being relative to the sphinx-build output, then you can use the config option sphinx_immaterial_external_resource_cache_dir to tell the theme to download the fonts to your project's docs' build folder.

@twodrops
Copy link
Author

Unfortunately the extension does not seem to write much about this problem on the console even with debug log level.

/usr/local/lib/python3.10/site-packages/esbonio/lsp/sphinx/init.py:164: RuntimeWarning: coroutine 'add_google_fonts..do_fetch' was never awaited

sphinx_immaterial_external_resource_cache_dir worked well with local build but not with the build triggered by the extension,

There is some suggestion by the Esbonio developers here
swyddfa/esbonio#451 (comment)

@twodrops
Copy link
Author

Maybe it is notable to say that I am using a VsCode DevContainer. But most other themes work fine with this setup and Esbonio.

@2bndy5 2bndy5 added the invalid This doesn't seem right label Oct 29, 2022
tim-nordell-nimbelink added a commit to tim-nordell-nimbelink/sphinx-immaterial that referenced this issue May 5, 2023
The Esbonio language server runs its own asyncio loop context when it
invokes the Sphinx code.  This causes the asyncio.run() call to complain
since it's already being run in the same thread.

Since we're already running a set of threads here using PoolExecutor, we can
run one more thread which runs the asyncio.run() context in a separate
thread.  This mitigates the interoperability issue with the Esbonio
language server at the cost of an additional thread, and at the cost of
blocking the coroutine loop within the Esbonio language server for the
closing of the download set.

(See also swyddfa/esbonio#451)
jbms pushed a commit that referenced this issue May 5, 2023
The Esbonio language server runs its own asyncio loop context when it
invokes the Sphinx code.  This causes the asyncio.run() call to complain
since it's already being run in the same thread.

Since we're already running a set of threads here using PoolExecutor, we can
run one more thread which runs the asyncio.run() context in a separate
thread.  This mitigates the interoperability issue with the Esbonio
language server at the cost of an additional thread, and at the cost of
blocking the coroutine loop within the Esbonio language server for the
closing of the download set.

(See also swyddfa/esbonio#451)
@2bndy5 2bndy5 closed this as completed May 5, 2023
@2bndy5 2bndy5 added pending release has been resolved but is pending a new release and removed invalid This doesn't seem right labels May 6, 2023
@2bndy5
Copy link
Collaborator

2bndy5 commented May 31, 2023

Solution released in v0.11.4

@2bndy5 2bndy5 removed the pending release has been resolved but is pending a new release label May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants