From e7235a82ec4b5adbf4359341f7ce174c836db4cb Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Wed, 19 Jan 2022 17:27:00 +0100 Subject: [PATCH] Remove unused `languages` field on `LocalWorktree` --- crates/project/src/worktree.rs | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/crates/project/src/worktree.rs b/crates/project/src/worktree.rs index ee36d0bcad..cacdd4b1b2 100644 --- a/crates/project/src/worktree.rs +++ b/crates/project/src/worktree.rs @@ -1002,7 +1002,6 @@ pub struct LocalWorktree { client: Arc, user_store: ModelHandle, fs: Arc, - languages: Vec>, language_servers: HashMap>, } @@ -1110,7 +1109,6 @@ impl LocalWorktree { client, user_store, fs, - languages: Default::default(), language_servers: Default::default(), }; @@ -1155,19 +1153,11 @@ impl LocalWorktree { &self.language_registry } - pub fn languages(&self) -> &[Arc] { - &self.languages - } - pub fn register_language( &mut self, language: &Arc, cx: &mut ModelContext, ) -> Option> { - 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()) { return Some(server.clone()); }