[red-knot] Fix offset handling in playground for 2-code-point UTF16 characters (#17520)

This commit is contained in:
Micha Reiser 2025-04-27 11:44:55 +01:00 committed by GitHub
parent 1c65e0ad25
commit 1bdb22c139
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 101 additions and 41 deletions

View file

@ -643,10 +643,9 @@ impl FromStr for OneIndexed {
}
}
#[derive(Default, Copy, Clone, Debug)]
#[derive(Copy, Clone, Debug)]
pub enum PositionEncoding {
/// Character offsets count the number of bytes from the start of the line.
#[default]
Utf8,
/// Character offsets count the number of UTF-16 code units from the start of the line.