Skip to content

add systemd-lsp #811

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
35 changes: 35 additions & 0 deletions installer/install-systemd-lsp.sh
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
18 changes: 18 additions & 0 deletions settings/systemd-lsp.vim
Original file line number Diff line number Diff line change
@@ -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
Loading