sumneko_lua.lua 865 B

12345678910111213141516171819202122232425262728293031323334
  1. local opts = {
  2. settings = {
  3. Lua = {
  4. diagnostics = {
  5. globals = { "vim", "lvim" },
  6. },
  7. workspace = {
  8. library = {
  9. [require("lvim.utils").join_paths(get_runtime_dir(), "lvim", "lua")] = true,
  10. },
  11. maxPreload = 100000,
  12. preloadFileSize = 10000,
  13. },
  14. },
  15. },
  16. }
  17. local lua_dev_loaded, lua_dev = pcall(require, "lua-dev")
  18. if not lua_dev_loaded then
  19. return opts
  20. end
  21. local dev_opts = {
  22. library = {
  23. vimruntime = true, -- runtime path
  24. types = true, -- full signature, docs and completion of vim.api, vim.treesitter, vim.lsp and others
  25. -- plugins = true, -- installed opt or start plugins in packpath
  26. -- you can also specify the list of plugins to make available as a workspace library
  27. plugins = { "plenary.nvim" },
  28. },
  29. lspconfig = opts,
  30. }
  31. return lua_dev.setup(dev_opts)