Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Lua Development Tools » ldoc documentation in LDT 1.3.1(How to properly document types consisting our of multiple levels.)
icon5.gif  ldoc documentation in LDT 1.3.1 [message #1727546] Wed, 23 March 2016 16:54 Go to next message
Sven Van de Velde is currently offline Sven Van de VeldeFriend
Messages: 15
Registered: March 2016
Junior Member
Hi,

I have a question how to document in LDT 1.3.1 properly in the code a type structure.

Imagine I have the following structures defined in LUA:

AI = {
skills = {
AVERAGE = 1,
HIGH = 2,
EXCELLENT = 3,
},
Task = {
SHOOT = 1,
EVADE = 2,
RUNAWAY=3,
}
}

Now, when i want to document the above structure in luadoc to make this structure available in code assist, how to i need to do that? I've been trying a lot of things, but just cannot find the right way to get the ldt to show the different options when i type "AI." and the CTRL-SPACE to get the different fields in this structure.

This is one of the constructions i've tried, without success:

--- @type AI
--

--- @type AI.skills
-- @field AVERAGE
-- @field HIGH
-- @field EXCELLENT

--- @type AI.Task
-- @field SHOOT
-- @field EVADE
-- @field RUNAWAY


The above is not working.


Does somebody know the correct construction in luadoc that works in ldt with codeassist?

Sven
Re: ldoc documentation in LDT 1.3.1 [message #1727549 is a reply to message #1727546] Wed, 23 March 2016 17:17 Go to previous messageGo to next message
Simon Bernard is currently offline Simon BernardFriend
Messages: 337
Registered: July 2009
Senior Member
You can do something like this
--- @type AI
AI = {
skills = {
AVERAGE = 1,
HIGH = 2,
EXCELLENT = 3,
},
Task = {
SHOOT = 1,
EVADE = 2,
RUNAWAY=3,
}
}

or just with documentation
--- @type AI
-- @field #Skill skills
-- @field #Task task

--- @type Skill
-- @field AVERAGE
-- @field HIGH
-- @field EXCELLENT

- @type Task
-- @field SHOOT
-- @field EVADE
-- @field RUNAWAY


To test it :
local myai --#AI
Re: ldoc documentation in LDT 1.3.1 [message #1727551 is a reply to message #1727549] Wed, 23 March 2016 17:37 Go to previous messageGo to next message
Sven Van de Velde is currently offline Sven Van de VeldeFriend
Messages: 15
Registered: March 2016
Junior Member
wonderful! thank you very much! I would not have found this without your help!

Just a small comment, wouldn't it be a good idea to consider the ldoc standard to be used in ldt?

Sven
Re: ldoc documentation in LDT 1.3.1 [message #1727599 is a reply to message #1727551] Thu, 24 March 2016 10:35 Go to previous message
Simon Bernard is currently offline Simon BernardFriend
Messages: 337
Registered: July 2009
Senior Member
We try to be as compliant as possible with lua documentation standard (luadoc, ldoc), but we were limited by this language in particular about `typing`.
But I agree in a perfect world, this 3 languages should be unified or at least compliant.
Previous Topic:Short References
Next Topic:Torch - Lua Debugger Error (variable value inspection)
Goto Forum:
  


Current Time: Wed Sep 26 08:24:43 GMT 2018

Powered by FUDForum. Page generated in 0.02130 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top