Get ESLint to launch and provide diagnostics

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
This commit is contained in:
Julia 2023-04-18 10:44:58 -04:00 committed by Max Brunsfeld
parent 6e68ff5a50
commit 2a5c0fa5f8
5 changed files with 82 additions and 14 deletions

View file

@ -2217,6 +2217,7 @@ impl Project {
move |params, mut cx| {
let languages = languages.clone();
async move {
dbg!(&params.items);
let workspace_config =
cx.update(|cx| languages.workspace_configuration(cx)).await;
Ok(params

View file

@ -536,10 +536,15 @@ impl LocalWorktree {
.insert(PathKey(worktree_path.clone()), new_summary);
let diagnostics_by_server_id =
self.diagnostics.entry(worktree_path.clone()).or_default();
let ix = match diagnostics_by_server_id.binary_search_by_key(&server_id, |e| e.0) {
Ok(ix) | Err(ix) => ix,
};
diagnostics_by_server_id[ix] = (server_id, diagnostics);
match diagnostics_by_server_id.binary_search_by_key(&server_id, |e| e.0) {
Ok(ix) => {
diagnostics_by_server_id[ix] = (server_id, diagnostics);
}
Err(ix) => {
diagnostics_by_server_id.insert(ix, (server_id, diagnostics));
}
}
}
let updated = !old_summary.is_empty() || !new_summary.is_empty();