1

You all now basic IDE support for other languages such as c++. You write a class with member functions. If try to use it in your code and you press ctrl + space you will se all those member functions in a menu.

Now CryEngine has a Lua api (scriptbinds?) but there is no IDE that supports it.

Isn't it possible to feed an IDE of choice with the cryengine API and get full IDE support? I have never done something similar and don't know where I should start and I hope you can give me some directions.

Update:

Maybe I should add what I am thinking. If you have for example a java IDE and you included an external jar file you will get access to its content and the IDE will support it (autocomplete etc). Shouldn't the exact same thing be possible with cryengine and lua?

Maik Klein
  • 15,548
  • 27
  • 101
  • 197
  • Getting content completely for a dynamically typed language like Lua is... unlikely. It's impossible to know what is stored in any particular variable. Even global variables can change thanks to environments. – Nicol Bolas Nov 15 '12 at 21:22
  • I watched a video from jetbrains a year ago where they showcased their new IDE pycharm. You can add some sort of doctypes to give the IDE some hints on the types and it worked pretty good. (But this is for python not for lua). But do you think it is possible to get reasonable ide support for something like cryengine? – Maik Klein Nov 15 '12 at 21:29
  • 1
    "*Shouldn't the exact same thing be possible with cryengine and lua?*" No. Java is a *statically typed language*. Lua isn't. Java has introspection, which is what allows the IDE to load compiled JAR files and figure out what's in them. Lua doesn't. – Nicol Bolas Nov 15 '12 at 21:42

1 Answers1

1

Almost every IDE provides some way to incorporate custom APIs. For example, Eclipse (Koneki LDT) provides a way to add a custom API (as described in their User Assistance documentation). ZeroBrane Studio IDE I've been working on also provides a way to incorporate custom APIs (there are dozen or so shipped with the IDE for various engines).

Paul Kulchenko
  • 25,884
  • 3
  • 38
  • 56
  • Thanks but just to be 100% sure. I have to do manually coding to get API support right? It's not like java where you just add a `.jar file` and you are done? – Maik Klein Nov 15 '12 at 21:22
  • 1
    You likely don't need to change anything in the IDE (if that's what you mean by "manual coding"). I'm not sure in what format Eclipse provides their descriptions, but for ZeroBrane Studio it's a matter of dropping a lua file that includes descriptions for API calls into a folder. You will need to code that API file; for some engines this is done manually, but for others I've written scripts that converted descriptions from .h/.c files (for example Moai) or other Lua files (for example love2d). The scripts are included at the end of API files I referenced. – Paul Kulchenko Nov 15 '12 at 21:36
  • 1
    Just to elaborate on Nicol's comment. You can get support for typing direct calls (`foo.bar()`), but you may not get support for inferring types dynamically; for example `local f = foo(); f.bar()` may not offer you bar(). Different IDEs handle this diferently: Koneki relies on Metalua to parse the code and infer value and their types, ZBS does a bit of syntax analysis, but it only works in limited cases. *This* part is not likely to work out-of-the-box in a general case. – Paul Kulchenko Nov 15 '12 at 21:39