Attach yamlls to yaml.ansible filetypes & show diagnostic source
similiar to lsp source
This commit is contained in:
parent
ee344af9f5
commit
5d15147130
3 changed files with 110 additions and 102 deletions
|
|
@ -29,7 +29,6 @@ end
|
||||||
|
|
||||||
--enable some language servers with the additional completion capabilities
|
--enable some language servers with the additional completion capabilities
|
||||||
--offered by nvim-cmp
|
--offered by nvim-cmp
|
||||||
-- TODO: use `.join`?
|
|
||||||
local servers = {
|
local servers = {
|
||||||
{% for item in language_servers %}
|
{% for item in language_servers %}
|
||||||
{% if item.auto_setup and not loop.last %}
|
{% if item.auto_setup and not loop.last %}
|
||||||
|
|
@ -61,33 +60,39 @@ local python_root_dir = function(fname)
|
||||||
util.path.dirname(fname)
|
util.path.dirname(fname)
|
||||||
end
|
end
|
||||||
|
|
||||||
nvim_lsp.ruff.setup({
|
nvim_lsp.ruff.setup {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
root_dir = python_root_dir
|
root_dir = python_root_dir
|
||||||
})
|
}
|
||||||
|
|
||||||
|
|
||||||
nvim_lsp.pyright.setup({
|
nvim_lsp.pyright.setup {
|
||||||
settings = {
|
settings = {
|
||||||
pyright = {
|
pyright = {
|
||||||
-- Using Ruff's import organizer
|
-- Using Ruff's import organizer
|
||||||
disableOrganizeImports = true,
|
disableOrganizeImports = true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
}
|
||||||
|
|
||||||
nvim_lsp.html.setup({
|
nvim_lsp.html.setup {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
filetypes = { 'html', 'htmldjango' },
|
filetypes = { 'html', 'htmldjango' },
|
||||||
})
|
}
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
nvim_lsp.yamlls.setup {
|
||||||
|
on_attach = on_attach,
|
||||||
|
capabilities = capabilities,
|
||||||
|
filetypes = { 'yaml', 'yaml.ansible', 'yaml.docker-compose', 'yaml.gitlab' }
|
||||||
|
}
|
||||||
|
|
||||||
local cmp = require('cmp')
|
local cmp = require('cmp')
|
||||||
local luasnip = require('luasnip')
|
local luasnip = require('luasnip')
|
||||||
|
|
||||||
cmp.setup({
|
cmp.setup {
|
||||||
sources = {
|
sources = {
|
||||||
{ name = 'nvim_lsp', },
|
{ name = 'nvim_lsp', },
|
||||||
{ name = 'buffer' },
|
{ name = 'buffer' },
|
||||||
|
|
@ -148,14 +153,15 @@ cmp.setup({
|
||||||
luasnip.lsp_expand(args.body)
|
luasnip.lsp_expand(args.body)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
})
|
}
|
||||||
|
|
||||||
vim.diagnostic.config({
|
vim.diagnostic.config {
|
||||||
float = {
|
float = {
|
||||||
source = 'always',
|
suffix = function(diagnostic)
|
||||||
border = border
|
return (' %s | [%s]'):format(diagnostic.code, diagnostic.source)
|
||||||
|
end
|
||||||
},
|
},
|
||||||
})
|
}
|
||||||
|
|
||||||
local enable_formatting = os.getenv("ENABLE_FORMATTING", False)
|
local enable_formatting = os.getenv("ENABLE_FORMATTING", False)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,86 +20,92 @@ packages:
|
||||||
- uv
|
- uv
|
||||||
|
|
||||||
aur_packages:
|
aur_packages:
|
||||||
- {
|
- url: 'https://aur.archlinux.org/nvm.git'
|
||||||
url: 'https://aur.archlinux.org/nvm.git',
|
name: 'nvm'
|
||||||
name: 'nvm',
|
package_name: 'nvm'
|
||||||
package_name: 'nvm',
|
version: '0.40.0-1'
|
||||||
version: '0.40.0-1',
|
arch: 'any'
|
||||||
arch: 'any',
|
|
||||||
}
|
|
||||||
|
|
||||||
aur_build_dir: '/usr/local/src'
|
aur_build_dir: '/usr/local/src'
|
||||||
python_build_dir: '/usr/local/src'
|
python_build_dir: '/usr/local/src'
|
||||||
python_install_dir: '/opt'
|
python_install_dir: '/opt'
|
||||||
|
|
||||||
language_servers:
|
language_servers:
|
||||||
- {
|
- package: ansible-language-server
|
||||||
package: ansible-language-server,
|
server_name: 'ansiblels'
|
||||||
server_name: 'ansiblels',
|
auto_setup: true
|
||||||
auto_setup: true
|
|
||||||
}
|
- package: typescript-language-server
|
||||||
- {
|
server_name: 'ts_ls'
|
||||||
package: yaml-language-server,
|
auto_setup: true
|
||||||
server_name: 'yamlls',
|
|
||||||
auto_setup: true
|
- package: vscode-json-languageserver
|
||||||
}
|
server_name: 'jsonls'
|
||||||
- {
|
auto_setup: true
|
||||||
package: typescript-language-server,
|
|
||||||
server_name: 'ts_ls',
|
- package: vscode-css-languageserver
|
||||||
auto_setup: true
|
server_name: 'cssls'
|
||||||
}
|
auto_setup: true
|
||||||
- {
|
|
||||||
package: vscode-html-languageserver,
|
- package: bash-language-server
|
||||||
server_name: 'html',
|
server_name: 'bashls'
|
||||||
auto_setup: false
|
auto_setup: true
|
||||||
}
|
|
||||||
- {
|
- package: marksman
|
||||||
package: vscode-json-languageserver,
|
server_name: 'marksman'
|
||||||
server_name: 'jsonls',
|
auto_setup: true
|
||||||
auto_setup: true
|
|
||||||
}
|
- package: esbonio
|
||||||
- {
|
server_name: 'esbonio'
|
||||||
package: vscode-css-languageserver,
|
auto_setup: true
|
||||||
server_name: 'cssls',
|
|
||||||
auto_setup: true
|
- package: lua-language-server
|
||||||
}
|
server_name: 'lua_ls'
|
||||||
- {
|
auto_setup: true
|
||||||
package: bash-language-server,
|
|
||||||
server_name: 'bashls',
|
- package: yaml-language-server
|
||||||
auto_setup: true
|
server_name: 'yamlls'
|
||||||
}
|
auto_setup: false
|
||||||
- {
|
|
||||||
package: lua-language-server,
|
- package: vscode-html-languageserver
|
||||||
server_name: 'lua_ls',
|
server_name: 'html'
|
||||||
auto_setup: true
|
auto_setup: false
|
||||||
}
|
|
||||||
- {
|
- package: ruff-lsp
|
||||||
package: ruff-lsp,
|
server_name: 'ruff'
|
||||||
server_name: 'ruff',
|
auto_setup: false
|
||||||
auto_setup: false
|
|
||||||
}
|
- package: pyright
|
||||||
- {
|
server_name: 'pyright'
|
||||||
package: pyright,
|
auto_setup: false
|
||||||
server_name: 'pyright',
|
|
||||||
auto_setup: false
|
|
||||||
}
|
|
||||||
- {
|
|
||||||
package: marksman,
|
|
||||||
server_name: 'marksman',
|
|
||||||
auto_setup: true
|
|
||||||
}
|
|
||||||
- {
|
|
||||||
package: esbonio,
|
|
||||||
server_name: 'esbonio',
|
|
||||||
auto_setup: true
|
|
||||||
}
|
|
||||||
|
|
||||||
python_download_url: 'https://www.python.org/ftp/python'
|
python_download_url: 'https://www.python.org/ftp/python'
|
||||||
python_versions:
|
python_versions:
|
||||||
- { version: 3.12.9, path: 'python3.12', binary: 'python3.12' }
|
- version: 3.12.9
|
||||||
- { version: 3.11.9, path: 'python3.11', binary: 'python3.11' }
|
path: 'python3.12'
|
||||||
- { version: 3.10.0, path: 'python3.10', binary: 'python3.10' }
|
binary: 'python3.12'
|
||||||
- { version: 3.9.14, path: 'python3.9', binary: 'python3.9' }
|
|
||||||
- { version: 3.8.14, path: 'python3.8', binary: 'python3.8' }
|
- version: 3.11.9
|
||||||
- { version: 3.7.14, path: 'python3.7', binary: 'python3.7' }
|
path: 'python3.11'
|
||||||
- { version: 3.6.15, path: 'python3.6', binary: 'python3.6' }
|
binary: 'python3.11'
|
||||||
|
|
||||||
|
- version: 3.10.0
|
||||||
|
path: 'python3.10'
|
||||||
|
binary: 'python3.10'
|
||||||
|
|
||||||
|
- version: 3.9.14
|
||||||
|
path: 'python3.9'
|
||||||
|
binary: 'python3.9'
|
||||||
|
|
||||||
|
- version: 3.8.14
|
||||||
|
path: 'python3.8'
|
||||||
|
binary: 'python3.8'
|
||||||
|
|
||||||
|
- version: 3.7.14
|
||||||
|
path: 'python3.7'
|
||||||
|
binary: 'python3.7'
|
||||||
|
|
||||||
|
- version: 3.6.15
|
||||||
|
path: 'python3.6'
|
||||||
|
binary: 'python3.6'
|
||||||
|
|
|
||||||
|
|
@ -16,18 +16,14 @@ neovim:
|
||||||
|
|
||||||
# TODO: add lua language server, see https://github.com/LuaLS/lua-language-server?
|
# TODO: add lua language server, see https://github.com/LuaLS/lua-language-server?
|
||||||
language_servers:
|
language_servers:
|
||||||
- {
|
- package: '@ansible/ansible-language-server'
|
||||||
package: '@ansible/ansible-language-server',
|
server_name: 'ansiblels'
|
||||||
server_name: 'ansiblels',
|
auto_setup: true
|
||||||
auto_setup: true
|
|
||||||
}
|
- package: yaml-language-server
|
||||||
- {
|
server_name: 'yamlls'
|
||||||
package: yaml-language-server,
|
auto_setup: false
|
||||||
server_name: 'yamlls',
|
|
||||||
auto_setup: true
|
- package: bash-language-server
|
||||||
}
|
server_name: 'bashls'
|
||||||
- {
|
auto_setup: true
|
||||||
package: bash-language-server,
|
|
||||||
server_name: 'bashls',
|
|
||||||
auto_setup: true
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue