mirror of
https://github.com/xHyroM/zed-discord-presence.git
synced 2024-11-22 06:01:06 +01:00
feat: support more languages
This commit is contained in:
parent
3fe4b20999
commit
18daae3825
2 changed files with 84 additions and 44 deletions
|
@ -8,49 +8,57 @@ repository = "https://git.sr.ht/~hyro/zed-discord-presence"
|
||||||
|
|
||||||
[language_servers.discord_presence]
|
[language_servers.discord_presence]
|
||||||
name = "Discord Presence LSP"
|
name = "Discord Presence LSP"
|
||||||
# Taken from https://github.com/zed-industries/zed/blob/efc2336be5dd352961765398350fc2fe10f15345/extensions/snippets/extension.toml#L11-L15
|
# Generated by scripts/get_languages.sh
|
||||||
languages = [
|
languages = [
|
||||||
"Astro",
|
"Shell Script",
|
||||||
"Clojure",
|
|
||||||
"C",
|
"C",
|
||||||
"C++",
|
"C++",
|
||||||
"C#",
|
"CSS",
|
||||||
"Dart",
|
|
||||||
"Dockerfile",
|
|
||||||
"Elixir",
|
|
||||||
"Elm",
|
|
||||||
"ERB",
|
|
||||||
"Erlang",
|
|
||||||
"Gleam",
|
|
||||||
"GLSL",
|
|
||||||
"Go",
|
"Go",
|
||||||
"Haskell",
|
"Go Mod",
|
||||||
"HCL",
|
"Go Work",
|
||||||
"HEEX",
|
|
||||||
"HTML",
|
|
||||||
"JavaScript",
|
"JavaScript",
|
||||||
"JSDoc",
|
"JSDoc",
|
||||||
"JSON",
|
"JSON",
|
||||||
"Lua",
|
"JSONC",
|
||||||
"Markdown",
|
"Markdown",
|
||||||
|
"proto",
|
||||||
|
"Python",
|
||||||
|
"Regex",
|
||||||
|
"Rust",
|
||||||
|
"TSX",
|
||||||
|
"TypeScript",
|
||||||
|
"YAML",
|
||||||
|
"Astro",
|
||||||
|
"Clojure",
|
||||||
|
"CSharp",
|
||||||
|
"Dart",
|
||||||
|
"Elixir",
|
||||||
|
"HEEX",
|
||||||
|
"Elm",
|
||||||
|
"Erlang",
|
||||||
|
"Gleam",
|
||||||
|
"GLSL",
|
||||||
|
"Haskell",
|
||||||
|
"HTML",
|
||||||
|
"Lua",
|
||||||
|
"OCaml Interface",
|
||||||
"OCaml",
|
"OCaml",
|
||||||
"PHP",
|
"PHP",
|
||||||
"Python",
|
"PHPDoc",
|
||||||
"Prisma",
|
"Prisma",
|
||||||
"PureScript",
|
"PureScript",
|
||||||
"Racket",
|
"Racket",
|
||||||
|
"ERB",
|
||||||
"Ruby",
|
"Ruby",
|
||||||
"Rust",
|
|
||||||
"Scheme",
|
"Scheme",
|
||||||
"Shell Script",
|
|
||||||
"Svelte",
|
"Svelte",
|
||||||
|
"HCL",
|
||||||
|
"Terraform Vars",
|
||||||
"Terraform",
|
"Terraform",
|
||||||
"TOML",
|
"TOML",
|
||||||
"TypeScript",
|
|
||||||
"TSX",
|
|
||||||
"Uiua",
|
"Uiua",
|
||||||
"Vue.js",
|
"Vue.js",
|
||||||
"Zig",
|
"Zig",
|
||||||
"LOG",
|
|
||||||
]
|
]
|
||||||
language_ids = { TypeScript = "typescript", TSX = "typescriptreact", JavaScript = "javascript", "Vue.js" = "vue", Terraform = "terraform", "Terraform Vars" = "terraform-vars", PHP = "php", HTML = "html", CSS = "css", LOG = "log" }
|
language_ids = { "Shell Script" = "bash", "C" = "c", "C++" = "cpp", "CSS" = "css", "Go" = "go", "Go Mod" = "gomod", "Go Work" = "gowork", "JavaScript" = "javascript", "JSDoc" = "jsdoc", "JSON" = "json", "JSONC" = "jsonc", "Markdown" = "markdown", "proto" = "proto", "Python" = "python", "Regex" = "regex", "Rust" = "rust", "TSX" = "tsx", "TypeScript" = "typescript", "YAML" = "yaml", "Astro" = "astro", "Clojure" = "clojure", "CSharp" = "csharp", "Dart" = "dart", "Elixir" = "elixir", "HEEX" = "heex", "Elm" = "elm", "Erlang" = "erlang", "Gleam" = "gleam", "GLSL" = "glsl", "Haskell" = "haskell", "HTML" = "html", "Lua" = "lua", "OCaml Interface" = "ocaml-interface", "OCaml" = "ocaml", "PHP" = "php", "PHPDoc" = "phpdoc", "Prisma" = "prisma", "PureScript" = "purescript", "Racket" = "racket", "ERB" = "erb", "Ruby" = "ruby", "Scheme" = "scheme", "Svelte" = "svelte", "HCL" = "hcl", "Terraform Vars" = "terraform-vars", "Terraform" = "terraform", "TOML" = "toml", "Uiua" = "uiua", "Vue.js" = "vue", "Zig" = "zig"}
|
||||||
|
|
32
scripts/get_languages.sh
Executable file
32
scripts/get_languages.sh
Executable file
|
@ -0,0 +1,32 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
RESPONSE=$(curl -s "https://api.github.com/repos/zed-industries/zed/git/trees/main?recursive=1" -H "Authorization: Bearer ${GITHUB_TOKEN}")
|
||||||
|
FILES=$(echo "$RESPONSE" | jq -c -r '.tree[] | .path')
|
||||||
|
|
||||||
|
LANGUAGES="languages = [\n"
|
||||||
|
LANGUAGE_IDS="language_ids = {"
|
||||||
|
|
||||||
|
for file in $FILES; do
|
||||||
|
if ! [[ $file == crates/languages/src/**/config.toml || $file == extensions/**/languages/**/config.toml ]]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $file == extensions/test-extension/* ]]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
name=$(curl -s "https://raw.githubusercontent.com/zed-industries/zed/main/${file}" | head -n 1 | sed 's/^name = "\(.*\)"$/\1/')
|
||||||
|
id="${file%/config.toml}"
|
||||||
|
id="${id##*/}"
|
||||||
|
|
||||||
|
echo "Adding language $name with id $id"
|
||||||
|
|
||||||
|
LANGUAGES+=" \"$name\",\n"
|
||||||
|
LANGUAGE_IDS+=" \"$name\" = \"$id\","
|
||||||
|
done
|
||||||
|
|
||||||
|
LANGUAGES+="]"
|
||||||
|
LANGUAGE_IDS+="}"
|
||||||
|
|
||||||
|
echo -e $LANGUAGES
|
||||||
|
echo -e $LANGUAGE_IDS
|
Loading…
Reference in a new issue