Helix
Добавьте в ~/.config/helix/languages.toml:
[language-server.oxl-lsp]
command = "oxl"
args = ["lsp"]
[[language]]
name = "oxl"
scope = "source.oxl"
file-types = ["oxl"]
roots = ["oxl.toml"]
comment-tokens = ["//", "///"]
indent = { tab-width = 2, unit = " " }
language-servers = ["oxl-lsp"]
auto-format = true # форматирует сервер: канонический oxl fmt
[language.debugger]
name = "oxl-dap"
transport = "stdio"
command = "oxl"
args = ["dap"]
[[language.debugger.templates]]
name = "launch"
request = "launch"
completion = [ { name = "package or file", completion = "filename", default = "." } ]
args = { program = "{0}", oxlProfile = "dev" }
[[grammar]]
name = "oxl"
source = { path = "/opt/oxl-1.0.0-beta/share/oxl/tree-sitter-oxl" }Форматирование делает сам сервер (textDocument/formatting возвращает результат oxl fmt), внешний formatter не нужен. Далее:
(cd /opt/oxl-1.0.0-beta/share/oxl/tree-sitter-oxl && npm install && npx tree-sitter generate) # src/parser.c
hx --grammar build # собрать парсер из путей в languages.toml
mkdir -p ~/.config/helix/runtime/queries/oxl
cp /opt/oxl-1.0.0-beta/share/oxl/tree-sitter-oxl/queries/highlights.scm ~/.config/helix/runtime/queries/oxl/
hx --health oxl # покажет сервер, грамматику, запросы и отладчикInlay-подсказки включаются в ~/.config/helix/config.toml: [editor.lsp] display-inlay-hints = true. Отладка: :debug-start
(шаблон launch), точки останова — :debug-breakpoint; см. отладка.