4502: Mark fixes from diagnostics as quick fixes r=kjeremy a=kjeremy

Populates the diagnostic UI with fixes:

Before: 
![quickfix-before](https://user-images.githubusercontent.com/4325700/82165183-0e38df00-9882-11ea-96cf-7dab5faec4d4.PNG)

After:
![image](https://user-images.githubusercontent.com/4325700/82165193-1a24a100-9882-11ea-97d7-be1b64b135e0.png)


Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
This commit is contained in:
bors[bot] 2020-06-03 13:39:30 +00:00 committed by GitHub
commit a33cfcb55d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View File

@ -730,8 +730,13 @@ pub fn handle_code_action(
for fix in fixes_from_diagnostics {
let title = fix.label;
let edit = to_proto::snippet_workspace_edit(&snap, fix.source_change)?;
let action =
lsp_ext::CodeAction { title, group: None, kind: None, edit: Some(edit), command: None };
let action = lsp_ext::CodeAction {
title,
group: None,
kind: Some(lsp_types::code_action_kind::QUICKFIX.into()),
edit: Some(edit),
command: None,
};
res.push(action);
}

View File

@ -298,6 +298,7 @@ fn main() {}
}
]
},
"kind": "quickfix",
"title": "Create module"
}]),
);
@ -368,6 +369,7 @@ fn main() {{}}
}
]
},
"kind": "quickfix",
"title": "Create module"
}]),
);