mirror of https://github.com/helix-editor/helix
improve render reading
parent
1e22259fd4
commit
3bff12f995
|
@ -683,6 +683,9 @@ impl Client {
|
||||||
]),
|
]),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
}),
|
}),
|
||||||
|
/*experimental: Some(
|
||||||
|
serde_json::from_str("{\"colorDiagnosticOutput\": true}").unwrap(),
|
||||||
|
),*/
|
||||||
..Default::default()
|
..Default::default()
|
||||||
},
|
},
|
||||||
trace: None,
|
trace: None,
|
||||||
|
|
|
@ -295,26 +295,19 @@ fn diag_picker(
|
||||||
.immediately_show_diagnostic(doc, view.id);
|
.immediately_show_diagnostic(doc, view.id);
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
.with_preview(move |_editor, diag| {
|
.with_preview(move |_editor, diag| match diag.diag.data {
|
||||||
// let a: Option<(PathOrId, Option<(usize, usize)>)> =
|
Some(ref data) => {
|
||||||
// location_to_file_location(&diag.location);
|
if let Some(error_string) = data
|
||||||
// let document = Document::default(editor.config.clone(), editor.syn_loader.clone());
|
.as_object()
|
||||||
// editor.document_by_path(path)
|
.and_then(|object| object.get("rendered"))
|
||||||
match diag.diag.data {
|
.and_then(|rendered| rendered.as_str())
|
||||||
Some(ref data) => Some((
|
{
|
||||||
PathOrId::Document(
|
Some((PathOrId::Document(error_string.to_string()), Some((0, 0))))
|
||||||
data.as_object()
|
} else {
|
||||||
.unwrap()
|
location_to_file_location(&diag.location)
|
||||||
.get("rendered")
|
}
|
||||||
.unwrap()
|
|
||||||
.as_str()
|
|
||||||
.unwrap()
|
|
||||||
.to_string(),
|
|
||||||
),
|
|
||||||
Some((0, 0)),
|
|
||||||
)),
|
|
||||||
None => location_to_file_location(&diag.location),
|
|
||||||
}
|
}
|
||||||
|
None => location_to_file_location(&diag.location),
|
||||||
})
|
})
|
||||||
.truncate_start(false)
|
.truncate_start(false)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue