fix lifetime length are not added in count of params in highlight

This commit is contained in:
dfireBird 2024-03-27 23:00:08 +05:30
parent 4b33850c39
commit 20b12c2bac
No known key found for this signature in database
GPG key ID: 26D522CA5FC2B93D
2 changed files with 21 additions and 2 deletions

View file

@ -1229,3 +1229,20 @@ fn benchmark_syntax_highlighting_parser() {
};
assert_eq!(hash, 1169);
}
#[test]
fn highlight_trait_with_lifetimes_regression_16958() {
let (analysis, file_id) = fixture::file(
r#"
pub trait Deserialize<'de> {
fn deserialize();
}
fn f<'de, T: Deserialize<'de>>() {
T::deserialize();
}
"#
.trim(),
);
let _ = analysis.highlight(HL_CONFIG, file_id).unwrap();
}