1 1 local want
= require 'bugabinga.std.want' 5 - 'nvim-lsp-installer',
10 -} (
function(zero, null_ls, installer, luadev, rust, navic, lsp_status)
11 - installer.settings {
5 + 'nvim-lsp-installer',
10 +}(
function(zero, null_ls, installer, luadev, rust, navic, lsp_status)
11 + installer.settings {
17 - zero.preset
'recommended' 17 + zero.preset
'recommended' 20 - zero.nvim_workspace {
22 - library = vim.api.nvim_get_runtime_file(
'',
true),
26 - server = zero.build_options(
'rust_analyzer', {}),
20 + zero.nvim_workspace {
22 + library = vim.api.nvim_get_runtime_file(
'',
true),
26 + server = zero.build_options(
'rust_analyzer', {}),
32 - zero.build_options(
'jdtls', {})
32 + zero.build_options(
'jdtls', {})
36 - lspconfig = zero.defaults.nvim_workspace(),
36 + lspconfig = zero.defaults.nvim_workspace(),
40 - zero.setup_nvim_cmp {
42 - autocomplete =
false,
40 + zero.setup_nvim_cmp {
42 + autocomplete =
false,
47 - local auto
= require 'bugabinga.std.auto' 48 - local null_opts
= zero.build_options(
'null-ls', {
49 - on_attach =
function(client)
50 - if client.server_capabilities.documentFormattingProvider
then 51 - auto
'format_buffer_on_write' {
52 - description =
'Format the current buffer before writing.',
53 - events =
'BufWritePre',
54 - pattern =
'<buffer>',
55 - callback =
function(context)
56 - vim.lsp.buf.format()
57 - vim.notify(
'Formatted ' .. context.file)
47 + local auto
= require 'bugabinga.std.auto' 48 + local null_opts
= zero.build_options(
'null-ls', {
49 + on_attach =
function(client)
50 + if client.server_capabilities.documentFormattingProvider
then 51 + auto
'format_buffer_on_write' {
52 + description =
'Format the current buffer before writing.',
53 + events =
'BufWritePre',
54 + pattern =
'<buffer>',
55 + callback =
function(context)
56 + vim.lsp.buf.format()
57 + vim.notify(
'Formatted ' .. context.file)
64 - local formatting
= null_ls.builtins.formatting
65 - local diagnostics
= null_ls.builtins.diagnostics
66 - local code_actions
= null_ls.builtins.code_actions
67 - local hover
= null_ls.builtins.hover
68 - local completion
= null_ls.builtins.completion
64 + local formatting
= null_ls.builtins.formatting
65 + local diagnostics
= null_ls.builtins.diagnostics
66 + local code_actions
= null_ls.builtins.code_actions
67 + local hover
= null_ls.builtins.hover
68 + local completion
= null_ls.builtins.completion
71 - local diagnostics_on_save
= {
method = null_ls.methods.DIAGNOSTICS_ON_SAVE }
73 - on_attach = null_opts.on_attach,
75 - formatting.black.with {
extra_args = {
'--fast' } },
77 - formatting.clang_format,
78 - formatting.codespell,
80 - formatting.protolint,
81 - formatting.shellharden,
71 + local diagnostics_on_save
= {
method = null_ls.methods.DIAGNOSTICS_ON_SAVE }
73 + on_attach = null_opts.on_attach,
75 + formatting.black.with {
extra_args = {
'--fast' } },
77 + formatting.clang_format,
78 + formatting.codespell,
80 + formatting.protolint,
81 + formatting.shellharden,
87 - diagnostics.actionlint.with(diagnostics_on_save),
88 - diagnostics.checkmake.with(diagnostics_on_save),
89 - diagnostics.codespell.with(diagnostics_on_save),
90 - diagnostics.editorconfig_checker.with(diagnostics_on_save).with {
command =
'editorconfig-checker' },
91 - diagnostics.gitlint.with(diagnostics_on_save),
92 - diagnostics.protoc_gen_lint.with(diagnostics_on_save),
93 - diagnostics.protolint.with(diagnostics_on_save),
94 - diagnostics.selene.with(diagnostics_on_save).with {
98 - cwd =
function(parameters)
99 - local project
= require 'bugabinga.std.project' 100 - local root
= project.determine_project_root({
name =
'selene.toml',
weight =
10 }, parameters.root)
101 - return root
or parameters.root
104 - diagnostics.shellcheck.with(diagnostics_on_save),
105 - diagnostics.tidy.with(diagnostics_on_save),
87 + diagnostics.actionlint.with(diagnostics_on_save),
88 + diagnostics.checkmake.with(diagnostics_on_save),
89 + diagnostics.codespell.with(diagnostics_on_save),
90 + diagnostics.editorconfig_checker.with(diagnostics_on_save).with {
command =
'editorconfig-checker' },
91 + diagnostics.gitlint.with(diagnostics_on_save),
92 + diagnostics.protoc_gen_lint.with(diagnostics_on_save),
93 + diagnostics.protolint.with(diagnostics_on_save),
94 + diagnostics.selene.with(diagnostics_on_save).with {
98 + cwd =
function(parameters)
99 + local project
= require 'bugabinga.std.project' 100 + local root
= project.determine_project_root({
name =
'selene.toml',
weight =
10 }, parameters.root)
101 + return root
or parameters.root
104 + diagnostics.shellcheck.with(diagnostics_on_save),
105 + diagnostics.tidy.with(diagnostics_on_save),
107 - code_actions.refactoring,
108 - code_actions.shellcheck,
107 + code_actions.refactoring,
108 + code_actions.shellcheck,
110 - completion.luasnip,
110 + completion.luasnip,
114 - zero.on_attach(
function(client, buffer_number)
115 - if client.name
~= 'null-ls' and not vim.b.lsp_attached
then 116 - navic.attach(client, buffer_number)
117 - lsp_status.on_attach(client, buffer_number)
114 + zero.on_attach(
function(client, buffer_number)
115 + if client.name
~= 'null-ls' and not vim.b.lsp_attached
then 116 + navic.attach(client, buffer_number)
117 + lsp_status.on_attach(client, buffer_number)