You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically I have two files, lib.lua and main.lua. lib.lua:
locallib= {}
--- This is a function :)functionlib.tst()
print("test")
endreturnlib
In here I get completion and hover Information just fine (using neovim but I also confirmed this in VSCode):
main.lua:
locallib=require("lib")
but I can get no hover Information or completion here:
If I remove the table containing the function and just export the function globally, It works as expected: lib.lua:
--- This is a function :)functiontst()
print("test")
end
main.lua:
require("lib")
tst()
Is it possible to also get completion in the first case? I'm only starting to learn lua, but this seems very doable. I tried messing around with Lua.runtime.path, Lua.workspace.ignoreSubmodules and Lua.workspace.library but sadly to no avail. To my understanding the defaults should do what I want. Especially Lua.runtime.path with a default value of { "?.lua", "?/init.lua", "?/?.lua" } should Include lib.lua in the current directory right? And because it works globally in the second case, I'm confident it is not an issue with my setup.
The text was updated successfully, but these errors were encountered:
after checking the logs, it dawned on me, that ?.lua and ?/?.lua were not in my Lua.runtime.path. Then I remembered, I was using lua-dev to setup my language server for neovim plugin development. And it changes the default of Lua.runtime.path to lua/?.lua and lua/?/init.lua After adding ?.lua and ?/?.lua to my runtime path, it works as expected.
Basically I have two files,
lib.lua
andmain.lua
.lib.lua
:In here I get completion and hover Information just fine (using neovim but I also confirmed this in VSCode):
![grafik](https://user-images.githubusercontent.com/10383737/130099016-e722f1cd-6660-47e1-8652-bd58ef3854b1.png)
main.lua
:but I can get no hover Information or completion here:
![grafik](https://user-images.githubusercontent.com/10383737/130099280-d404b9bd-badf-4970-a5c6-05f7a20f3005.png)
If I remove the table containing the function and just export the function globally, It works as expected:
lib.lua
:main.lua
:Is it possible to also get completion in the first case? I'm only starting to learn lua, but this seems very doable. I tried messing around with
Lua.runtime.path
,Lua.workspace.ignoreSubmodules
andLua.workspace.library
but sadly to no avail. To my understanding the defaults should do what I want. EspeciallyLua.runtime.path
with a default value of{ "?.lua", "?/init.lua", "?/?.lua" }
should Include lib.lua in the current directory right? And because it works globally in the second case, I'm confident it is not an issue with my setup.The text was updated successfully, but these errors were encountered: