feat: add typst-lsp

This commit is contained in:
Jose Storopoli
2024-01-05 17:30:01 -03:00
committed by mattn
parent 7035748280
commit b747de0a59
5 changed files with 69 additions and 0 deletions

View File

@@ -179,6 +179,7 @@ You can change the directory to install servers by set `g:lsp_settings_servers_d
| TypeScript | deno | Yes | Yes |
| TypeScript | rome | Yes | Yes |
| TypeScript | eslint-language-server | Yes | Yes |
| Typst | typst-lsp | Yes | Yes |
| Vim | vim-language-server | Yes | Yes |
| Vala | vala-language-server | No | No |
| Veryl | veryl-ls | Yes | Yes |

View File

@@ -0,0 +1,4 @@
@echo off
setlocal
curl -L -o typst-lsp-x86_64-pc-windows-msvc.exe "https://github.com/nvarner/typst-lsp/releases/latest/download/typst-lsp-x86_64-pc-windows-msvc.exe"

34
installer/install-typst-lsp.sh Executable file
View File

@@ -0,0 +1,34 @@
#!/bin/sh
set -e
#set -o pipefail
os="$(uname -s | tr "[:upper:]" "[:lower:]")"
arch=$(uname -m)
case $arch in
x86_64) ;;
arm64)
arch="aarch64"
;;
*)
printf "%s doesn't supported by bash installer" "$os"
exit 1
;;
esac
case "${os}" in
darwin)
url="https://github.com/nvarner/typst-lsp/releases/latest/download/typst-lsp-${arch}-apple-darwin"
;;
linux)
url="https://github.com/nvarner/typst-lsp/releases/latest/download/typst-lsp-${arch}-unknown-linux-gnu"
;;
*)
echo >&2 "$os is not supported"
exit 1
;;
esac
curl -L -o typst-lsp "$url"
chmod +x typst-lsp

View File

@@ -1678,6 +1678,22 @@
"requires": []
}
],
"typ": [
{
"command": "typst-lsp",
"url": "https://github.com/nvarner/typst-lsp",
"description": "Language server for Typst",
"requires": []
},
],
"typst": [
{
"command": "typst-lsp",
"url": "https://github.com/nvarner/typst-lsp",
"description": "Language server for Typst",
"requires": []
},
],
"vala": [
{
"command": "vala-language-server",

14
settings/typst-lsp.vim Normal file
View File

@@ -0,0 +1,14 @@
augroup vim_lsp_settings_typst_lsp
au!
LspRegisterServer {
\ 'name': 'typst-lsp',
\ 'cmd': {server_info->lsp_settings#get('typst-lsp', 'cmd', [lsp_settings#exec_path('typst-lsp')]+lsp_settings#get('typst-lsp', 'args', []))},
\ 'root_uri':{server_info->lsp_settings#get('typst-lsp', 'root_uri', lsp_settings#root_uri('typst-lsp'))},
\ 'initialization_options': lsp_settings#get('typst-lsp', 'initialization_options', v:null),
\ 'allowlist': lsp_settings#get('typst-lsp', 'allowlist', ['typst', 'typ']),
\ 'blocklist': lsp_settings#get('typst-lsp', 'blocklist', []),
\ 'config': lsp_settings#get('typst-lsp', 'config', lsp_settings#server_config('typst-lsp')),
\ 'workspace_config': lsp_settings#get('typst-lsp', 'workspace_config', {}),
\ 'semantic_highlight': lsp_settings#get('typst-lsp', 'semantic_highlight', {}),
\ }
augroup END