swyddfa / esbonio

A language server for working with Sphinx projects.
https://docs.esbon.io/
124 stars 21 forks source link

Implement Scroll sync #513

Closed davbeek closed 6 months ago

davbeek commented 1 year ago

Scroll sync does not work in my VSCode 1.74.0, Esbonio 0.15.0, Esbonio VSCode 5.711, MacOS 12.6. VSCode does not know the esbonio.server.enableScrollSync setting (and neither server.enableScrollSync). I also noticed that there are no line numbers in the generated html code.

image image

lextm commented 1 year ago

This is expected, as the goal of 0.15.0 is to help VSCode-restructuredtext extension to test out those new features.

You need to wait for a new release of esbonio-VSCode to enable those features.

davbeek commented 1 year ago

Thanks, I will be more patient 😀

alcarney commented 1 year ago

Just a heads up that it will probably be early(ish) next year before this is available in the Esbonio VSCode extension, as I'm hoping to tackle this and a few other preview related issues (like #440) in a way that would allow previews to be implemented for other editors as well.

So depending on your excitement level you may want to try the feature in the vscode-restructuredtext extension when it becomes available :slightly_smiling_face:

davbeek commented 1 year ago

Thanks for the update. It is nice to have some idea of the time schedule and it does make sense to try and solve related issues before releasing the next version.

davbeek commented 1 year ago

Just a short note for people who are also waiting for this. As a workaround, I now always have the esbonio generated index.html file open in my browser (Safari/Firefox). This only means one extra keyboard press to refresh the browser view after saving my rst source, since esbonio will automatically regenerate the associated html code. Advantage of this setup is that my browser stays at the same location after refreshing.

To change the location of the generated index.html file, set option esbonio.sphinx.buildDir in VSCode. E.g., I save the file in the root of my workspace folder in _build/html:

"esbonio.sphinx.buildDir": "${workspaceFolder}/_build/html"

alcarney commented 1 year ago

If you fancy trying it out, there is now a pre-release version of the extension - v0.90.1 that contains an initial scroll-sync implementation.

Note: The new version doesn't yet support many other features (such as completions), but that should change quite quickly once the fundamentals are worked out.

See #609 for some additional context.

alcarney commented 6 months ago

Since the preview version of the extension now supports sync'd scrolling I'm going to close this issue in favour of smaller issues targeting specific aspects of the implementation e.g. #646