-
Notifications
You must be signed in to change notification settings - Fork 108
fix(splitter): improve EOF handling #556
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
Conversation
| p.advance(); | ||
| break; | ||
| } | ||
| SyntaxKind::EOF => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: we do not need to handle EOF below anymore
psteinroe
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it! maybe we could add our own Result type that always returns the eof error to make sure we don't accidentally bubble up another error and handle it in the wrong way?
Currently, if you type
select casein a file, the LSP will crash.The reason is that we forgot to handle the EOF token in the
case()function in the splitter.I feel that, since we deal with incomplete statements all the time, it's better to bubble up an Err if we reach EOF:
But it's a bit invasive, so WDYT?
(Pretty sure this fixes #540, it's the same kind of error)