Skip to content

Commit

Permalink
feat: Add tinymist for Typst
Browse files Browse the repository at this point in the history
  • Loading branch information
mityu authored and mattn committed Dec 16, 2024
1 parent 2d396a4 commit cebfa8d
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ You can change the directory to install servers by set `g:lsp_settings_servers_d
| TypeScript | eslint-language-server | Yes | Yes |
| TypeScript | biome | Yes | Yes |
| Typst | typst-lsp | Yes | Yes |
| Typst | tinymist | Yes | Yes |
| Vim | vim-language-server | Yes | Yes |
| Vala | vala-language-server | No | No |
| Verilog | verible-verilog-ls | UNIX Only | Yes |
Expand Down
4 changes: 4 additions & 0 deletions installer/install-tinymist.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@echo off

setlocal
curl -L -o tinymist.exe "https://github.com/Myriad-Dreamin/tinymist/releases/latest/download/tinymist-win32-x64.exe"
29 changes: 29 additions & 0 deletions installer/install-tinymist.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/sh

set -e

os="$(uname -s | tr "[:upper:]" "[:lower:]")"
arch=$(uname -m)

case $arch in
x86_64)
arch="x64"
;;
arm64) ;;
*)
printf "%s doesn't supported by bash installer" "$os"
exit 1
;;
esac

case "${os}" in
darwin) ;;
linux) ;;
*)
echo >&2 "$os is not supported"
exit 1
;;
esac

curl -L -o tinymist "https://github.com/Myriad-Dreamin/tinymist/releases/latest/download/tinymist-${os}-${arch}"
chmod +x tinymist
12 changes: 12 additions & 0 deletions settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -1969,6 +1969,12 @@
"url": "https://github.com/nvarner/typst-lsp",
"description": "Language server for Typst",
"requires": []
},
{
"command": "tinymist",
"url": "https://github.com/Myriad-Dreamin/tinymist",
"description": "An integrated language service for Typst",
"requires": []
}
],
"typst": [
Expand All @@ -1977,6 +1983,12 @@
"url": "https://github.com/nvarner/typst-lsp",
"description": "Language server for Typst",
"requires": []
},
{
"command": "tinymist",
"url": "https://github.com/Myriad-Dreamin/tinymist",
"description": "An integrated language service for Typst",
"requires": []
}
],
"vala": [
Expand Down
14 changes: 14 additions & 0 deletions settings/tinymist.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
augroup vim_lsp_settings_tinymist
au!
LspRegisterServer {
\ 'name': 'tinymist',
\ 'cmd': {server_info->lsp_settings#get('tinymist', 'cmd', [lsp_settings#exec_path('tinymist')]+lsp_settings#get('tinymist', 'args', ['lsp']))},
\ 'root_uri':{server_info->lsp_settings#get('tinymist', 'root_uri', lsp_settings#root_uri('tinymist'))},
\ 'initialization_options': lsp_settings#get('tinymist', 'initialization_options', v:null),
\ 'allowlist': lsp_settings#get('tinymist', 'allowlist', ['typst', 'typ']),
\ 'blocklist': lsp_settings#get('tinymist', 'blocklist', []),
\ 'config': lsp_settings#get('tinymist', 'config', lsp_settings#server_config('tinymist')),
\ 'workspace_config': lsp_settings#get('tinymist', 'workspace_config', {}),
\ 'semantic_highlight': lsp_settings#get('tinymist', 'semantic_highlight', {}),
\ }
augroup END

0 comments on commit cebfa8d

Please sign in to comment.