Skip to content

Commit b73c1fc

Browse files
committed
add zed client id
1 parent e5990a0 commit b73c1fc

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

crates/emmylua_ls/src/context/client_id.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ pub enum ClientId {
55
VSCode,
66
Intellij,
77
Neovim,
8+
Zed,
89
#[default]
910
Other,
1011
}
@@ -23,6 +24,10 @@ impl ClientId {
2324
matches!(self, ClientId::Neovim)
2425
}
2526

27+
pub fn is_zed(&self) -> bool {
28+
matches!(self, ClientId::Zed)
29+
}
30+
2631
pub fn is_other(&self) -> bool {
2732
matches!(self, ClientId::Other)
2833
}
@@ -35,6 +40,7 @@ pub fn get_client_id(client_info: &Option<ClientInfo>) -> ClientId {
3540
"Neovim" | "coc.nvim" => ClientId::Neovim,
3641
_ if check_vscode(info) => ClientId::VSCode,
3742
_ if check_lsp4ij(info) => ClientId::Intellij,
43+
_ if check_zed(info) => ClientId::Zed,
3844
_ => ClientId::Other,
3945
},
4046
None => ClientId::Other,
@@ -67,3 +73,9 @@ fn check_lsp4ij(client_info: &ClientInfo) -> bool {
6773
|| name.contains("Fleet")
6874
|| name.contains("Android Studio")
6975
}
76+
77+
fn check_zed(client_info: &ClientInfo) -> bool {
78+
let name = &client_info.name;
79+
80+
name.contains("Zed")
81+
}

0 commit comments

Comments
 (0)