neovim: Add LanguageTool language server

This commit is contained in:
Simon Bruder 2023-04-18 15:55:03 +02:00
parent 78c2e80868
commit 73c1389435
Signed by: simon
GPG key ID: 8D3C82F9F309F8EC
3 changed files with 47 additions and 0 deletions

View file

@ -11,6 +11,11 @@
}; };
extraConfig = { extraConfig = {
# Make LTeX not check anything below this.
# I often use git commit -v, which adds a full diff that should not be checked.
commit.template = toString (pkgs.writeText "git-commit-template" ''
# LTeX: enabled=false'');
core.quotepath = "off"; core.quotepath = "off";
pull.ff = "only"; pull.ff = "only";
diff = { diff = {

View file

@ -48,6 +48,7 @@ in
gopls gopls
haskell-language-server haskell-language-server
jdt-language-server jdt-language-server
unstable.ltex-ls
rnix-lsp rnix-lsp
rust-analyzer rust-analyzer
(python3.withPackages (ps: with ps; [ (python3.withPackages (ps: with ps; [

View file

@ -290,6 +290,47 @@ lsp.jdtls.setup {
on_attach = on_attach, on_attach = on_attach,
cmd = {'jdt-language-server', '-configuration', '/home/simon/.cache/jdtls/config', '-data', '/home/simon/.cache/jdtls/workspace'}, -- copied from upstream, but changed executable name cmd = {'jdt-language-server', '-configuration', '/home/simon/.cache/jdtls/config', '-data', '/home/simon/.cache/jdtls/workspace'}, -- copied from upstream, but changed executable name
} }
lsp.ltex.setup {
on_attach = on_attach,
settings = {
ltex = {
language = 'en-GB',
languageToolHttpServerUri = 'https://languagetool.sbruder.de/',
},
},
-- both taken from upstream, extended
filetypes = {
'bib',
'gitcommit',
'mail',
'markdown',
'org',
'plaintex',
'rst',
'rnoweb',
'tex',
'pandoc'
},
get_language_id = function(_, filetype)
local language_id_mapping = {
bib = 'bibtex',
gitcommit = 'git-commit',
mail = 'markdown', -- quite wrong, but allows magic commands
pandoc = 'markdown',
plaintex = 'tex',
rnoweb = 'sweave',
rst = 'restructuredtext',
tex = 'latex',
xhtml = 'xhtml',
}
local language_id = language_id_mapping[filetype]
if language_id then
return language_id
else
return filetype
end
end,
}
lsp.pylsp.setup { lsp.pylsp.setup {
on_attach = on_attach, on_attach = on_attach,
} }