refactor(nvim): use lazydev.nvim
instead of neodev
Some checks failed
Check Formatting of Files / Check-Formatting (push) Has been cancelled
Some checks failed
Check Formatting of Files / Check-Formatting (push) Has been cancelled
This commit is contained in:
parent
3428d5891e
commit
8cc2f38ec9
@ -4,6 +4,18 @@ return {
|
||||
"hrsh7th/nvim-cmp",
|
||||
event = { "InsertEnter", "ModeChanged" },
|
||||
dependencies = {
|
||||
{
|
||||
"folke/lazydev.nvim",
|
||||
opts = {
|
||||
library = {
|
||||
"luvit-meta/library",
|
||||
},
|
||||
},
|
||||
dependencies = {
|
||||
{ "Bilal2453/luvit-meta", lazy = true },
|
||||
},
|
||||
ft = "lua",
|
||||
},
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-cmdline",
|
||||
"hrsh7th/cmp-emoji",
|
||||
@ -54,7 +66,6 @@ return {
|
||||
},
|
||||
config = function()
|
||||
local cmp = require("cmp")
|
||||
local types = require("cmp.types")
|
||||
local str = require("cmp.utils.str")
|
||||
local compare = cmp.config.compare
|
||||
local luasnip = require("luasnip")
|
||||
@ -62,7 +73,7 @@ return {
|
||||
-- Load Snippets
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
require("luasnip.loaders.from_lua").load({
|
||||
paths = vim.fn.stdpath("config") .. "/lua/plugins/snippets",
|
||||
paths = { vim.fn.stdpath("config") .. "/lua/plugins/snippets" },
|
||||
})
|
||||
|
||||
local colors_bg_color = vim.api.nvim_get_hl(0, { name = "CmpCustomSelectionColor" }).bg
|
||||
@ -126,6 +137,7 @@ return {
|
||||
sources = sources or {}
|
||||
local default_sources = {
|
||||
{ name = "async_path" },
|
||||
{ name = "lazydev", group_index = 0 },
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip", max_item_count = 5 }, -- For luasnip users.
|
||||
{
|
||||
|
@ -1,7 +1,6 @@
|
||||
local lsp_augroup = vim.api.nvim_create_augroup("lsp_augroup", { clear = true })
|
||||
local function on_attach(client, bufnr)
|
||||
-- Set autocommands conditional on server_capabilities
|
||||
vim.notify("Attached server " .. client.name, "info", {
|
||||
vim.notify("Attached server " .. client.name, vim.log.levels.INFO, {
|
||||
title = "LSP",
|
||||
})
|
||||
|
||||
@ -145,7 +144,6 @@ return {
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
"folke/neodev.nvim",
|
||||
"Decodetalkers/csharpls-extended-lsp.nvim",
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
{
|
||||
@ -247,8 +245,20 @@ return {
|
||||
end,
|
||||
desc = "LSP: Diagnostic Open Float",
|
||||
},
|
||||
{ "[l", vim.diagnostic.goto_prev, desc = "LSP: Diagnostic Previous" },
|
||||
{ "]l", vim.diagnostic.goto_next, desc = "LSP: Diagnostic Next" },
|
||||
{
|
||||
"[l",
|
||||
function()
|
||||
vim.diagnostic.jump({ count = -1 })
|
||||
end,
|
||||
desc = "LSP: Diagnostic Previous",
|
||||
},
|
||||
{
|
||||
"]l",
|
||||
function()
|
||||
vim.diagnostic.jump({ count = 1 })
|
||||
end,
|
||||
desc = "LSP: Diagnostic Next",
|
||||
},
|
||||
{
|
||||
"<leader>lt",
|
||||
function()
|
||||
@ -309,30 +319,6 @@ return {
|
||||
},
|
||||
})
|
||||
|
||||
-- NOTE: LUA LSP
|
||||
require("neodev").setup({
|
||||
override = function(root_dir, options)
|
||||
local cur_file = vim.api.nvim_buf_get_name(vim.api.nvim_get_current_buf())
|
||||
|
||||
if root_dir:find("/tmp", 1, true) == 1 then
|
||||
options.enabled = true
|
||||
options.plugins = true
|
||||
end
|
||||
|
||||
local config_path = vim.fn.stdpath("config")
|
||||
config_path = (config_path and vim.fn.resolve(config_path) or "")
|
||||
if cur_file:find("^" .. vim.pesc(config_path) .. ".*") then
|
||||
options.enabled = true
|
||||
options.plugins = true
|
||||
end
|
||||
|
||||
if cur_file:find("%.nvim%.lua") ~= nil then
|
||||
options.enabled = true
|
||||
options.plugins = true
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
lspconfig.lua_ls.setup({
|
||||
settings = {
|
||||
Lua = {
|
||||
|
Loading…
Reference in New Issue
Block a user