aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src
diff options
context:
space:
mode:
authorBlaž Hrastnik2022-06-06 15:11:08 +0000
committerBlaž Hrastnik2022-06-06 15:23:41 +0000
commit3d9923969afb56be03b87a6a1cc47c486bead66b (patch)
tree18c84246f6e56c51c1a8c046a650f98c513e7d03 /helix-view/src
parentb14c258a2c447b892c89d3e68ef4c9a74effca85 (diff)
minor: Simplify Document.language_id()
Diffstat (limited to 'helix-view/src')
-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))
}