nil-ls => none-ls and stuff
This commit is contained in:
@@ -0,0 +1,38 @@
|
|||||||
|
local null_ls = require("null-ls")
|
||||||
|
|
||||||
|
null_ls.setup({
|
||||||
|
sources = {
|
||||||
|
null_ls.builtins.formatting.stylua,
|
||||||
|
null_ls.builtins.completion.spell,
|
||||||
|
-- require("none-ls.diagnostics.eslint"), -- requires none-ls-extras.nvim
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
-- local augroup = vim.api.nvim_create_augroup("NoneLsFormatting", {})
|
||||||
|
--
|
||||||
|
-- local on_attach = function(client, bufnr)
|
||||||
|
-- if client.supports_method("textDocument/formatting") then
|
||||||
|
-- vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
|
||||||
|
-- vim.api.nvim_create_autocmd("BufWritePre", {
|
||||||
|
-- group = augroup,
|
||||||
|
-- buffer = bufnr,
|
||||||
|
-- callback = function()
|
||||||
|
-- vim.lsp.buf.format({ bufnr = bufnr })
|
||||||
|
-- end,
|
||||||
|
-- })
|
||||||
|
-- end
|
||||||
|
-- end
|
||||||
|
--
|
||||||
|
-- local null_ls = require("null-ls")
|
||||||
|
--
|
||||||
|
-- null_ls.setup({
|
||||||
|
-- sources = {
|
||||||
|
-- null_ls.builtins.formatting.stylua,
|
||||||
|
-- null_ls.builtins.formatting.prettierd.with({
|
||||||
|
-- extra_args = { "--no-semi", "--single-quote", "--jsx-single-quote" },
|
||||||
|
-- }),
|
||||||
|
-- null_ls.builtins.diagnostics.mypy.with({ extra_args = { "--ignore-missing-imports" } }),
|
||||||
|
-- },
|
||||||
|
-- on_attach = on_attach,
|
||||||
|
-- })
|
||||||
|
--
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
local null_ls = require "null-ls"
|
|
||||||
|
|
||||||
local b = null_ls.builtins
|
|
||||||
|
|
||||||
local sources = {
|
|
||||||
|
|
||||||
-- webdev stuff
|
|
||||||
b.formatting.deno_fmt, -- choosed deno for ts/js files cuz its very fast!
|
|
||||||
b.formatting.prettier.with { filetypes = { "html", "markdown", "css" } }, -- so prettier works only on these filetypes
|
|
||||||
|
|
||||||
-- Lua
|
|
||||||
b.formatting.stylua,
|
|
||||||
|
|
||||||
-- cpp
|
|
||||||
b.formatting.clang_format,
|
|
||||||
}
|
|
||||||
|
|
||||||
null_ls.setup {
|
|
||||||
debug = true,
|
|
||||||
sources = sources,
|
|
||||||
}
|
|
||||||
+12
-11
@@ -6,16 +6,17 @@ local plugins = {
|
|||||||
-- Override plugin definition options
|
-- Override plugin definition options
|
||||||
|
|
||||||
{
|
{
|
||||||
"neovim/nvim-lspconfig",
|
"nvimtools/none-ls.nvim",
|
||||||
dependencies = {
|
lazy = false,
|
||||||
-- format & linting
|
|
||||||
{
|
|
||||||
"jose-elias-alvarez/null-ls.nvim",
|
|
||||||
config = function()
|
config = function()
|
||||||
require "custom.configs.null-ls"
|
require "custom.configs.none-ls"
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
},
|
|
||||||
|
|
||||||
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
dependencies = "nvimtools/none-ls.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
require "plugins.configs.lspconfig"
|
require "plugins.configs.lspconfig"
|
||||||
require "custom.configs.lspconfig"
|
require "custom.configs.lspconfig"
|
||||||
@@ -40,10 +41,10 @@ local plugins = {
|
|||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
-- {
|
||||||
"nvim-treesitter/nvim-treesitter",
|
-- "nvim-treesitter/nvim-treesitter",
|
||||||
opts = overrides.treesitter,
|
-- opts = overrides.treesitter,
|
||||||
},
|
-- },
|
||||||
|
|
||||||
{
|
{
|
||||||
"nvim-tree/nvim-tree.lua",
|
"nvim-tree/nvim-tree.lua",
|
||||||
|
|||||||
@@ -0,0 +1,67 @@
|
|||||||
|
dofile(vim.g.base46_cache .. "lsp")
|
||||||
|
require "nvchad.lsp"
|
||||||
|
|
||||||
|
local M = {}
|
||||||
|
local utils = require "core.utils"
|
||||||
|
|
||||||
|
-- export on_attach & capabilities for custom lspconfigs
|
||||||
|
|
||||||
|
M.on_attach = function(client, bufnr)
|
||||||
|
client.server_capabilities.documentFormattingProvider = false
|
||||||
|
client.server_capabilities.documentRangeFormattingProvider = false
|
||||||
|
|
||||||
|
utils.load_mappings("lspconfig", { buffer = bufnr })
|
||||||
|
|
||||||
|
if client.server_capabilities.signatureHelpProvider then
|
||||||
|
require("nvchad.signature").setup(client)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- if not utils.load_config().ui.lsp_semantic_tokens and client.supports_method "textDocument/semanticTokens" then
|
||||||
|
-- client.server_capabilities.semanticTokensProvider = nil
|
||||||
|
-- end
|
||||||
|
end
|
||||||
|
|
||||||
|
M.capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||||
|
|
||||||
|
M.capabilities.textDocument.completion.completionItem = {
|
||||||
|
documentationFormat = { "markdown", "plaintext" },
|
||||||
|
snippetSupport = true,
|
||||||
|
preselectSupport = true,
|
||||||
|
insertReplaceSupport = true,
|
||||||
|
labelDetailsSupport = true,
|
||||||
|
deprecatedSupport = true,
|
||||||
|
commitCharactersSupport = true,
|
||||||
|
tagSupport = { valueSet = { 1 } },
|
||||||
|
resolveSupport = {
|
||||||
|
properties = {
|
||||||
|
"documentation",
|
||||||
|
"detail",
|
||||||
|
"additionalTextEdits",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
require("lspconfig").lua_ls.setup {
|
||||||
|
on_attach = M.on_attach,
|
||||||
|
capabilities = M.capabilities,
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
diagnostics = {
|
||||||
|
globals = { "vim" },
|
||||||
|
},
|
||||||
|
workspace = {
|
||||||
|
library = {
|
||||||
|
[vim.fn.expand "$VIMRUNTIME/lua"] = true,
|
||||||
|
[vim.fn.expand "$VIMRUNTIME/lua/vim/lsp"] = true,
|
||||||
|
[vim.fn.stdpath "data" .. "/lazy/ui/nvchad_types"] = true,
|
||||||
|
[vim.fn.stdpath "data" .. "/lazy/lazy.nvim/lua/lazy"] = true,
|
||||||
|
},
|
||||||
|
maxPreload = 100000,
|
||||||
|
preloadFileSize = 10000,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
return M
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
local options = {
|
||||||
|
ensure_installed = { "lua", "elixir" },
|
||||||
|
|
||||||
|
highlight = {
|
||||||
|
enable = true,
|
||||||
|
use_languagetree = true,
|
||||||
|
},
|
||||||
|
|
||||||
|
indent = { enable = true },
|
||||||
|
}
|
||||||
|
|
||||||
|
return options
|
||||||
Reference in New Issue
Block a user