mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-30 14:17:02 +00:00
Remove unused languages
field on LocalWorktree
This commit is contained in:
parent
9c9a09cccb
commit
e7235a82ec
1 changed files with 0 additions and 10 deletions
|
@ -1002,7 +1002,6 @@ pub struct LocalWorktree {
|
||||||
client: Arc<Client>,
|
client: Arc<Client>,
|
||||||
user_store: ModelHandle<UserStore>,
|
user_store: ModelHandle<UserStore>,
|
||||||
fs: Arc<dyn Fs>,
|
fs: Arc<dyn Fs>,
|
||||||
languages: Vec<Arc<Language>>,
|
|
||||||
language_servers: HashMap<String, Arc<LanguageServer>>,
|
language_servers: HashMap<String, Arc<LanguageServer>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1110,7 +1109,6 @@ impl LocalWorktree {
|
||||||
client,
|
client,
|
||||||
user_store,
|
user_store,
|
||||||
fs,
|
fs,
|
||||||
languages: Default::default(),
|
|
||||||
language_servers: Default::default(),
|
language_servers: Default::default(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1155,19 +1153,11 @@ impl LocalWorktree {
|
||||||
&self.language_registry
|
&self.language_registry
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn languages(&self) -> &[Arc<Language>] {
|
|
||||||
&self.languages
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn register_language(
|
pub fn register_language(
|
||||||
&mut self,
|
&mut self,
|
||||||
language: &Arc<Language>,
|
language: &Arc<Language>,
|
||||||
cx: &mut ModelContext<Worktree>,
|
cx: &mut ModelContext<Worktree>,
|
||||||
) -> Option<Arc<LanguageServer>> {
|
) -> Option<Arc<LanguageServer>> {
|
||||||
if !self.languages.iter().any(|l| Arc::ptr_eq(l, language)) {
|
|
||||||
self.languages.push(language.clone());
|
|
||||||
}
|
|
||||||
|
|
||||||
if let Some(server) = self.language_servers.get(language.name()) {
|
if let Some(server) = self.language_servers.get(language.name()) {
|
||||||
return Some(server.clone());
|
return Some(server.clone());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue