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

internal error (unexpected string constant) caused by parse #299

Closed
renkun-ken opened this issue Jul 3, 2020 · 0 comments · Fixed by #300
Closed

internal error (unexpected string constant) caused by parse #299

renkun-ken opened this issue Jul 3, 2020 · 0 comments · Fixed by #300

Comments

@renkun-ken
Copy link
Member

Open a file with some strings and the parse() used to get the string text could produce error very rarely.

For example, R/document.R contains the following code:

f %in% c("library", "require")

Very rarely, the following error occurs while the file is open for the first time and cannot be reproduced later.

[2020-07-03 10:39:24.692] handling request:  textDocument/documentLink
[2020-07-03 10:39:24.697] internal error: Error: <text>:27:3: unexpected string constant
26: 
27: ry", "
      ^
Call: parse(text = str_expr, keep.source = FALSE)
Stack trace:
1: parse(text = str_expr, keep.source = FALSE)
2: document_link_reply(id, uri, self$workspace, document, rootPath)
3: dispatch(self, id, params)

Not sure why this occurs but a simple fix is to try catch parse() and return nothing if there's an error.

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.

1 participant