Who am I?
Kévin KIN-FOO, working at Sierra Wireless.
Working on LDT since 2009.
The approach
- IDE or Editor
- LDT among IDEs
- What does it offer
IDE or Editor
- I am not entering this debate
- If your read this, you are interested in IDE
- We try to keep it light
- We do not aim convert editor users
LDT among IDEs
- I am not entering this either
- This talk is not about comparison
- It is about explaining how we do things
The real approach
IDE or Editor
- LDT among IDEs
- What does it offer
What does it offer
- Formatting
- Navigation
- Assistance
- Debug
- Eclipse integration
Navigation
- It is possible to navigate in a project more easily
- Local variables declaration
- Functions declaration
- Table fields declaration
Assistance
- Introducing a type system
- Integrating documentation
- Embracing environments
Assistance
Type system
- Why?
- Any example?
- How is it done?
Assistance
Type system
Why?
- It just bootstraps everything
- It enable to focus on valuable completion
- Minimize ackwards proposals
- We like our Lua flexible
- Flexible is hard for IDEs
Assistance
Type system
Any example?
- I have two of them:
- functions
- tables
- Which field is code assistance worthy?
- What is the type or their fields?
Assistance
Type system
Any example?
colorer = function(x)
local t = def(x)
t.color = '#ddd'
return t
end
-- So now, what's a good completion proposal?
local colored = colorer( somevalue )
Assistance
Type system
How is it done?
- Documentation language
- Comment prefixed annotations
- Inference
- Indeed: compatible with all Lua 5.1 interpreters
Assistance
Type system
How it is done: sample
---
-- @type coloredtable
-- @field #string result
--- @return #coloredtable
colorer = function(x)
local t = def(x)
t.color = '#ddd'
return t
end
-- Now we know
local colored = colorer( somevalue )
Assistance
Type system
How is it done: another sample
---
-- @type coloredtable
-- @field #string result
colorer = function(x)
local t = def(x)
t.color = '#ddd'
return t
end
local colored = colorer( somevalue ) -- #coloredtable
Assistance
Type system
Integrating documentation
- Describes your code
- In a way both humans and computers can understand
- Can describe:
- Modules
- Libraries
- Environments
Assistance
Type system
Integrating documentation
Environments?
- We came with the concept of Execution Environment (EE)
- It is the description of your application runtime
- Convenient for:
- Third party: No need to deliver source code
- Frameworks: Explain how and why of some specifics
- C: When commented right, you have completion on it
Assistance
Type system
Integrating documentation
It is open
- LuaDocumentor, our documentation generator is
- A single project
- Available from command line
- You can write your own EE
- You can attach it to your project
Debug
- Available out of the box
- Configurable
Debug
- Demo
- Out of the box
- Formatter
- Locals & globals
- LuaJIT
Eclipse integration
You can benefit from many Eclipse projects form LDT:
Would you use LDT?
Questions?