|
|
@ -854,9 +854,11 @@ impl Document {
|
|
|
|
/// `language-server` configuration, or the document language if no
|
|
|
|
/// `language-server` configuration, or the document language if no
|
|
|
|
/// `language-id` has been specified.
|
|
|
|
/// `language-id` has been specified.
|
|
|
|
pub fn language_id(&self) -> Option<&str> {
|
|
|
|
pub fn language_id(&self) -> Option<&str> {
|
|
|
|
self.language_config()
|
|
|
|
self.language_config()?
|
|
|
|
.and_then(|config| config.language_server.as_ref())
|
|
|
|
.language_server
|
|
|
|
.and_then(|lsp_config| lsp_config.language_id.as_deref())
|
|
|
|
.as_ref()?
|
|
|
|
|
|
|
|
.language_id
|
|
|
|
|
|
|
|
.as_deref()
|
|
|
|
.or_else(|| Some(self.language()?.rsplit_once('.')?.1))
|
|
|
|
.or_else(|| Some(self.language()?.rsplit_once('.')?.1))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|