Quantcast Eclipse LDT autocompletion - ESOUI
Thread Tools Display Modes
07/11/18, 12:15 PM   #1
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,140
Eclipse LDT autocompletion

I finally have my autocompletion for Eclipse LDT at a point where I feel I can share it with everyone. You can find it here.
__________________
>siri.exe MyAddon
Does your addon work? [y/n] n
There is a typo in there.
  Reply With Quote
11/04/18, 06:40 AM   #2
cloudor
 
cloudor's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 10
I did some hack work on LDT and made it to support some more features.

Inline comment function definition:



Type reference through pairs and ipairs:



Dots support:

  Reply With Quote
11/04/18, 07:44 AM   #3
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,140
That looks interesting. Any plans for releasing it?
And one tiny suggestion. LDT already has a documentation language. Maybe you could use that instead of inventing a new one?
__________________
>siri.exe MyAddon
Does your addon work? [y/n] n
There is a typo in there.
  Reply With Quote
11/04/18, 08:21 AM   #4
cloudor
 
cloudor's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 10
Yes, I have been using LDT's lua doc all along, but it has many limitations. For example, there is no way to define a parameter also as a function and auto-complete it in body block, like a lamda parameter. In the following example, I can use the parameter named stringProvider to create a string.



or define the result as a function too:


Last edited by cloudor : 11/04/18 at 09:20 AM.
  Reply With Quote
11/04/18, 09:33 AM   #5
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,140
Well. As far as I have tried it, the current auto completion doesn't really work anyways, aside from the EE I put together, so anything is better than what LDT currently offers.
But what I meant is couldn't you reuse the syntax like this:
Lua Code:
  1. --- @function StringProvider
  2. --- @return #string
  3. local function MyStringProvider()
  4.     return ""
  5. end
  6.  
  7. --- @param #StringProvider
  8. local f = function(stringProvider)
  9.     --- @param #number
  10.     --- @return #boolean
  11.     return function(n)
  12.         local s = stringProvider()
  13.         return n == s:l
  14.     end
  15. end
__________________
>siri.exe MyAddon
Does your addon work? [y/n] n
There is a typo in there.

Last edited by sirinsidiator : 11/04/18 at 09:39 AM.
  Reply With Quote
11/04/18, 09:51 AM   #6
cloudor
 
cloudor's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 10
By default luadoc convention, function definitions can not be used as type directly, you need to link them by callof annotation.

Lua Code:
  1. ---
  2.     [email protected] StringProvider
  3.    
  4.     ---
  5.     -- @callof #StringProvider
  6.     -- @return #string
  7.     local function MyStringProvider()
  8.         return ""
  9.     end
  10.  
  11.     --- @param #StringProvider stringProvider
  12.     local f = function(stringProvider)
  13.         return function(n)
  14.             local s = stringProvider()
  15.             return n == s:l
  16.         end
  17.     end

Last edited by cloudor : 11/04/18 at 09:55 AM.
  Reply With Quote

ESOUI » Developer Discussions » Dev Tools » Eclipse LDT autocompletion

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off