Dear developers, I've read similar existing issues but didn't find the answer.
I have a library (which I am the developer of) which has this structure:
and init.lua is
local UI = (...) .. '.'
return {
Block = require(UI .. 'Block'),
Image = require(UI .. 'Image'),
Label = require(UI .. 'Label'),
Layout = require(UI .. 'Layout'),
Rectangle = require(UI .. 'Rectangle'),
Stack = require(UI .. 'Stack'),
ImageButton = require(UI .. 'ImageButton'),
TextField = require(UI .. 'TextField'),
utils = require(UI .. 'utils')
}
and the rockspec contains this:
build = {
type = 'builtin',
modules = {
['likelihud'] = 'likelihud/init.lua',
['likelihud.Block'] = 'likelihud/Block.lua',
['likelihud.Image'] = 'likelihud/Image.lua',
['likelihud.Label'] = 'likelihud/Label.lua',
['likelihud.Layout'] = 'likelihud/Layout.lua',
['likelihud.Rectangle'] = 'likelihud/Rectangle.lua',
['likelihud.Stack'] = 'likelihud/Stack.lua',
['likelihud.ImageButton'] = 'likelihud/ImageButton.lua',
['likelihud.TextField'] = 'likelihud/TextField.lua',
['likelihud.utils'] = 'likelihud/utils.lua',
},
}
So after install I have
Coc-config:
{
"suggest.noselect": true,
"Lua.workspace.library" : [
"/usr/local/share/lua/5.1"
]
}
The problem
If I write
local Button = require('likelihud.ImageButton')
I get autocomplete for Button.
But if instead I do
local ui = require('likelihud')
I get only those fields when I do ui., but the fields are unknown. :
So the problem LSP doesn't resolve this (...) .. '.' inside init.lua. Should I somehow change how init.lua provides those files or how to fix that ?
Dear developers, I've read similar existing issues but didn't find the answer.
I have a library (which I am the developer of) which has this structure:
and
init.luaisand the rockspec contains this:
So after install I have
Coc-config:
{ "suggest.noselect": true, "Lua.workspace.library" : [ "/usr/local/share/lua/5.1" ] }The problem
If I write
I get autocomplete for
Button.But if instead I do
I get only those fields when I do
ui., but the fields are unknown. :So the problem LSP doesn't resolve this
(...) .. '.'insideinit.lua. Should I somehow change howinit.luaprovides those files or how to fix that ?