Skip to content

Commit 854c272

Browse files
committed
add systemd-lsp
1 parent 1df01a1 commit 854c272

File tree

4 files changed

+62
-0
lines changed

4 files changed

+62
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ You can change the directory to install servers by set `g:lsp_settings_servers_d
180180
| Svelte | tailwindcss-intellisense | Yes | Yes |
181181
| Svelte | biome | Yes | Yes |
182182
| Swift | sourcekit-lsp | Yes | No |
183+
| systemd | systemd-lsp | UNIX Only | Yes |
183184
| SystemVerilog | verible-verilog-ls | UNIX Only | Yes |
184185
| SystemVerilog | svls | Yes | Yes |
185186
| TeX | texlab | Yes | Yes |

installer/install-systemd-lsp.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
os=$(uname -s | tr "[:upper:]" "[:lower:]")
6+
arch="$(uname -m)"
7+
8+
case $os in
9+
linux)
10+
if [ "$arch" = "x86_64" ]; then
11+
file="systemd-lsp-x86_64-unknown-linux-gnu"
12+
else
13+
echo "unknown architecture: $arch"
14+
exit 1
15+
fi
16+
;;
17+
darwin)
18+
if [ "$arch" = "x86_64" ]; then
19+
file="systemd-lsp-x86_64-apple-darwin"
20+
elif [ "$arch" = "aarch64" ] || [ "$arch" = "arm64" ]; then
21+
file="systemd-lsp-aarch64-apple-darwin"
22+
else
23+
echo "unknown architecture: $arch"
24+
exit 1
25+
fi
26+
;;
27+
*)
28+
echo "unknow platform: $os"
29+
exit 1
30+
;;
31+
esac
32+
33+
curl -L -o "systemd-lsp" "https://github.com/JFryy/systemd-lsp/releases/download/v2025.07.10/$file"
34+
35+
chmod +x systemd-lsp

settings.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1800,6 +1800,14 @@
18001800
}
18011801
}
18021802
],
1803+
"systemd": [
1804+
{
1805+
"command": "systemd-lsp",
1806+
"url": "https://github.com/JFryy/systemd-lsp",
1807+
"description": "a language server implementation for systemd unit files made in rust 🦀",
1808+
"requires": []
1809+
}
1810+
],
18031811
"systemverilog": [
18041812
{
18051813
"command": "verible-verilog-ls",

settings/systemd-lsp.vim

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
augroup vim_lsp_settings_system_lsp
2+
au!
3+
LspRegisterServer {
4+
\ 'name': 'systemd-lsp',
5+
\ 'cmd': {server_info->lsp_settings#get('systemd-lsp', 'cmd', [lsp_settings#exec_path('systemd-lsp')]+lsp_settings#get('systemd-lsp', 'args', []))},
6+
\ 'root_uri':{server_info->lsp_settings#get('systemd-lsp', 'root_uri', lsp_settings#root_uri('systemd-lsp'))},
7+
\ 'initialization_options': lsp_settings#get('systemd-lsp', 'initialization_options', {
8+
\ 'completion': {
9+
\ 'autoimport': { 'enable': v:true },
10+
\ },
11+
\ }),
12+
\ 'allowlist': lsp_settings#get('systemd-lsp', 'allowlist', ['systemd']),
13+
\ 'blocklist': lsp_settings#get('systemd-lsp', 'blocklist', []),
14+
\ 'config': lsp_settings#get('systemd-lsp', 'config', lsp_settings#server_config('systemd-lsp')),
15+
\ 'workspace_config': lsp_settings#get('systemd-lsp', 'workspace_config', {}),
16+
\ 'semantic_highlight': lsp_settings#get('systemd-lsp', 'semantic_highlight', {}),
17+
\ }
18+
augroup END

0 commit comments

Comments
 (0)