I am on the latest stable version of the extension/LSP.
I have searched the issues of this repo and believe that this is not a duplicate.
Issue
The LSP does not seem to react to the cursor hovering when hovering the first character of the keyword.
I have noticed this on my NeoVim and checked this also happens in VS Code.
let typst_offset =
lsp_to_typst::position_to_offset(position, position_encoding, &source) + 1;
Possible cause
possibly, wrong byte index (shifted by one) is returned from typst_syntax::source::Source::utf16_to_byte and/or typst_syntax::source::Source::line_column_to_byte
Issue
The LSP does not seem to react to the cursor hovering when hovering the first character of the keyword. I have noticed this on my NeoVim and checked this also happens in VS Code.
Temporal Fix
Add
+1
to the line insrc/server/hover.rs
: https://github.com/nvarner/typst-lsp/blob/0d5b9330a1d515fa47456e755f751ea4056282b8/src/server/hover.rs#L27C17-L28C92Possible cause
possibly, wrong byte index (shifted by one) is returned from
typst_syntax::source::Source::utf16_to_byte
and/ortypst_syntax::source::Source::line_column_to_byte