This repository was archived by the owner on Apr 16, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed
lua/doom/modules/features/linter Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,9 @@ local linter = {}
22
33linter .settings = {
44 format_on_save = false ,
5+ null_ls_settings = {
6+ default_timeout = 2000 ,
7+ }
58}
69
710linter .packages = {
@@ -16,11 +19,11 @@ linter.configs = {}
1619linter .configs [" null-ls.nvim" ] = function ()
1720 local null_ls = require (" null-ls" )
1821
19- null_ls .setup ({
22+ local null_ls_settings = doom .features .linter .settings .null_ls_settings
23+ null_ls .setup (vim .tbl_deep_extend (" force" , null_ls_settings , {
2024 on_attach = function (client )
21- if
22- client .server_capabilities .documentFormattingProvider
23- and doom .features .linter .settings .format_on_save
25+ if client .server_capabilities .documentFormattingProvider
26+ and doom .features .linter .settings .format_on_save
2427 then
2528 vim .cmd ([[
2629 augroup LspFormatting
@@ -30,17 +33,20 @@ linter.configs["null-ls.nvim"] = function()
3033 ]] )
3134 end
3235 end ,
33- })
36+ }))
3437end
3538
3639linter .binds = {
3740 {
3841 " <leader>cf" ,
3942 function ()
43+ local null_ls_settings = doom .features .linter .settings .null_ls_settings
4044 if type (vim .lsp .buf .format ) == " function" then
41- vim .lsp .buf .format ()
45+ vim .lsp .buf .format ({
46+ timeout_ms = null_ls_settings .default_timeout
47+ })
4248 else
43- vim .lsp .buf .formatting_sync ()
49+ vim .lsp .buf .formatting_sync (nil , null_ls_settings . default_timeout )
4450 end
4551 end ,
4652 name = " Format/Fix" ,
You can’t perform that action at this time.
0 commit comments