add systemd-lsp

This commit is contained in:
Yasuhiro Matsumoto
2025-07-14 11:33:26 +09:00
committed by mattn
parent 1df01a1160
commit 854c272ce0
4 changed files with 62 additions and 0 deletions

View File

@@ -180,6 +180,7 @@ You can change the directory to install servers by set `g:lsp_settings_servers_d
| Svelte | tailwindcss-intellisense | Yes | Yes |
| Svelte | biome | Yes | Yes |
| Swift | sourcekit-lsp | Yes | No |
| systemd | systemd-lsp | UNIX Only | Yes |
| SystemVerilog | verible-verilog-ls | UNIX Only | Yes |
| SystemVerilog | svls | Yes | Yes |
| TeX | texlab | Yes | Yes |

View File

@@ -0,0 +1,35 @@
#!/bin/sh
set -e
os=$(uname -s | tr "[:upper:]" "[:lower:]")
arch="$(uname -m)"
case $os in
linux)
if [ "$arch" = "x86_64" ]; then
file="systemd-lsp-x86_64-unknown-linux-gnu"
else
echo "unknown architecture: $arch"
exit 1
fi
;;
darwin)
if [ "$arch" = "x86_64" ]; then
file="systemd-lsp-x86_64-apple-darwin"
elif [ "$arch" = "aarch64" ] || [ "$arch" = "arm64" ]; then
file="systemd-lsp-aarch64-apple-darwin"
else
echo "unknown architecture: $arch"
exit 1
fi
;;
*)
echo "unknow platform: $os"
exit 1
;;
esac
curl -L -o "systemd-lsp" "https://github.com/JFryy/systemd-lsp/releases/download/v2025.07.10/$file"
chmod +x systemd-lsp

View File

@@ -1800,6 +1800,14 @@
}
}
],
"systemd": [
{
"command": "systemd-lsp",
"url": "https://github.com/JFryy/systemd-lsp",
"description": "a language server implementation for systemd unit files made in rust 🦀",
"requires": []
}
],
"systemverilog": [
{
"command": "verible-verilog-ls",

18
settings/systemd-lsp.vim Normal file
View File

@@ -0,0 +1,18 @@
augroup vim_lsp_settings_system_lsp
au!
LspRegisterServer {
\ 'name': 'systemd-lsp',
\ 'cmd': {server_info->lsp_settings#get('systemd-lsp', 'cmd', [lsp_settings#exec_path('systemd-lsp')]+lsp_settings#get('systemd-lsp', 'args', []))},
\ 'root_uri':{server_info->lsp_settings#get('systemd-lsp', 'root_uri', lsp_settings#root_uri('systemd-lsp'))},
\ 'initialization_options': lsp_settings#get('systemd-lsp', 'initialization_options', {
\ 'completion': {
\ 'autoimport': { 'enable': v:true },
\ },
\ }),
\ 'allowlist': lsp_settings#get('systemd-lsp', 'allowlist', ['systemd']),
\ 'blocklist': lsp_settings#get('systemd-lsp', 'blocklist', []),
\ 'config': lsp_settings#get('systemd-lsp', 'config', lsp_settings#server_config('systemd-lsp')),
\ 'workspace_config': lsp_settings#get('systemd-lsp', 'workspace_config', {}),
\ 'semantic_highlight': lsp_settings#get('systemd-lsp', 'semantic_highlight', {}),
\ }
augroup END