Closed tim-nordell-nimbelink closed 1 year ago
Thanks!
Does this mean we can close out #163? My dev env doesn't seem to like the esbonio extension in VSCode (hit some other non-related issues with the esbonio settings), so my local attempt failed.
UPDATE: I got it working with esbonio default settings! Thanks @tim-nordell-nimbelink
Probably can be closed? I'm using Esbonio within NeoVIM, but did test these changes within VSCode, too. Maybe @twodrops could test it since he opened the original issue in this project?
I got it to work, so I closed the issue. It would be good to get a ~second~ third opinion, but @twodrops noted using a dev container and this fix hasn't been deployed to pypi yet (can be installed with the nightly https://test.pypi.org/project/sphinx-immaterial/0.11.3.post1.dev23/).
Works like a charm from within DevContainer! Thanks a lot @tim-nordell-nimbelink @2bndy5
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)