Skip to content

Commit

Permalink
Lua virtual plugin with working lazydev
Browse files Browse the repository at this point in the history
  • Loading branch information
NonlinearFruit committed Dec 31, 2024
1 parent 4a1f5c5 commit 8a6d04f
Showing 1 changed file with 25 additions and 7 deletions.
32 changes: 25 additions & 7 deletions nvim/lua/plugins/lazydev.lua → nvim/lua/plugins/lua.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,37 @@ local function install_lsp_and_dap_if_needed()
end
end

local function configure()
install_lsp_and_dap_if_needed()
local function configure_lsp()
local lsp = require("language-server")
local lsp_config_ok, lsp_config = pcall(require, "lspconfig")
if not lsp_config_ok then
return
end

lsp_config.lua_ls.setup({
on_attach = on_attach,
capabilities = capabilities,
})
end

return {
"folke/lazydev.nvim",
ft = "lua", -- only load on lua files
opts = {
local function configure_lazydev()
require("lazydev").setup({
library = {
-- Load the wezterm types when the `wezterm` module is required
-- Needs `justinsgithub/wezterm-types` to be installed
{ path = "wezterm-types", mods = { "wezterm" } },
},
},
})
end

local function configure()
install_lsp_and_dap_if_needed()
configure_lsp()
configure_lazydev()
end

return {
"folke/lazydev.nvim",
ft = "lua", -- only load on lua files
config = configure,
}

0 comments on commit 8a6d04f

Please sign in to comment.