Page 1 of 1

IDE's and Factorio API

Posted: Mon Aug 12, 2019 11:34 pm
by beerworm
Is there any IDE which supports importing Factorio's API documentation? For example, typing

Code: Select all

player.
will bring up a list of available functions and descriptions. Or can API only be referenced manually?

Re: IDE's and Factorio API

Posted: Tue Aug 13, 2019 7:34 am
by Choumiko
There is an extension for vscode
https://marketplace.visualstudio.com/it ... tocomplete

It's not a real autocomplete most of the time, since it will happily suggest invalid functions (it works for game. ). But i guess that's more due to lua being lua.

Re: IDE's and Factorio API

Posted: Tue Aug 13, 2019 8:16 am
by beerworm
Choumiko wrote:
Tue Aug 13, 2019 7:34 am
There is an extension for vscode
https://marketplace.visualstudio.com/it ... tocomplete

It's not a real autocomplete most of the time, since it will happily suggest invalid functions (it works for game. ). But i guess that's more due to lua being lua.
Hmm seems alright, I'll keep this one in mind. Thanks.

Re: IDE's and Factorio API

Posted: Tue Aug 13, 2019 4:07 pm
by slippycheeze
Choumiko wrote:
Tue Aug 13, 2019 7:34 am
There is an extension for vscode
https://marketplace.visualstudio.com/it ... tocomplete

It's not a real autocomplete most of the time, since it will happily suggest invalid functions (it works for game. ). But i guess that's more due to lua being lua.
Given that the god object, LuaEntity, has approximately a million functions that only work on one particular type of it knowable only at runtime, I don't think that is really going to be a solvable problem. Even strict static typing can't tell you if this is a combinator or a train in that context, it'd need more information somewhere that was a human overlay on the in-game runtime state. :)

Re: IDE's and Factorio API

Posted: Sun Aug 18, 2019 6:29 am
by jockeril
Choumiko wrote:
Tue Aug 13, 2019 7:34 am
There is an extension for vscode
https://marketplace.visualstudio.com/it ... tocomplete

It's not a real autocomplete most of the time, since it will happily suggest invalid functions (it works for game. ). But i guess that's more due to lua being lua.
Is there one that does the same for notepad plus plus ? That would be so great for my simple attempts at modding - now I'm going to look for one ! :ugeek: