Add auto-completion support for snippet files (#23698)

Release Notes:

- Added auto-completion support for snippet files.


![image](https://github.com/user-attachments/assets/ad165fc7-a6e7-426c-8892-f7004515dfc7)
This commit is contained in:
loczek 2025-01-27 12:32:22 +01:00 committed by GitHub
parent 6e9ea47849
commit 6293b20fd0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 64 additions and 5 deletions

View file

@ -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 }

View file

@ -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,
}
]
}
})