mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-07-11 15:12:40 +02:00
fix: astronvim - formatting & diagnostic & code actions
This commit is contained in:
@@ -65,6 +65,13 @@ return {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"ThePrimeagen/refactoring.nvim",
|
||||||
|
dependencies = {
|
||||||
|
{"nvim-lua/plenary.nvim"},
|
||||||
|
{"nvim-treesitter/nvim-treesitter"}
|
||||||
|
}
|
||||||
|
},
|
||||||
-- Language Parser for syntax highlighting / indentation / folding / Incremental selection
|
-- Language Parser for syntax highlighting / indentation / folding / Incremental selection
|
||||||
{
|
{
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
@@ -101,6 +108,54 @@ return {
|
|||||||
opts.automatic_installation = false
|
opts.automatic_installation = false
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"jose-elias-alvarez/null-ls.nvim",
|
||||||
|
opts = function(_, opts)
|
||||||
|
local null_ls = require "null-ls"
|
||||||
|
local code_actions = null_ls.builtins.code_actions
|
||||||
|
local diagnostics = null_ls.builtins.diagnostics
|
||||||
|
local formatting = null_ls.builtins.formatting
|
||||||
|
local hover = null_ls.builtins.hover
|
||||||
|
local completion = null_ls.builtins.completion
|
||||||
|
-- https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md
|
||||||
|
if type(opts.sources) == "table" then
|
||||||
|
vim.list_extend(opts.sources, {
|
||||||
|
-- Common Code Actions
|
||||||
|
code_actions.gitsigns,
|
||||||
|
-- common refactoring actions based off the Refactoring book by Martin Fowler
|
||||||
|
code_actions.refactoring,
|
||||||
|
code_actions.gomodifytags, -- Go - modify struct field tags
|
||||||
|
code_actions.impl, -- Go - generate interface method stubs
|
||||||
|
code_actions.shellcheck,
|
||||||
|
code_actions.proselint, -- English prose linter
|
||||||
|
|
||||||
|
-- Completion
|
||||||
|
completion.luasnip,
|
||||||
|
|
||||||
|
-- Diagnostic
|
||||||
|
diagnostics.actionlint, -- GitHub Actions workflow syntax checking
|
||||||
|
diagnostics.buf, -- check text in current buffer
|
||||||
|
diagnostics.checkmake, -- check Makefiles
|
||||||
|
|
||||||
|
-- Formatting
|
||||||
|
formatting.prettier, -- js/ts/vue/css/html/json/... formatter
|
||||||
|
diagnostics.hadolint, -- Dockerfile linter
|
||||||
|
formatting.black, -- Python formatter
|
||||||
|
formatting.ruff, -- extremely fast Python linter
|
||||||
|
formatting.goimports, -- Go formatter
|
||||||
|
formatting.shfmt, -- Shell formatter
|
||||||
|
formatting.rustfmt, -- Rust formatter
|
||||||
|
formatting.taplo, -- TOML formatter
|
||||||
|
formatting.terraform_fmt, -- Terraform formatter
|
||||||
|
formatting.stylua, -- Lua formatter
|
||||||
|
formatting.sqlfluff.with({ -- SQL formatter
|
||||||
|
extra_args = { "--dialect", "postgres" }, -- change to your dialect
|
||||||
|
}),
|
||||||
|
formatting.nginx_beautifier, -- Nginx formatter
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
-- Debugger installationl
|
-- Debugger installationl
|
||||||
{
|
{
|
||||||
"jay-babu/mason-nvim-dap.nvim",
|
"jay-babu/mason-nvim-dap.nvim",
|
||||||
|
|||||||
@@ -83,6 +83,7 @@
|
|||||||
cmake
|
cmake
|
||||||
cmake-language-server
|
cmake-language-server
|
||||||
gnumake
|
gnumake
|
||||||
|
checkmake
|
||||||
gcc # c/c++ compiler, required by nvim-treesitter!
|
gcc # c/c++ compiler, required by nvim-treesitter!
|
||||||
llvmPackages.clang-unwrapped # c/c++ tools with clang-tools such as clangd
|
llvmPackages.clang-unwrapped # c/c++ tools with clang-tools such as clangd
|
||||||
gdb
|
gdb
|
||||||
@@ -111,6 +112,7 @@
|
|||||||
|
|
||||||
#-- golang
|
#-- golang
|
||||||
go
|
go
|
||||||
|
gomodifytags
|
||||||
iferr # generate error handling code for go
|
iferr # generate error handling code for go
|
||||||
impl # generate function implementation for go
|
impl # generate function implementation for go
|
||||||
gotools # contains tools like: godoc, goimports, etc.
|
gotools # contains tools like: godoc, goimports, etc.
|
||||||
@@ -118,10 +120,7 @@
|
|||||||
delve # go debugger
|
delve # go debugger
|
||||||
|
|
||||||
#-- lua
|
#-- lua
|
||||||
luajit
|
|
||||||
stylua
|
stylua
|
||||||
luajitPackages.luarocks
|
|
||||||
luajitPackages.luacheck
|
|
||||||
lua-language-server
|
lua-language-server
|
||||||
|
|
||||||
#-- bash
|
#-- bash
|
||||||
@@ -142,10 +141,15 @@
|
|||||||
terraform-ls
|
terraform-ls
|
||||||
jsonnet
|
jsonnet
|
||||||
jsonnet-language-server
|
jsonnet-language-server
|
||||||
|
hadolint # Dockerfile linter
|
||||||
|
|
||||||
#-- Others
|
#-- Others
|
||||||
taplo # TOML language server / formatter / validator
|
taplo # TOML language server / formatter / validator
|
||||||
nodePackages.yaml-language-server
|
nodePackages.yaml-language-server
|
||||||
|
sqlfluff # SQL linter
|
||||||
|
actionlint # GitHub Actions linter
|
||||||
|
buf # protoc plugin for linting and formatting
|
||||||
|
proselint # English prose linter
|
||||||
|
|
||||||
#-- Misc
|
#-- Misc
|
||||||
tree-sitter # common language parser/highlighter
|
tree-sitter # common language parser/highlighter
|
||||||
|
|||||||
Reference in New Issue
Block a user