Skip to content

NA introduced into position when opening curly braces #564

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

Closed
andyquinterom opened this issue Jul 25, 2022 · 2 comments · Fixed by #565
Closed

NA introduced into position when opening curly braces #564

andyquinterom opened this issue Jul 25, 2022 · 2 comments · Fixed by #565

Comments

@andyquinterom
Copy link
Contributor

The language server introduces NA when code like the following occurs

function() {
  test <- print(
}

This causes for the Neovim lsp interface to error out. In this like shiny this is a very common thing to find.

My fix was pretty easy, I went to the code_point_to_unit function and added the following:

result[is.na(pts)] <- m

This fixes the issue and does not seem to break any other behaviour. This is a pretty minor fix. Hope it can get merged!

@andyquinterom
Copy link
Contributor Author

Some more context:

This is the error I was getting on Neovim after configuring the LSP.
image

I modified the neovim source code to expose the exact comparison that was causing the error. See that is tries to compare a string with a number.

After exposing the variable is was a string containing NA. This is pretty common R stuff to from there I tried to make my fix.

@osthomas
Copy link

Related: #481

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 a pull request may close this issue.

2 participants