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

Off-by-one in hover position #447

Open
mtoohey31 opened this issue Mar 7, 2024 · 1 comment
Open

Off-by-one in hover position #447

mtoohey31 opened this issue Mar 7, 2024 · 1 comment

Comments

@mtoohey31
Copy link
Contributor

mtoohey31 commented Mar 7, 2024

  • Component: LSP (used with other editor)
  • LSP version: Version: 0.12.0, commit unknown (Typst version 0.10.0)
  • OS version and name: NixOS 24.05 (Uakari)
  • I am on the latest stable version of the extension/LSP. (I have also reproduced building from commit 0d5b933, the latest as of writing.)
  • I have searched the issues of this repo and believe that this is not a duplicate.

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
Copy link
Contributor Author

Now that typst/typst#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.

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

1 participant