Add restart-lsp keybinding

This commit is contained in:
Keith Simmons
2022-03-29 17:24:23 -07:00
parent cc9843c90e
commit 6d91fd078c
5 changed files with 88 additions and 3 deletions
+6
View File
@@ -80,6 +80,7 @@ action!(Save);
action!(DebugElements);
action!(ActivatePreviousPane);
action!(ActivateNextPane);
action!(RestartLanguageServer);
pub fn init(client: &Arc<Client>, cx: &mut MutableAppContext) {
pane::init(cx);
@@ -119,6 +120,9 @@ pub fn init(client: &Arc<Client>, cx: &mut MutableAppContext) {
cx.add_action(|workspace: &mut Workspace, _: &ActivateNextPane, cx| {
workspace.activate_next_pane(cx)
});
cx.add_action(|workspace: &mut Workspace, _: &RestartLanguageServer, cx| {
workspace.restart_language_server(cx)
});
cx.add_bindings(vec![
Binding::new("ctrl-alt-cmd-f", FollowNextCollaborator, None),
Binding::new("cmd-s", Save, None),
@@ -1419,6 +1423,8 @@ impl Workspace {
None
}
fn restart_language_server(&mut self, cx: &mut ViewContext<Self>) {}
fn render_connection_status(&self, cx: &mut RenderContext<Self>) -> Option<ElementBox> {
let theme = &cx.global::<Settings>().theme;
match &*self.client.status().borrow() {