Add language-agnostic snippets (#13253)

Note that right now we can't attach a language server to arbitrary
buffer, which is why I've listed a bunch of languages verbatim.
See
https://github.com/zed-industries/simple-completion-language-server/tree/main
for docs on how to define your snippets. They should be placed in
~/.config/zed/snippets ; `snippets.(toml|json)` file can be used to
define language-agnostic snippets, and any other name (e.g.
`python.toml`) will apply only to buffers of that particular type.

There's https://github.com/rafamadriz/friendly-snippets you can use as a
repository of snippets, for your convenience.

Fixes https://github.com/zed-industries/zed/issues/4611

Release Notes:
- Added support for snippets via simple-completion-language-server
This commit is contained in:
Piotr Osiewicz 2024-06-19 14:03:04 +02:00 committed by GitHub
parent 8c4fb34f6e
commit d665f28671
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 177 additions and 0 deletions

View file

@ -0,0 +1,12 @@
id = "snippets"
name = "Snippets"
description = "Support for language-agnostic snippets, provided by simple-completion-language-server"
version = "0.0.1"
schema_version = 1
authors = []
repository = "https://github.com/zed-extensions/svelte"
[language_servers.snippet-completion-server]
name = "Snippet Completion Server"
languages = ["TypeScript", "TSX", "JavaScript", "JSDoc", "Go", "Markdown", "Rust", "C", "C++", "PHP", "Python", "Ruby", "Shell"]
language_ids = { "TypeScript" = "typescript", "TSX" = "typescriptreact", "JavaScript" = "javascript" }