Merge pull request #226 from zed-industries/1d-block-map
Allow full diagnostic messages to be displayed in the editor
This commit is contained in:
commit
447f710570
28 changed files with 4161 additions and 823 deletions
|
@ -258,15 +258,12 @@ impl DiagnosticMessage {
|
|||
|
||||
fn update(&mut self, editor: ViewHandle<Editor>, cx: &mut ViewContext<Self>) {
|
||||
let editor = editor.read(cx);
|
||||
let cursor_position = editor
|
||||
.selections::<usize>(cx)
|
||||
.max_by_key(|selection| selection.id)
|
||||
.unwrap()
|
||||
.head();
|
||||
let cursor_position = editor.newest_selection(cx).head();
|
||||
let new_diagnostic = editor
|
||||
.buffer()
|
||||
.read(cx)
|
||||
.diagnostics_in_range::<usize, usize>(cursor_position..cursor_position)
|
||||
.filter(|(range, _)| !range.is_empty())
|
||||
.min_by_key(|(range, diagnostic)| (diagnostic.severity, range.len()))
|
||||
.map(|(_, diagnostic)| diagnostic.clone());
|
||||
if new_diagnostic != self.diagnostic {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue