Skip to content

Commit

Permalink
nvim: Remove neodev plugin
Browse files Browse the repository at this point in the history
Neovim ships with a suitable Lua LSP configuration (.luarc.json) since
neovim/neovim#24592
  • Loading branch information
antoineco committed Sep 28, 2023
1 parent 2561f6b commit 461194e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 22 deletions.
6 changes: 0 additions & 6 deletions nvim/.luarc.json

This file was deleted.

40 changes: 24 additions & 16 deletions nvim/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,7 @@ require "lazy".setup({
{
"neovim/nvim-lspconfig",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
"mason.nvim", -- mason/bin must be present in PATH for tools to be run
"neodev.nvim" -- injects on_setup hook into lspconfig
},
dependencies = "mason.nvim", -- mason/bin must be present in PATH for tools to be run
config = function()
local capabilities = vim.tbl_deep_extend(
"force",
Expand Down Expand Up @@ -199,7 +196,29 @@ require "lazy".setup({
callSnippet = "Replace" -- snippet support on completion
}
}
}
},
on_init = function(client)
local ws = client.workspace_folders[1].name
if not vim.uv.fs_stat(ws .. "/.luarc.json") and not vim.uv.fs_stat(ws .. "/.luarc.jsonc") then
-- Assume Neovim workspace
client.config.settings = vim.tbl_deep_extend("force", client.config.settings, {
Lua = {
runtime = {
version = "LuaJIT"
},
workspace = {
library = {
vim.env.VIMRUNTIME
}
}
}
})

client.notify("workspace/didChangeConfiguration", {
settings = client.config.settings
})
end
end
}

require "lspconfig".gopls.setup {
Expand All @@ -218,17 +237,6 @@ require "lazy".setup({
end
},

-- auto-configure lua_ls for Neovim config/plugins
{
"folke/neodev.nvim",
opts = {
library = {
plugins = false
},
setup_jsonls = false
}
},

{
"jose-elias-alvarez/null-ls.nvim",
event = { "BufReadPre", "BufNewFile" },
Expand Down

0 comments on commit 461194e

Please sign in to comment.