Browse Source

chore: sort supported providers alphabetically (#1916)

kylo252 3 years ago
parent
commit
4207e67640

+ 1 - 0
lua/lvim/lsp/null-ls/formatters.lua

@@ -22,6 +22,7 @@ function M.list_available(filetype)
     end
   end
 
+  table.sort(formatters)
   return formatters
 end
 

+ 1 - 1
lua/lvim/lsp/null-ls/linters.lua

@@ -21,7 +21,7 @@ function M.list_available(filetype)
       table.insert(linters, provider.name)
     end
   end
-
+  table.sort(linters)
   return linters
 end
 

+ 14 - 4
utils/installer/config.example.lua

@@ -118,9 +118,13 @@ lvim.builtin.treesitter.highlight.enabled = true
 -- -- set a formatter, this will override the language server formatting capabilities (if it exists)
 -- local formatters = require "lvim.lsp.null-ls.formatters"
 -- formatters.setup {
---   { exe = "black" },
+--   { exe = "black", filetypes = { "python" } },
+--   { exe = "isort", filetypes = { "python" } },
 --   {
 --     exe = "prettier",
+--     ---@usage arguments to pass to the formatter
+--     -- these cannot contain whitespaces, options such as `--line-width 80` become either `{'--line-width', '80'}` or `{'--line-width=80'}`
+--     args = { "--print-with", "100" },
 --     ---@usage specify which filetypes to enable. By default a providers will attach to all the filetypes it supports.
 --     filetypes = { "typescript", "typescriptreact" },
 --   },
@@ -129,11 +133,17 @@ lvim.builtin.treesitter.highlight.enabled = true
 -- -- set additional linters
 -- local linters = require "lvim.lsp.null-ls.linters"
 -- linters.setup {
---   { exe = "black" },
+--   { exe = "flake8", filetypes = { "python" } },
 --   {
---     exe = "eslint_d",
+--     exe = "shellcheck",
+--     ---@usage arguments to pass to the formatter
+--     -- these cannot contain whitespaces, options such as `--line-width 80` become either `{'--line-width', '80'}` or `{'--line-width=80'}`
+--     args = { "--severity", "warning" },
+--   },
+--   {
+--     exe = "codespell",
 --     ---@usage specify which filetypes to enable. By default a providers will attach to all the filetypes it supports.
---     filetypes = { "javascript", "javascriptreact" },
+--     filetypes = { "javascript", "python" },
 --   },
 -- }