-
-
Notifications
You must be signed in to change notification settings - Fork 320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What values for Lua.runtime.path
and Lua.workspace.library
?
#259
Comments
As far as I know, the confiiguration feature is broken in latest Neovim client. You could find the description of settings in wiki: https://github.com/sumneko/lua-language-server/wiki/Setting-without-VSCode Currently, it is not supported to analyze the interface directly from C module |
Where are you getting that idea? Also, the repo is not the client, it's just the default configurations for various servers. Anyway, I have a different set of settings for configuring Neovim, and I do get completion suggestions with those settings, albeit wrong ones. I wanted to figure it out first for a simple use-case (Luarocks packages), then try something more complex (Neovim configuration).
Thank you, but I already know about that page and the schema. I still don't understand what those two settings do, and why we need two of them in the first place. For example, for Here are my second attempt at settings, as evaluated by the client and sent to the server: Lua = {
completion = {
callSnippet = "Both",
},
runtime = {
path = {
"?.lua",
"?/init.lua",
"?/?.lua",
"/home/hiphish/.luarocks/share/lua/5.3/?.lua",
"/home/hiphish/.luarocks/share/lua/5.3/?/init.lua",
"/usr/share/5.3/?.lua",
"/usr/share/lua/5.3/?/init.lua"
},
version = "Lua 5.3",
},
workspace = {
library = {
["/home/hiphish/.luarocks/share/lua/5.3"] = true,
["/usr/share/lua/5.3"] = true,
},
maxPreload = 1000,
preloadFileSize = 1000,
},
} Anything missing? |
|
OK, now I understand it.
Then it appears the feature is not working properly. I have the following file: -- saved as ~/.luarocks/share/lua/5.3/hello.lua
local M = {}
--- Say hello to someone
function M.hello(name)
print('Hello ' .. name)
end
--- Greet a person
function greet(name)
print('Greetings, ' .. name)
end
return M My settings are the same as above. I create a new Lua file and start writing the following: local hello = require'hel If I understand correctly, I should now get auto completion suggestions for The fact that the global is picked up properly means that the settings are getting passed properly to the server. So it looks like a server-side problem to me. The EDIT Forgot the screenshots EDIT2 The completion of |
Maybe it is a bug of the version before refactoring. |
Thanks for your test. |
I have attached the logs:
Makes sense. |
Please manually apply the fix commit to help me test whether the repair is successful. (You can replace these two files directly) The problem is that the client you are using doesn't support dynamic registration completion, and I didn't check the client's capability in the refactoring version. I changed it to static register completion , which will result in setting of |
I just re-built the server completely and BTW, it would really make it much easier to follow the project if your commit messages were in English. Your English is pretty good from what I have seen in this thread, no need to hide it :) |
Does it works in |
Is |
What is the content of |
I'm a little confused. Which functions are broken?
|
By the way, these are my settings: Lua = {
completion = {
callSnippet = "Both",
},
runtime = {
path = {
"/home/hiphish/.luarocks/share/lua/5.3/?.lua",
"/home/hiphish/.luarocks/share/lua/5.3/?/init.lua",
"/home/hiphish/.luarocks/share/lua/5.3/?.lua",
"/home/hiphish/.luarocks/share/lua/5.3/?/init.lua",
"/usr/share/lua/5.3/?.lua",
"/usr/share/lua/5.3/?/init.lua",
"/usr/share/lua/5.3/?.lua",
"/usr/share/lua/5.3/?/init.lua"
},
version = "Lua 5.3",
},
workspace = {
library = {
["/home/hiphish/.luarocks/share/lua/5.3/"] = true,
["/usr/share/lua/5.3/"] = true,
},
maxPreload = 1000,
preloadFileSize = 1000,
}
} |
If it works when |
- final adjustments grsSwap - also added grsSwap abbriviation - some monkey-see-monkey-do configuration - config/nvim/lua/grs/devel/tooling.lua - sumnekop_lua section, based on - LuaLS/lua-language-server#259
Hello, Neovim user here.
I want to set the Lua language server up for various types of projects with different settings. My problem right now is that I don't know what values to set for
Lua.runtime.path
and forLua.workspace.library
.Let's say I want to write a Lua package, and I want to use dependencies from Luarocks. I somehow need to tell the server where to find my installed rocks. Here is what I have (the configuration is in Lua as well):
To my understanding this should be right, but I am not getting any completion suggestions for
require're
(from thelpeg
rock). Similarly, if I havelocal re = require're'
, I don't get completion suggestions forre.
. Do I need to adjust theLua.runtime.path
?Background: I want to get hard-coded settings right first. The next step would be to programmatically generate these settings. Neovim can be configured in Lua, and the built-in LSP client is essentially a Lua library. I can probe the current directory for specific files (like
*.rockspec
orinit.vim
) and generate the appropriate settings on the fly. But to this end I must understand the server settings first.I hope this explanation makes sense and you can help me understand the settings.
PS: The server cannot load definitions from C modules like
lpeg
, right?The text was updated successfully, but these errors were encountered: