aboutsummaryrefslogtreecommitdiff
path: root/helix-view
diff options
context:
space:
mode:
Diffstat (limited to 'helix-view')
-rw-r--r--helix-view/src/document.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs
index 2c4b5de9..a2d2af77 100644
--- a/helix-view/src/document.rs
+++ b/helix-view/src/document.rs
@@ -854,9 +854,11 @@ impl Document {
/// `language-server` configuration, or the document language if no
/// `language-id` has been specified.
pub fn language_id(&self) -> Option<&str> {
- self.language_config()
- .and_then(|config| config.language_server.as_ref())
- .and_then(|lsp_config| lsp_config.language_id.as_deref())
+ self.language_config()?
+ .language_server
+ .as_ref()?
+ .language_id
+ .as_deref()
.or_else(|| Some(self.language()?.rsplit_once('.')?.1))
}