Skip to content

Conversation

henryhchchc
Copy link
Contributor

TexLab will panic if it receives a completion request with an invalid offset. This PR prevents the panic by checking if the offset is in range before passing it to token_at_offset.

As noted in the docs of token_at_offset:

Precondition: offset must be withing node's range.

@pfoerster pfoerster merged commit c45c857 into latex-lsp:master Mar 23, 2025
10 checks passed
@henryhchchc henryhchchc deleted the fix/completion-panic branch March 23, 2025 08:56
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

Successfully merging this pull request may close these issues.

2 participants