From 8ac5ba28627c9015e8cf7be6b5fc2b0d19067991 Mon Sep 17 00:00:00 2001 From: Ray Jameson <67468725+RayJameson@users.noreply.github.com> Date: Sat, 12 Oct 2024 04:44:18 +0500 Subject: [PATCH] feat(lsp): added config for `systemd-language-server` https://github.com/psacawa/systemd-language-server --- lua/plugins/lsp/config/systemd.lua | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 lua/plugins/lsp/config/systemd.lua diff --git a/lua/plugins/lsp/config/systemd.lua b/lua/plugins/lsp/config/systemd.lua new file mode 100644 index 0000000..3ba15ca --- /dev/null +++ b/lua/plugins/lsp/config/systemd.lua @@ -0,0 +1,28 @@ +---@type LazySpec +return { + "AstroNvim/astrolsp", + cond = vim.fn.executable("systemd-language-server") == 1, + ---@param opts AstroLSPOpts + opts = function(_, opts) + opts.servers = opts.servers or {} + table.insert(opts.servers, "systemd_ls") + opts.config = require("astrocore").extend_tbl(opts.config or {}, { + systemd_ls = { + cmd = { "systemd-language-server" }, + filetypes = { "systemd" }, + root_dir = function() return nil end, + single_file_support = true, + settings = {}, + docs = { + description = [[ +https://github.com/psacawa/systemd-language-server +Language Server for Systemd unit files. + +I tested it with python 3.10.15 +3.12.7 didn't work +]], + }, + }, + }) + end, +}