feat(lsp): implement auto-provisioning for language servers
- Added LSP auto-provisioning functionality to automatically install and connect language servers. - Introduced `shutdown_lsp` method to cleanly shut down LSP servers on application exit. - Enhanced `AppStateRest` to spawn a background thread for provisioning language servers. - Updated `builtin_agents` to include new LSP-related agents. - Modified settings to include options for LSP auto-provisioning and supported languages. - Updated file editing and writing tools to notify LSP servers of changes. - Enhanced LSP tools to support auto-detection of servers based on file extensions. - Added utility functions for managing known file extensions and resolving server names. - Created a new `provisioner` module to handle the provisioning logic for various language servers.
This commit is contained in:
+14
-3
@@ -104,10 +104,21 @@ impl Tool for Edit {
|
||||
} else {
|
||||
content.len() - new_content.len()
|
||||
};
|
||||
if check_matches.is_empty() {
|
||||
Ok(format!("edited {} ({} byte delta)", rel, bytes_diff as isize))
|
||||
// Notify the LSP server of the on-disk change so diagnostics stay fresh.
|
||||
// Never fail the edit because of this — LSP errors are surfaced as a
|
||||
// trailing annotation on the success message instead.
|
||||
let lsp_note = if let Ok(mut lsp) = ctx.lsp_manager.lock() {
|
||||
match lsp.did_change_file(&path) {
|
||||
Ok(()) => String::new(),
|
||||
Err(e) => format!(" (LSP: {})", e),
|
||||
}
|
||||
} else {
|
||||
Ok(format!("edited {} ({} byte delta). Graduated checks matched: {}", rel, bytes_diff as isize, check_matches.join(", ")))
|
||||
String::new()
|
||||
};
|
||||
if check_matches.is_empty() {
|
||||
Ok(format!("edited {} ({} byte delta){}", rel, bytes_diff as isize, lsp_note))
|
||||
} else {
|
||||
Ok(format!("edited {} ({} byte delta). Graduated checks matched: {}{}", rel, bytes_diff as isize, check_matches.join(", "), lsp_note))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user