ruff/crates
Dhruv Manilawala f4e23d2dff
Use string expression for parsing type annotation (#11717)
## Summary

This PR updates the logic for parsing type annotation to accept a
`ExprStringLiteral` node instead of the string value and the range.

The main motivation of this change is to simplify the implementation of
`parse_type_annotation` function with:
* Use the `opener_len` and `closer_len` from the string flags to get the
raw contents range instead of extracting it via
	* `str::leading_quote(expression).unwrap().text_len()`
	* `str::trailing_quote(expression).unwrap().text_len()`
* Avoid comparing the string content if we already know that it's
implicitly concatenated

## Test Plan

`cargo insta test`
2024-06-03 13:04:03 +00:00
..
red_knot Maintain synchronicity between the lexer and the parser (#11457) 2024-06-03 18:23:50 +05:30
ruff Add RDJson support. (#11682) 2024-06-02 17:59:57 +00:00
ruff_benchmark Maintain synchronicity between the lexer and the parser (#11457) 2024-06-03 18:23:50 +05:30
ruff_cache Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_dev Maintain synchronicity between the lexer and the parser (#11457) 2024-06-03 18:23:50 +05:30
ruff_diagnostics Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_formatter Remove some unused pub functions (#11576) 2024-05-28 09:56:51 -04:00
ruff_index Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_linter Use string expression for parsing type annotation (#11717) 2024-06-03 13:04:03 +00:00
ruff_macros Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_notebook ruff server: Support Jupyter Notebook (*.ipynb) files (#11206) 2024-05-21 22:29:30 +00:00
ruff_python_ast Maintain synchronicity between the lexer and the parser (#11457) 2024-06-03 18:23:50 +05:30
ruff_python_ast_integration_tests Maintain synchronicity between the lexer and the parser (#11457) 2024-06-03 18:23:50 +05:30
ruff_python_codegen Maintain synchronicity between the lexer and the parser (#11457) 2024-06-03 18:23:50 +05:30
ruff_python_formatter Maintain synchronicity between the lexer and the parser (#11457) 2024-06-03 18:23:50 +05:30
ruff_python_index Maintain synchronicity between the lexer and the parser (#11457) 2024-06-03 18:23:50 +05:30
ruff_python_literal Remove some unused pub functions (#11576) 2024-05-28 09:56:51 -04:00
ruff_python_parser Use string expression for parsing type annotation (#11717) 2024-06-03 13:04:03 +00:00
ruff_python_resolver chore(deps): update rust crate insta to v1.38.0 (#10701) 2024-04-01 15:44:30 +00:00
ruff_python_semantic Maintain synchronicity between the lexer and the parser (#11457) 2024-06-03 18:23:50 +05:30
ruff_python_stdlib Regenerate sys.rs with stdlibs==2024.5.15 (#11437) 2024-05-15 22:17:32 +00:00
ruff_python_trivia Move has_comments to CommentRanges (#11495) 2024-05-22 13:35:16 +00:00
ruff_python_trivia_integration_tests Maintain synchronicity between the lexer and the parser (#11457) 2024-06-03 18:23:50 +05:30
ruff_server Maintain synchronicity between the lexer and the parser (#11457) 2024-06-03 18:23:50 +05:30
ruff_source_file Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_text_size Range formatting: Fix invalid syntax after parenthesizing expression (#9751) 2024-02-02 17:56:25 +01:00
ruff_wasm Maintain synchronicity between the lexer and the parser (#11457) 2024-06-03 18:23:50 +05:30
ruff_workspace Respect file exclusions in ruff server (#11590) 2024-05-29 02:58:36 +00:00