Skip to content

Commit 82cae9d

Browse files
ichizokmattn
authored andcommitted
Add typos-lsp
1 parent d096b4b commit 82cae9d

File tree

6 files changed

+84
-1
lines changed

6 files changed

+84
-1
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ You can change the directory to install servers by set `g:lsp_settings_servers_d
209209
| YANG | yang-lsp | Yes | Yes |
210210
| ZIG | zls | Yes | Yes |
211211
| \* | efm-langserver | Yes | Yes |
212+
| \* | typos-lsp | Yes | Yes |
212213

213214
## Notes
214215

data/catalog.json

+7-1
Original file line numberDiff line numberDiff line change
@@ -6938,6 +6938,12 @@
69386938
"description": "Tab data for a LinUtil",
69396939
"fileMatch": ["**/*linutil*/**/tab_data.toml"],
69406940
"url": "https://json.schemastore.org/linutil-tab-data.json"
6941+
},
6942+
{
6943+
"name": "typos",
6944+
"description": "typos configuration file",
6945+
"fileMatch": ["typos.toml", "_typos.toml", ".typos.toml"],
6946+
"url": "https://raw.githubusercontent.com/crate-ci/typos/master/config.schema.json"
69416947
}
69426948
]
6943-
}
6949+
}

installer/install-typos-lsp.cmd

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
@echo off
2+
3+
setlocal
4+
for /f "usebackq" %%V in (`curl -Ls -o nul -w "%%{url_effective}" https://github.com/tekumara/typos-lsp/releases/latest`) do set VERSION=%%~nxV
5+
set FILE="typos-lsp-%VERSION%-x86_64-pc-windows-msvc.zip"
6+
curl -L -o %FILE% "https://github.com/tekumara/typos-lsp/releases/latest/download/%FILE%"
7+
call "%~dp0\run_unzip.cmd" %FILE%
8+
move target\x86_64-pc-windows-msvc\release\typos-lsp.exe .
9+
rd /Q /S target
10+
del %FILE%
11+

installer/install-typos-lsp.sh

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
os=$(uname -s | tr "[:upper:]" "[:lower:]")
6+
arch=$(uname -m | tr "[:upper:]" "[:lower:]")
7+
8+
case $os in
9+
linux)
10+
case $(uname -r) in
11+
*-musl)
12+
kernel=musl
13+
;;
14+
*)
15+
kernel=glibc
16+
;;
17+
esac
18+
if [ "$arch" = "x86_64" ]; then
19+
if [ "$kernel" = "musl" ]; then
20+
tuple="x86_64-unknown-linux-musl"
21+
else
22+
tuple="x86_64-unknown-linux-gnu"
23+
fi
24+
else
25+
if [ "$kernel" = "musl" ]; then
26+
tuple="aarch64-unknown-linux-musl"
27+
else
28+
tuple="aarch64-unknown-linux-gnu"
29+
fi
30+
fi
31+
;;
32+
darwin)
33+
if [ "$arch" = "x86_64" ]; then
34+
tuple="x86_64-apple-darwin"
35+
else
36+
tuple="aarch64-apple-darwin"
37+
fi
38+
;;
39+
esac
40+
41+
version=$(basename "$(curl -Ls -o /dev/null -w %\{url_effective\} https://github.com/tekumara/typos-lsp/releases/latest)")
42+
filename="typos-lsp-$version-$tuple.tar.gz"
43+
44+
curl -L "https://github.com/tekumara/typos-lsp/releases/latest/download/$filename" | tar -xvz

settings.json

+7
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@
99
"requires": [
1010
"go"
1111
]
12+
},
13+
{
14+
"command": "typos-lsp",
15+
"description": "typos language server",
16+
"url": "https://github.com/tekumara/typos-lsp",
17+
"disabled": true,
18+
"requires": []
1219
}
1320
],
1421
"apex": [

settings/typos-lsp.vim

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
augroup vim_lsp_settings_typos_lsp
2+
au!
3+
LspRegisterServer {
4+
\ 'name': 'typos-lsp',
5+
\ 'cmd': {server_info->lsp_settings#get('typos-lsp', 'cmd', [lsp_settings#exec_path('typos-lsp')]+lsp_settings#get('typos-lsp', 'args', []))},
6+
\ 'root_uri':{server_info->lsp_settings#get('typos-lsp', 'root_uri', lsp_settings#root_uri('typos-lsp'))},
7+
\ 'initialization_options': lsp_settings#get('typos-lsp', 'initialization_options', v:null),
8+
\ 'allowlist': lsp_settings#get('typos-lsp', 'allowlist', ['*']),
9+
\ 'blocklist': lsp_settings#get('typos-lsp', 'blocklist', []),
10+
\ 'config': lsp_settings#get('typos-lsp', 'config', lsp_settings#server_config('typos-lsp')),
11+
\ 'workspace_config': lsp_settings#get('typos-lsp', 'workspace_config', {}),
12+
\ 'semantic_highlight': lsp_settings#get('typos-lsp', 'semantic_highlight', {}),
13+
\ }
14+
augroup END

0 commit comments

Comments
 (0)