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

Raw strings are sometimes incorrectly highlighted as syntax errors #5586

Closed
etiennebacher opened this issue Dec 3, 2024 · 2 comments
Closed

Comments

@etiennebacher
Copy link

System details:

Positron and OS details:

Positron Version: 2024.11.0 build 69
Code - OSS Version: 1.93.0
Commit: 4cde19a
Date: 2024-10-21T02:40:21.993Z
Electron: 30.4.0
Chromium: 124.0.6367.243
Node.js: 20.15.1
V8: 12.4.254.20-electron.0
OS: Linux x64 6.8.0-49-generic

Interpreter details:

R 4.4.1

Describe the issue:

Some raw strings are incorrectly marked as syntax errors while they work as expected. When they are called as "literals" then there is a warning "No symbol named 'r' in scope". When they are called as function arguments there is a syntax error "Expected ',' between expressions".

Steps to reproduce the issue:

In an R script:

r"((\d+))" # -> yellow wave under the "r"
stringr::str_extract("foo123", r"((\d+))")  # -> red wave under the "r"

The stringr call produces the expected output, but the syntax error shouldn't be reported.

Expected or desired behavior:

None of the r are highlighted.

Were there any error messages in the UI, Output panel, or Developer Tools console?

Didn't notice anything specific there.

@DavisVaughan
Copy link
Contributor

Pretty sure this is r-lib/tree-sitter-r#162 so im going to close in favor of tracking there

@jmcphers
Copy link
Collaborator

jmcphers commented Dec 3, 2024

Image

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants