mirror of
https://github.com/divnix/digga.git
synced 2024-12-25 00:55:08 +03:00
kakoune: add dhall-lsp support
This commit is contained in:
parent
fd3d0abd05
commit
8842ae52a0
@ -11,9 +11,17 @@
|
||||
rustup
|
||||
nix-linter
|
||||
dhall
|
||||
dhall-lsp-server
|
||||
];
|
||||
|
||||
environment.etc = {
|
||||
"xdg/kak-lsp/kak-lsp.toml".text = ''
|
||||
${builtins.readFile "${pkgs.kak-lsp.src}/kak-lsp.toml"}
|
||||
[language.dhall]
|
||||
filetypes = ["dhall"]
|
||||
roots = [".git"]
|
||||
command = "dhall-lsp-server"
|
||||
'';
|
||||
"xdg/kak/kakrc".source = ./kakrc;
|
||||
"xdg/kak/autoload/plugins".source = ./plugins;
|
||||
"xdg/kak/autoload/lint".source = ./lint;
|
||||
|
@ -1,9 +0,0 @@
|
||||
hook -group lint global WinSetOption filetype=dhall %{
|
||||
set buffer lintcmd '/etc/xdg/kak/autoload/lint/dhall.sh $1'
|
||||
lint-enable
|
||||
set buffer formatcmd "dhall format"
|
||||
hook buffer BufWritePre .* %{
|
||||
format
|
||||
lint
|
||||
}
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
#!/usr/bin/env zsh
|
||||
|
||||
dhall lint --inplace $1 2>&1 | < /dev/stdin > /tmp/lint.out
|
||||
if head -2 /tmp/lint.out | grep Error &> /dev/null; then
|
||||
sed -n 4p /tmp/lint.out | tr '\n' ' '
|
||||
sed -n 2p /tmp/lint.out | tr 'E' 'e' | tr '\n' ';' \
|
||||
| sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"
|
||||
|
||||
awk 'NR>7 {printf " %s", $0}' /tmp/lint.out
|
||||
else
|
||||
true
|
||||
fi
|
||||
rm -f /tmp/lint.out
|
@ -1,5 +1,5 @@
|
||||
eval %sh{kak-lsp --kakoune -s $kak_session}
|
||||
hook -group lsp global WinSetOption filetype=(elm|rust|c|cpp|python) %{
|
||||
hook -group lsp global WinSetOption filetype=(elm|rust|c|cpp|python|dhall) %{
|
||||
lsp-auto-hover-enable
|
||||
|
||||
# easily enter lsp mode
|
||||
@ -7,4 +7,8 @@ hook -group lsp global WinSetOption filetype=(elm|rust|c|cpp|python) %{
|
||||
|
||||
set buffer lsp_hover_anchor true
|
||||
set buffer lsp_auto_highlight_references true
|
||||
|
||||
hook buffer BufWritePre .* %{
|
||||
lsp-formatting
|
||||
}
|
||||
}
|
||||
|
3
profiles/develop/kakoune/lsp/dhall.kak
Normal file
3
profiles/develop/kakoune/lsp/dhall.kak
Normal file
@ -0,0 +1,3 @@
|
||||
hook -group lsp global WinSetOption filetype=dhall %{
|
||||
lsp-enable-window
|
||||
}
|
Loading…
Reference in New Issue
Block a user