Fix some of the diagnostic tests and make DiagnosticEntry generic

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra 2021-12-09 17:53:08 +01:00
parent 65711b2256
commit 91a7bbbba2
9 changed files with 189 additions and 167 deletions

View file

@ -127,7 +127,7 @@ pub fn serialize_selection_set(set: &SelectionSet) -> proto::SelectionSet {
}
pub fn serialize_diagnostics<'a>(
diagnostics: impl IntoIterator<Item = &'a DiagnosticEntry>,
diagnostics: impl IntoIterator<Item = &'a DiagnosticEntry<Anchor>>,
) -> Vec<proto::Diagnostic> {
diagnostics
.into_iter()
@ -304,7 +304,9 @@ pub fn deserialize_selection_set(set: proto::SelectionSet) -> SelectionSet {
}
}
pub fn deserialize_diagnostics(diagnostics: Vec<proto::Diagnostic>) -> Vec<DiagnosticEntry> {
pub fn deserialize_diagnostics(
diagnostics: Vec<proto::Diagnostic>,
) -> Vec<DiagnosticEntry<Anchor>> {
diagnostics
.into_iter()
.filter_map(|diagnostic| {