Provide JSON language server with settings schema

This commit is contained in:
Max Brunsfeld 2022-03-11 11:46:22 -08:00
parent 862ec01e7d
commit 7a68b2d371
5 changed files with 69 additions and 5 deletions

View file

@ -530,6 +530,17 @@ impl LspAdapter for JsonLspAdapter {
"provideFormatter": true
}))
}
fn register_handlers(&self, lsp: &mut lsp::LanguageServer) {
lsp.on_custom_request::<Vec<String>, Option<String>, _>("vscode/content", |schema| {
if schema.get(0).map(String::as_str) == Some("zed://settings") {
Ok(Some(workspace::Settings::file_json_schema()))
} else {
Ok(None)
}
})
.detach();
}
}
pub fn build_language_registry(login_shell_env_loaded: Task<()>) -> LanguageRegistry {