-
Notifications
You must be signed in to change notification settings - Fork 13
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
Support for Nvim's runtime #29
Comments
Is there any code bade and relevant configuration available? |
I'm not sure what kind of configuration you need, but you could try this project https://github.com/lewis6991/gitsigns.nvim which is clean in LuaLS and contains a If using LSP through Neovim, you can use:
vim.lsp.config('luals', {
cmd = { 'lua-language-server' },
filetypes = { 'lua' },
root_markers = { '.luarc.json' }
})
vim.lsp.config('emmylua_ls', {
cmd = { 'emmylua_ls' },
filetypes = { 'lua' },
root_markers = { '.luarc.json' }
})
-- Select which to enable
-- vim.lsp.enable('luals')
vim.lsp.enable('emmylua_ls') cd gitsigns.nvim
[create init.lua]
nvim -u init.lua lua/gitsigns.lua If you have Neovim installed, you can get the value
|
I've just tried 0.4.6 and this is still a problem. The |
Note from the log:
So the correct library path is being added. |
From the perspective of code analysis, this is a recursive definition of the vim variable. For Lua, I cannot assume that vim has only this one definition; it might have a real definition elsewhere. Since I cannot analyze the code based on loading order or some assumed sequence (the code is actually analyzed out of order), I should assume that the pattern |
Are you using nvim 0.11 or an older release. The issue appears to be how |
version:
|
I have specifically addressed this part of the inference, and you can either compile it from the source code or wait for my next release. |
I found another problem. After nvim exits, emmy lua_ls is still running. |
Isn't the language server process a child process of nvim? If the parent process exits, shouldn't the child process be terminated directly? Additionally, I have also handled the shutdown message. Let's examine the exchanged protocol with the debug log level enabled. |
I just compiled from source and this is still an issue.
|
Ok I've got it to work now. The problem was due to an extra directory I had that is created to run LuaLS. If you run Side note: even with |
You can recompile from the source code again. Previously, I configured require in strict mode by default, which means it must be calculated from the relevant root directory. |
There are no updates. My latest commit is:
EDIT: I removed |
As mentioned in #28, to load Neovim's runtime into LuaLS, the following is used:
However, since env vars do not work yet, I can use a hardcoded path:
This appears to sort of work, however the main object provided by the Neovim runtime, the
vim
global, isn't being properly loaded.In LuaLS:
However in Emmylua_ls:
It also seems to be stuck diagnosing files:
Not sure if that is related.
The text was updated successfully, but these errors were encountered: