Skip to content

Update Stylist quote detection to use the new f-string tokens #7293

@dhruvmanila

Description

@dhruvmanila

Update the detect_quote function to either use the String or FStringStart token to detect the quote (single or double).

This should probably be enough as the FStringStart token contains the prefix and quotes for the f-string:

    let quote_range = tokens.iter().flatten().find_map(|(t, range)| match t {
        Tok::String {
            triple_quoted: false,
            ..
-        } => Some(*range),
+        }
+        | Tok::FStringStart => Some(*range),
        _ => None,
    });

Metadata

Metadata

Assignees

Labels

coreRelated to core functionalitypython312Related to Python 3.12

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions