Add auto-completion support for snippet files (#23698)
Release Notes: - Added auto-completion support for snippet files. 
This commit is contained in:
parent
6e9ea47849
commit
6293b20fd0
7 changed files with 64 additions and 5 deletions
|
@ -60,6 +60,7 @@ serde.workspace = true
|
|||
serde_json.workspace = true
|
||||
settings.workspace = true
|
||||
smol.workspace = true
|
||||
snippet_provider.workspace = true
|
||||
task.workspace = true
|
||||
toml.workspace = true
|
||||
tree-sitter = { workspace = true, optional = true }
|
||||
|
|
|
@ -85,6 +85,7 @@ impl JsonLspAdapter {
|
|||
cx,
|
||||
);
|
||||
let tasks_schema = task::TaskTemplates::generate_json_schema();
|
||||
let snippets_schema = snippet_provider::format::VSSnippetsFile::generate_json_schema();
|
||||
let tsconfig_schema = serde_json::Value::from_str(TSCONFIG_SCHEMA).unwrap();
|
||||
let package_json_schema = serde_json::Value::from_str(PACKAGE_JSON_SCHEMA).unwrap();
|
||||
|
||||
|
@ -125,8 +126,17 @@ impl JsonLspAdapter {
|
|||
paths::local_tasks_file_relative_path()
|
||||
],
|
||||
"schema": tasks_schema,
|
||||
},
|
||||
{
|
||||
"fileMatch": [
|
||||
schema_file_match(
|
||||
paths::snippets_dir()
|
||||
.join("*.json")
|
||||
.as_path()
|
||||
)
|
||||
],
|
||||
"schema": snippets_schema,
|
||||
}
|
||||
|
||||
]
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue