Skip to content

Commit

Permalink
chore: use lazydev for neovim cmp
Browse files Browse the repository at this point in the history
  • Loading branch information
BBboy01 committed Jun 5, 2024
1 parent af361f9 commit ff3a56c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 10 deletions.
16 changes: 16 additions & 0 deletions lua/plugins/coding.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
return {
{
'folke/lazydev.nvim',
ft = 'lua', -- only load on lua files
opts = {
library = {
{ path = 'luvit-meta/library', words = { 'vim%.uv' } },
},
},
},

{ 'Bilal2453/luvit-meta', lazy = true }, -- optional `vim.uv` typings

{
'L3MON4D3/LuaSnip',
lazy = true,
Expand Down Expand Up @@ -122,6 +134,10 @@ return {
{ name = 'nvim_lsp_signature_help' },
{ name = 'luasnip' },
{ name = 'path' },
{
name = 'lazydev',
group_index = 0, -- skip loading LuaLS completions
},
}),
formatting = {
format = function(_, item)
Expand Down
24 changes: 14 additions & 10 deletions lua/plugins/lsp/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,16 @@ return {
html = {},
cssls = {},
eslint = {},
stylelint_lsp = {},
stylelint_lsp = {
filetypes = {
'css',
'less',
'scss',
'sugarss',
'vue',
'wxss',
},
},
emmet_language_server = {},
css_variables = {},
bashls = {},
Expand Down Expand Up @@ -127,28 +136,23 @@ return {
},
lua_ls = {
on_init = function(client)
local path = client.workspace_folders[1].name
if not vim.loop.fs_stat(path .. '/lazy-lock.json') then
if not vim.loop.fs_stat(client.workspace_folders[1].name .. '/lazy-lock.json') then
return
end
client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, {
end,
settings = {
Lua = {
runtime = {
version = 'LuaJIT',
path = vim.split(package.path, ';'),
},
workspace = {
checkThirdParty = false,
library = {
vim.env.VIMRUNTIME,
vim.fn.stdpath('data') .. '/lazy',
'${3rd}/luv/library',
'${3rd}/busted/library',
},
},
})
end,
settings = {
Lua = {
format = {
enable = false,
},
Expand Down

0 comments on commit ff3a56c

Please sign in to comment.