This commit is contained in:
blindfs 2025-04-08 20:06:04 +08:00
parent 3932d24204
commit 636ead93a4

View File

@ -353,12 +353,11 @@ impl LanguageServer {
.take_while(|c| *c == &b'-') .take_while(|c| *c == &b'-')
.count(); .count();
let start = decl_span.start + leading_dashes; let start = decl_span.start + leading_dashes;
return content return content.get(leading_dashes..).and_then(|name| {
.get(leading_dashes..) name.starts_with(name_ref.as_bytes()).then_some(Span {
.is_some_and(|name| name.starts_with(name_ref.as_bytes()))
.then_some(Span {
start, start,
end: start + sample_span.end - sample_span.start, end: start + sample_span.end - sample_span.start,
})
}); });
} }
} }