Index multiline f-strings (#9837)

Fix #9777.
This commit is contained in:
Seo Sanghyeon 2024-02-06 11:25:33 +09:00 committed by GitHub
parent 83195a6030
commit df7fb95cbc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
29 changed files with 180 additions and 25 deletions

View file

@ -46,7 +46,8 @@ pub(crate) struct MultilineRangesBuilder {
impl MultilineRangesBuilder {
pub(crate) fn visit_token(&mut self, token: &Tok, range: TextRange) {
if let Tok::String { triple_quoted, .. } = token {
if let Tok::String { triple_quoted, .. } | Tok::FStringMiddle { triple_quoted, .. } = token
{
if *triple_quoted {
self.ranges.push(range);
}