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

Indexer fails to identify continuation preceded by newline #10351

Closed
charliermarsh opened this issue Mar 12, 2024 · 0 comments · Fixed by #10354
Closed

Indexer fails to identify continuation preceded by newline #10351

charliermarsh opened this issue Mar 12, 2024 · 0 comments · Fixed by #10354
Labels
bug Something isn't working

Comments

@charliermarsh
Copy link
Member

Given:

(
    1
    \
    + 2)

We don't identify any continuation_lines in the Indexer.

@charliermarsh charliermarsh added bug Something isn't working accepted Ready for implementation and removed accepted Ready for implementation labels Mar 12, 2024
charliermarsh pushed a commit that referenced this issue Mar 12, 2024
…#10354)

## Summary

Fixes #10351

It seems the bug was caused by this section of code

https://github.com/astral-sh/ruff/blob/b669306c87ec304182fd50872b50858e2faf0262/crates/ruff_python_index/src/indexer.rs#L55-L58

It's true that newline tokens cannot be immediately followed by line
continuations, but only outside parentheses. e.g. the exception
```
(
    1
    \
    + 2)
```

But why was this check put there in the first place? Is it guarding
against something else?



## Test Plan

New test was added to indexer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant