angle brackets

This commit is contained in:
Jana Dönszelmann 2026-04-02 10:40:13 +02:00
parent 049132b6ee
commit 43e40b61e3
No known key found for this signature in database
3 changed files with 30 additions and 6 deletions

View file

@ -225,7 +225,17 @@ mod private {
match prefix {
Some((Atom::Text(text), space)) => {
cx.push(text, SpanKind::Constructor);
cx.push(
text,
match delimiter {
Delimiter::Bracket => SpanKind::Constructor,
Delimiter::Paren if space.0.is_empty() => SpanKind::Constructor,
Delimiter::Paren => SpanKind::Text,
Delimiter::Brace => SpanKind::Text,
Delimiter::Angle if space.0.is_empty() => SpanKind::Constructor,
Delimiter::Angle => SpanKind::Text,
},
);
space.into_spans(cx);
}
None => {}
@ -741,7 +751,13 @@ mod tests {
),
),
(
"<u32",
"<",
Delimiter(
0,
),
),
(
"u32",
Text,
),
(
@ -761,9 +777,15 @@ mod tests {
),
),
(
"Trait>",
"Trait",
Text,
),
(
">",
Delimiter(
0,
),
),
(
" ",
Space(