How to make it follow require paths?
#843
-
|
I have this Neovim config, and ---@type vim.lsp.Config
return {
cmd = { 'emmylua_ls' },
filetypes = { 'lua' },
root_markers = {
'.luarc.json',
'.luarc.jsonc',
'.stylua.toml',
'stylua.toml',
'selene.toml',
'selene.yml',
'.emmyrc.json',
'.git',
},
workspace_required = false,
---@type lsp.emmylua_ls
settings = {
Lua = {
runtime = {
version = 'LuaJIT',
requirePattern = {
'?.lua',
'?/init.lua',
'lua/init.lua',
'lua/?.lua',
'lua/?/init.lua',
'lua/?/?.lua',
'plugin/?.lua',
'ftplugin/?.lua',
'after/?.lua',
'after/?/?.lua',
'spec/?.lua',
},
frameworkVersions = { 'luv' },
},
diagnostics = {
globals = { 'vim' },
},
strict = {
requirePath = false,
},
workspace = {
library = vim.api.nvim_list_runtime_paths(),
},
},
},
} |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 8 replies
-
|
see the lsp log in $XDG/emmylua_ls/log/<file_path>.log |
Beta Was this translation helpful? Give feedback.
-
|
@CppCXY can you please advice about:
with default (empty) If I set {
"runtime": {
"requirePattern": [
"?.lua",
"?/init.lua",
"lua/init.lua",
"lua/?.lua",
"lua/?/init.lua",
"lua/?/?.lua",
"plugin/?.lua",
"ftplugin/?.lua",
"after/?.lua",
"after/?/?.lua",
"spec/?.lua"
],
},
...
"workspace": {
...
library: [
"~/.local/share/nvim/site/pack/core/opt"
],
...
},
...
}(as topicstarter here did), it stops to blame requires of libraries from installed plugins, but starts to blame files in "?/lua/?.lua",
"?/lua/?/init.lua",to the (also, it is strange, that adding patterns stops it from detecting, and not helps)
|
Beta Was this translation helpful? Give feedback.
-
|
@msva |
Beta Was this translation helpful? Give feedback.
I had my path setup wrong. I needed to wait for my plugin manager to fully setup my lua runtimepath before setting up the LSP.