Only generate workspace/configuration for relevant adapter
This commit is contained in:
parent
814896de3f
commit
affb73d651
6 changed files with 95 additions and 134 deletions
|
@ -102,7 +102,7 @@ impl LspAdapter for JsonLspAdapter {
|
|||
fn workspace_configuration(
|
||||
&self,
|
||||
cx: &mut AppContext,
|
||||
) -> Option<BoxFuture<'static, serde_json::Value>> {
|
||||
) -> BoxFuture<'static, serde_json::Value> {
|
||||
let action_names = cx.all_action_names().collect::<Vec<_>>();
|
||||
let staff_mode = cx.default_global::<StaffMode>().0;
|
||||
let language_names = &self.languages.language_names();
|
||||
|
@ -113,29 +113,28 @@ impl LspAdapter for JsonLspAdapter {
|
|||
},
|
||||
cx,
|
||||
);
|
||||
Some(
|
||||
future::ready(serde_json::json!({
|
||||
"json": {
|
||||
"format": {
|
||||
"enable": true,
|
||||
|
||||
future::ready(serde_json::json!({
|
||||
"json": {
|
||||
"format": {
|
||||
"enable": true,
|
||||
},
|
||||
"schemas": [
|
||||
{
|
||||
"fileMatch": [
|
||||
schema_file_match(&paths::SETTINGS),
|
||||
&*paths::LOCAL_SETTINGS_RELATIVE_PATH,
|
||||
],
|
||||
"schema": settings_schema,
|
||||
},
|
||||
"schemas": [
|
||||
{
|
||||
"fileMatch": [
|
||||
schema_file_match(&paths::SETTINGS),
|
||||
&*paths::LOCAL_SETTINGS_RELATIVE_PATH,
|
||||
],
|
||||
"schema": settings_schema,
|
||||
},
|
||||
{
|
||||
"fileMatch": [schema_file_match(&paths::KEYMAP)],
|
||||
"schema": KeymapFile::generate_json_schema(&action_names),
|
||||
}
|
||||
]
|
||||
}
|
||||
}))
|
||||
.boxed(),
|
||||
)
|
||||
{
|
||||
"fileMatch": [schema_file_match(&paths::KEYMAP)],
|
||||
"schema": KeymapFile::generate_json_schema(&action_names),
|
||||
}
|
||||
]
|
||||
}
|
||||
}))
|
||||
.boxed()
|
||||
}
|
||||
|
||||
async fn language_ids(&self) -> HashMap<String, String> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue