LuaLS / lua-language-server

A language server that offers Lua language support - programmed in Lua
https://luals.github.io
MIT License
3.38k stars 319 forks source link

Is it possible to only work with the methods explicitly defined in the LuaLS modules? #2950

Open MillhioreBT opened 1 week ago

MillhioreBT commented 1 week ago

Basically I have some methods defined in my files, but I don't like that it suggests two versions of the same methods, since in my LuaLS ---@meta modules I also have these methods defined, but I want to have everything that is typed outside of my real code.

Does anyone know if this is possible?

CppCXY commented 1 week ago

use ---@meta <modulepath> override real module eg. test.lua

local t = {
    aaa = 123,
    bbb = 456
}

return t

test2.lua

---@meta test

local t = {
    --- 'hhihihi'
    aaa = 123,
    bbb = 123,
}

return t

test3.lua

image