|
|
@ -683,13 +683,12 @@ impl Document {
|
|
|
|
&mut self,
|
|
|
|
&mut self,
|
|
|
|
language_id: &str,
|
|
|
|
language_id: &str,
|
|
|
|
config_loader: Arc<syntax::Loader>,
|
|
|
|
config_loader: Arc<syntax::Loader>,
|
|
|
|
) -> bool {
|
|
|
|
) -> anyhow::Result<()> {
|
|
|
|
let language_config = config_loader.language_config_for_language_id(language_id);
|
|
|
|
let language_config = config_loader
|
|
|
|
if language_config.is_none() {
|
|
|
|
.language_config_for_language_id(language_id)
|
|
|
|
return false;
|
|
|
|
.ok_or_else(|| anyhow!("invalid language id: {}", language_id))?;
|
|
|
|
}
|
|
|
|
self.set_language(Some(language_config), Some(config_loader));
|
|
|
|
self.set_language(language_config, Some(config_loader));
|
|
|
|
Ok(())
|
|
|
|
true
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// Set the LSP.
|
|
|
|
/// Set the LSP.
|
|
|
|