ruff/crates
Dhruv Manilawala ed948eaefb
Avoid moving back the lexer for triple-quoted fstring (#11939)
## Summary

This PR avoids moving back the lexer for a triple-quoted f-string during
the re-lexing phase.

The reason this is a problem is that for a triple-quoted f-string the
newlines are part of the f-string itself, specifically they'll be part
of the `FStringMiddle` token. So, if we moved the lexer back, there
would be a `Newline` token whose range would be in between an
`FStringMiddle` token. This creates a panic in downstream usage.

fixes: #11937 

## Test Plan

Add test cases and validate the snapshots.
2024-06-20 16:27:36 +05:30
..
red_knot Upgrade to Rust 1.79 (#11875) 2024-06-17 07:15:10 +01:00
ruff Update E999 to show all syntax errors (#11900) 2024-06-19 13:09:54 +05:30
ruff_benchmark Build CommentRanges outside the parser (#11792) 2024-06-09 09:55:17 +00:00
ruff_cache
ruff_db [red-knot]: Add a VendoredFileSystem implementation (#11863) 2024-06-18 15:43:39 +00:00
ruff_dev
ruff_diagnostics
ruff_formatter Fix formatter instability for lines only consisting of zero-width characters (#11748) 2024-06-05 17:55:14 +02:00
ruff_index Red-knot: Track scopes per expression (#11754) 2024-06-05 17:53:26 +02:00
ruff_linter Update E999 to show all syntax errors (#11900) 2024-06-19 13:09:54 +05:30
ruff_macros
ruff_notebook
ruff_python_ast red-knot: source_text, line_index, and parsed_module queries (#11822) 2024-06-13 07:37:02 +00:00
ruff_python_ast_integration_tests Rename PreorderVisitor to SourceOrderVisitor (#11798) 2024-06-07 17:01:58 +00:00
ruff_python_codegen Avoid depth counting when detecting indentation (#11947) 2024-06-20 10:42:35 +05:30
ruff_python_formatter Upgrade to Rust 1.79 (#11875) 2024-06-17 07:15:10 +01:00
ruff_python_index Build CommentRanges outside the parser (#11792) 2024-06-09 09:55:17 +00:00
ruff_python_literal
ruff_python_parser Avoid moving back the lexer for triple-quoted fstring (#11939) 2024-06-20 16:27:36 +05:30
ruff_python_resolver
ruff_python_semantic red-knot(Salsa): Types without refinements (#11899) 2024-06-20 12:49:38 +02:00
ruff_python_stdlib
ruff_python_trivia
ruff_python_trivia_integration_tests Build CommentRanges outside the parser (#11792) 2024-06-09 09:55:17 +00:00
ruff_server ruff server: Add tracing setup guide to Neovim documentation (#11884) 2024-06-18 13:39:41 -07:00
ruff_source_file red-knot: source_text, line_index, and parsed_module queries (#11822) 2024-06-13 07:37:02 +00:00
ruff_text_size Upgrade to Rust 1.79 (#11875) 2024-06-17 07:15:10 +01:00
ruff_wasm Build CommentRanges outside the parser (#11792) 2024-06-09 09:55:17 +00:00
ruff_workspace