Page 1 of 1

Modding in Eclipse

PostPosted: Fri Jul 31, 2015 09:50
by Rochambeau
Hi,

is there a lua library that can be imported into Eclipse to use autocompletion with minetest api methods?

The library might need to look like described in this post:

https://www.eclipse.org/forums/index.php/t/651455/

Re: Modding in Eclipse

PostPosted: Fri Aug 14, 2015 08:10
by Rochambeau
By now I've found several ways to add minetest specific custom autocompletion to eclipse.

1. Lua Execution Environment
EEs like described here are too complicated for me. I don't have the time, nor the know how of doing it.

2. Editor Templates
That would be more my thing because it's entirely based on xml and could be provided pretty easily.

Now, what I'm looking for is a good source for all lua api functions with their parameters to do some jEdit magic and create an all-in-one xml template.

Possible sources I know of:


None of the above has a fixed structure that makes copy'n'paste easy.
Is there another source/list of all lua api functions?

Attached, there is a very alpha example of what a eclipse editor template looks like. It's created of the comments of l_env.h (source nr 1). Problem with this source in general is, that not every function is thoroughly commented (params).

Re: Modding in Eclipse

PostPosted: Fri Aug 14, 2015 16:15
by Sane

Re: Modding in Eclipse

PostPosted: Sun Aug 16, 2015 16:40
by Rochambeau
It's ugly, it's buggy, but it's something to build upon!

Installation:

1. Start Eclipse
2. Install LDT (Lua plugin for Eclipse)
3. In eclipse go to Window -> Preferences -> Lua -> Editor -> Templates -> Import
Choose templates.xml

Usage:

Type the first few letters of a minetest function and press Control + Space
Voila: Autocompletion!

There are still some difficulties with "mintetest.xxx" functions. It seems the dot causes some problems. Time will tell while I'm working with it.

[Edit: @ Sane: Thank you very much. Your link tip helped a lot!]