# systemd-language-server
[![PyPI](https://img.shields.io/pypi/v/systemd-language-server)](https://pypi.org/project/systemd-language-server)
[![GitHub Actions (Tests)](https://github.com/psacawa/systemd-language-server/actions/workflows/test.yml/badge.svg)](https://github.com/psacawa/systemd-language-server/actions)
[![GitHub](https://img.shields.io/github/license/psacawa/systemd-language-server)](https://github.com/psacawa/systemd-language-server/blob/master/LICENSE)
Language server for systemd unit files. Result of an exercise to learn the language server protocol.
## Supported Features
### `textDocument/completion`
Completion for
- unit file directives
- unit file sections
<!-- - values of some directives -->
![](assets/completion.gif)
### `textDocument/hover`
Documentation for directives supplied on hovering.
![](assets/hover.gif)
For markup in hover windows (i.e. the fancy highlighting), `pandoc` must be found in `$PATH`. Otherwise, there will be fallback to plain text.
## Installation
```
pip install systemd-language-server
```
## Example Integrations
### coc.nvim
In `coc-settings.json`, under `.languageserver`:
```json
...
"systemd-language-server": {
"command": "systemd-language-server",
"filetypes": ["systemd"]
}
...
```
### nvim-lspconfig
```lua
local lspconfig = require 'lspconfig'
local configs = require 'lspconfig.configs'
if not configs.systemd_ls then
configs.systemd_ls = {
default_config = {
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.
]]
}
}
end
lspconfig.systemd_ls.setup {}
```
Courtesy of @ValdezFOmar
Raw data
{
"_id": null,
"home_page": "https://github.com/psacawa/systemd-language-server",
"name": "systemd-language-server",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.9",
"maintainer_email": null,
"keywords": "systemd, language, server, lsp, completion",
"author": "Pawe\u0142 Sacawa",
"author_email": "pawel@sacawa.net",
"download_url": "https://files.pythonhosted.org/packages/72/38/4526913c9a2b314eec0deea826c0349b8790c6123c387e796c999cf25015/systemd_language_server-0.3.5.tar.gz",
"platform": null,
"description": "# systemd-language-server\n\n[![PyPI](https://img.shields.io/pypi/v/systemd-language-server)](https://pypi.org/project/systemd-language-server)\n[![GitHub Actions (Tests)](https://github.com/psacawa/systemd-language-server/actions/workflows/test.yml/badge.svg)](https://github.com/psacawa/systemd-language-server/actions)\n[![GitHub](https://img.shields.io/github/license/psacawa/systemd-language-server)](https://github.com/psacawa/systemd-language-server/blob/master/LICENSE)\n\nLanguage server for systemd unit files. Result of an exercise to learn the language server protocol.\n\n## Supported Features\n\n### `textDocument/completion`\n\nCompletion for\n\n- unit file directives\n- unit file sections\n<!-- - values of some directives -->\n\n![](assets/completion.gif)\n\n### `textDocument/hover`\n\nDocumentation for directives supplied on hovering.\n\n![](assets/hover.gif)\n\nFor markup in hover windows (i.e. the fancy highlighting), `pandoc` must be found in `$PATH`. Otherwise, there will be fallback to plain text.\n\n## Installation\n\n```\npip install systemd-language-server\n```\n\n## Example Integrations\n\n### coc.nvim\n\nIn `coc-settings.json`, under `.languageserver`:\n\n```json\n...\n\"systemd-language-server\": {\n \"command\": \"systemd-language-server\",\n \"filetypes\": [\"systemd\"]\n}\n...\n```\n\n### nvim-lspconfig\n\n```lua\nlocal lspconfig = require 'lspconfig'\nlocal configs = require 'lspconfig.configs'\n\nif not configs.systemd_ls then\n configs.systemd_ls = {\n default_config = {\n cmd = { 'systemd-language-server' },\n filetypes = { 'systemd' },\n root_dir = function() return nil end,\n single_file_support = true,\n settings = {},\n },\n docs = {\n description = [[\nhttps://github.com/psacawa/systemd-language-server\n\nLanguage Server for Systemd unit files.\n]]\n }\n }\nend\n\nlspconfig.systemd_ls.setup {}\n```\n\nCourtesy of @ValdezFOmar\n",
"bugtrack_url": null,
"license": "GPL3.0",
"summary": "Language server for systemd unit files",
"version": "0.3.5",
"project_urls": {
"Homepage": "https://github.com/psacawa/systemd-language-server",
"Repository": "https://github.com/psacawa/systemd-language-server"
},
"split_keywords": [
"systemd",
" language",
" server",
" lsp",
" completion"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "34c9d5d17c268beb351f3f94b6391ef0f07ca2562ba21043a82236d1b7a86312",
"md5": "19c74a321b585049d91df8fc37024068",
"sha256": "764435c54be8a06329978d0fea03846e3e24d28120ee5bf599c232902f64985c"
},
"downloads": -1,
"filename": "systemd_language_server-0.3.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "19c74a321b585049d91df8fc37024068",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 181080,
"upload_time": "2024-04-14T23:34:09",
"upload_time_iso_8601": "2024-04-14T23:34:09.414081Z",
"url": "https://files.pythonhosted.org/packages/34/c9/d5d17c268beb351f3f94b6391ef0f07ca2562ba21043a82236d1b7a86312/systemd_language_server-0.3.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "72384526913c9a2b314eec0deea826c0349b8790c6123c387e796c999cf25015",
"md5": "a55eebc1da6dde474c9561292a0bef0d",
"sha256": "0fa122be805db8dbf0a86b8618f7237ad5099586dc0b31590e9b708f45860f9c"
},
"downloads": -1,
"filename": "systemd_language_server-0.3.5.tar.gz",
"has_sig": false,
"md5_digest": "a55eebc1da6dde474c9561292a0bef0d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 168812,
"upload_time": "2024-04-14T23:34:10",
"upload_time_iso_8601": "2024-04-14T23:34:10.630329Z",
"url": "https://files.pythonhosted.org/packages/72/38/4526913c9a2b314eec0deea826c0349b8790c6123c387e796c999cf25015/systemd_language_server-0.3.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-14 23:34:10",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "psacawa",
"github_project": "systemd-language-server",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "systemd-language-server"
}