nvarner / typst-lsp

[Deprecated] An early language server for Typst, plus a VS Code extension
MIT License
1.2k stars 77 forks source link

Off-by-one in hover position #447

Open mtoohey31 opened 8 months ago

mtoohey31 commented 8 months ago

Issue

When hovering, the position used to produce information appears to be off by one, to the right. This means that if you hover on the first character of an identifier, you won't get any info. I discovered this while using the language server with Helix.

Potential Cause

I believe we're actually doing everything correctly, and that the root issue is in the typst-syntax crate. I'm going to open an issue upstream to ask for clarification on how things are supposed to work, and suggest a potential fix. Just wanted to document things here so someone else investigates if I end up forgetting about this.

mtoohey31 commented 8 months ago

Now that https://github.com/typst/typst/pull/3767 has been merged, next time we update the typst-ide this should be resolved. When calling functions that now take a Side parameter, we should always use Side::After.