neovim configuration using rocks.nvim plugin manager
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: switch neodev to lazydev

+41 -9
+6 -6
lua/core/lsp/init.lua
··· 13 13 mason.setup() 14 14 end 15 15 end 16 - -- do 17 - -- local ok, neodev = pcall(require, "neodev") 18 - -- if ok then 19 - -- neodev.setup() 20 - -- end 21 - -- end 16 + do 17 + local ok, lazydev = pcall(require, "lazydev") 18 + if ok then 19 + lazydev.setup() 20 + end 21 + end 22 22 23 23 vim.api.nvim_create_autocmd("LspAttach", { 24 24 group = vim.api.nvim_create_augroup("UserLspAttach", { clear = false }),
+6 -1
lua/core/lsp/servers.lua
··· 1 + ---@module "lspconfig" 2 + 3 + -- HACK: is `@type lspconfig.options` a thing? 4 + 1 5 ---@diagnostic disable: missing-fields 2 - ---@type lspconfig.options 6 + ---@type table<string, vim.lsp.ClientConfig> 3 7 return { 4 8 clangd = {}, 5 9 cssls = {}, ··· 16 20 }, 17 21 html = {}, 18 22 lua_ls = { 23 + -- on_init = require("utils").lazydev_is_not_working, 19 24 settings = { 20 25 Lua = { 21 26 hint = {
+28
lua/utils/init.lua
··· 24 24 end 25 25 end 26 26 27 + ---@param client vim.lsp.Client 28 + function M.lazydev_is_not_working(client) 29 + local path = vim.tbl_get(client,"workspace_folders", 1, "name") 30 + if not path then 31 + vim.print("no workspace") 32 + return 33 + end 34 + client.settings = vim.tbl_deep_extend('force', client.settings, { 35 + Lua = { 36 + runtime = { 37 + version = 'LuaJIT' 38 + }, 39 + -- Make the server aware of Neovim runtime files 40 + workspace = { 41 + checkThirdParty = false, 42 + library = { 43 + vim.env.VIMRUNTIME 44 + -- Depending on the usage, you might want to add additional paths here. 45 + -- "${3rd}/luv/library" 46 + -- "${3rd}/busted/library", 47 + } 48 + -- or pull in all of 'runtimepath'. NOTE: this is a lot slower 49 + -- library = vim.api.nvim_get_runtime_file("", true) 50 + } 51 + } 52 + }) 53 + end 54 + 27 55 return M
+1 -2
rocks.toml
··· 60 60 harpoon = { git = "ThePrimeagen/harpoon", branch = "harpoon2" } 61 61 # for some plugins that needs legacy api (e.g. nvim-surround) 62 62 nvim-treesitter-textobjects = { dir = "~/repo/nvim-treesitter-textobjects" } 63 - # neodev doesn't work when installed from luarocks 64 - # "neodev.nvim" = { git = "folke/neodev.nvim", rev = "v3.0.0" } 65 63 nvim-lint = "scm" 66 64 tree-sitter-gomod = "scm" 67 65 tree-sitter-dockerfile = "scm" ··· 72 70 tree-sitter-groovy = "scm" 73 71 tree-sitter-ini = "scm" 74 72 tree-sitter-vimdoc = "scm" 73 + "lazydev.nvim" = "1.6.0" 75 74 76 75 [plugins."crates.nvim" ] 77 76 git = "Saecki/crates.nvim"