[ty] Set flag to avoid `type[T@f]` being inserted when you double-click on the inlay (#22139)

This commit is contained in:
Matthew Mckee 2025-12-22 14:00:45 +00:00 committed by GitHub
parent 884e83591e
commit a46835c224
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 7 deletions

View File

@ -6614,13 +6614,6 @@ mod tests {
3 | y[: type[T@f]] = x
| ^^^
|
---------------------------------------------
info[inlay-hint-edit]: File after edits
info: Source
def f[T](x: type[T]):
y: type[T@f] = x
"#);
}

View File

@ -711,6 +711,7 @@ impl<'db> FmtDetailed<'db> for DisplayRepresentation<'db> {
f.write_char(']')
}
SubclassOfInner::TypeVar(bound_typevar) => {
f.set_invalid_syntax();
f.with_type(KnownClass::Type.to_class_literal(self.db))
.write_str("type")?;
f.write_char('[')?;