Hi there,
If I take the following sample from this documentation:
--- A module that allow to manage geometry shapes
-- @module geometry
local M = {}
--- A rectangle
-- @type rectangle
-- @field [parent=#rectangle] #number x horizontal position, 0 by default
-- @field [parent=#rectangle] #number y vertical position, 0 by default
-- @field [parent=#rectangle] #number width, 100 by default
-- @field [parent=#rectangle] #number height, 100 by default
local R = {x=0, y=0, width=100, height=100, }
--- Move the rectangle
-- @function [parent=#rectangle] move
-- @param #rectangle self
-- @param #number x
-- @param #number y
function R.move(self,x,y)
self.x = self.x + x
self.y = self.y + y
end
--- Create a new rectangle
-- @function [parent=#geometry] newRectangle
-- @param #number x
-- @param #number y
-- @param #number width
-- @param #number height
-- @return #rectangle the created rectangle
function M.newRectangle(x,y,width,height)
local newrectangle = {x=x,y=y,width=width,height=height}
-- set to new rectangle the properties of a rectangle
setmetatable(newrectangle, {__index = R})
return newrectangle
end
return M
And I save it as "geometry.lua".
Then in an another lua file I try to use it:
geo=require('geometry');
myRectangle = geo.newRectangle(1,1,1,1); --autocomplete work fine here
myRectangle. --??? autocomplete doesn't work anymore
or
geo=require('geometry');
geo.newRectangle(1,1,1,1). --??? autocomplete doesn't work either
Even in geometry.lua if I use newRectangle, it seem that the autocomplete won't be able to reach the variable and move method.
Alhought,
In the local scope of "geometry.lua"
R.y --autocomplete work fine here
Did I do something wrong?
I use Lua 5.1 with Koneki standalone 1.0