Closed b0mbie closed 5 months ago
Great PR, thanks for helping out.
I take it from your PR that you tested this configuration locally? Does LuaLS indeed function better with this change?
If so let me know and I'll merge it ASAP 😁
Using
dofile
here does provide path completion.
Unfortunately...
The return type of the call is always
...any
, so I made a very incorrect claim about the language server filling in the type. Sorry.
(I could've sworn I had the type be correct at some point...)
Ah well that's a shame, but a useful contribution nonetheless thanks to helpful path completion. Thanks again!
Hmm oops, I only now noticed the commit is directly to the lua-language-server-addon
branch. That branch is automatically kept up to date by a GitHub workflow. I'll update the main to reflect your changes for you
Closes #32.
Changes
Lua.runtime.special
in the language server addon config to make the functionsinclude
andIncludeCS
be represented by Lua 5.1'sdofile
.This was done because using
require
instead will yield incorrect code completion for the path, as the language server will think you're filling in a require path, which will not work at all.dofile
will offer much better completion for paths, and the language server will be able to correctly identify the return type(s) from the function call.