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,566
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.
  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: 23
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,566
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?
  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: 23
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,566
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

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: 23
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.     --@type 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
08/18/19, 09:33 PM   #7
cloudor
 
cloudor's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 23
I have shared my improved version of LDT.
https://dl.bintray.com/cloudor/eclipse/ldt/
  Reply With Quote
01/05/20, 04:19 AM   #8
Tar000un
 
Tar000un's Avatar
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 47
I wanted to go with eclipse and autocompletion. I wasn't able to get auto-completion with the zip from "Eclipse LDT Autocomplete" as execution environment. I tried to regen the zip with the tool on github within a container, but I got a zip size of ~40ko instead 290ko for the addon.

Additionally, I was able to get autocompletion with adding lib as external source folder, pointing a dir with uncompressed api.zip.

Last edited by Tar000un : 01/05/20 at 04:22 AM.
  Reply With Quote
01/05/20, 05:44 AM   #9
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,566
I've actually updated the script earlier and uploaded a new version of the autocompletion. There's also a tiny inconsistency in the latest ESOUIDocumentation.txt file which makes the script fail. You'll need to add underscores (_) around the argument and return names for the InsecureNext function in the txt.
  Reply With Quote
01/07/20, 11:39 AM   #10
Tar000un
 
Tar000un's Avatar
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 47
Nice, for what I tested, seems working fine.
I ll check next patch about the script you commited on github. x)

And thanks.
  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