Author Topic: Nspire-Lua IDE : plugin for Intellij IDEA  (Read 21187 times)

0 Members and 1 Guest are viewing this topic.

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Nspire-Lua IDE : plugin for Intellij IDEA
« on: October 18, 2012, 04:58:12 pm »
      I have talked about "Intellij IDEA" on
the tinspire group as a Lua IDE (thanks to its wonderful Lua plugin), and I believe it can be quite good for you guys, especially for big projects where the current SDK isn't efficient (no support of multiple files etc.).

Here's some details on how to setup what you can see at the bottom of this post ;)

Basically, you can do either :
This (longer but it will make seperate SDKs for normal computer Lua and Nspire Lua)
  • Download Lua for windows 5.1
  • Add a new Lua SDK in Intellij (you can find that in the module settings, for example)
  • Select the Lua folder in program files as the lua sdk folder.
  • Download my addon and decompress it somewhere
  • Add from my addon the folder "nspirelua-api" as an external classpath folder in your new SDK
  • Save, apply, etc.
or (easier/faster but it will make computer lua think it has nspire lua API available) :
  • In Intellij's ( / module's ) settings, edit the KahLua SDK
  • Download my addon and decompress it somewhere
  • Add from my addon the folder "nspirelua-api" as an external classpath folder in your new SDK
  • Save, apply, etc.
After all that, create a new Lua project, and in the libraries on the left side, you should see not only the stdlib (of which you can unlink the io and debug API which aren't present on the Nspire), and you should be able to enjoy Intellij's Lua plugin things but for the Nspire Lua API too.
This it what it looks like when it's set up, on my computer :

Autocompletion example (of the events and other functions ) :






Auto-completion + arguments help :




Interactive documentation based onInspired-Lua's wiki :  (Ctrl-Q on a word)




Nspire-Lua API plugin : download here (http://tiplanet.org/forum/archives_voir.php?id=8182)


Good luck and have fun :)[/list][/list]
« Last Edit: October 18, 2012, 04:59:16 pm by adriweb »
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline ElementCoder

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 611
  • Rating: +42/-2
    • View Profile
Re: Nspire-Lua IDE : plugin for Intellij IDEA
« Reply #1 on: October 19, 2012, 04:04:03 am »
Wow this is awesome! Can it run the programs too or do you still need the TINCS/Handheld to test? (I guess the latter :P)
« Last Edit: October 19, 2012, 04:04:12 am by ElementCoder »

Some people need a high five in the face... with a chair.
~EC

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: Nspire-Lua IDE : plugin for Intellij IDEA
« Reply #2 on: October 19, 2012, 07:30:10 am »
Wow this is awesome!
Thanks :)

Can it run the programs too or do you still need the TINCS/Handheld to test? (I guess the latter :P)
Indeed this is just for editing.

But then you have for example Luna, which you can use in a shell script to build your files and open the .tns in the software etc, all that called from within the IDE with a build configuration.

We use that for FormulaPro : https://github.com/adriweb/EEPro-for-Nspire/blob/master/build.sh

Edit : however, if you want to test out some algorithms for example, written in "pure" lua, it will run indeed in the console :) (for that you have to install Lua for your computer tho)
« Last Edit: October 19, 2012, 07:44:47 am by adriweb »
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: Nspire-Lua IDE : plugin for Intellij IDEA
« Reply #3 on: October 19, 2012, 10:45:05 am »
Note that FormulaPro will eventually use the new build system I made :)

Nice work Adriweb !

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: Nspire-Lua IDE : plugin for Intellij IDEA
« Reply #4 on: October 19, 2012, 12:06:55 pm »
Thanks :)
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline trmpereira

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 9
  • Rating: +0/-0
    • View Profile
Re: Nspire-Lua IDE : plugin for Intellij IDEA
« Reply #5 on: May 24, 2013, 06:10:37 pm »
Is it possible to do this with the

Making the words that are commands to be colored in text program like etexteditor copy for windows of textmate (mac)

Offline ElementCoder

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 611
  • Rating: +42/-2
    • View Profile
Re: Nspire-Lua IDE : plugin for Intellij IDEA
« Reply #6 on: May 30, 2013, 03:01:08 pm »
I'm not sure what you mean, but if you mean syntax highlighting then yes it does that.

Some people need a high five in the face... with a chair.
~EC

Offline kyllopardiun

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 178
  • Rating: +14/-4
  • Kyllopardiun over 2000 results in google.
    • View Profile
    • Kyllo's blog (a blog about poetry, videos and computing)
Re: Nspire-Lua IDE : plugin for Intellij IDEA
« Reply #7 on: June 15, 2013, 03:09:58 am »
Just a little tip for folks on windows and with more than one file to compile in luna:



Quote from: compile.bat
type 1.lua 2.lua 3.lua > output.lua
luna.exe output.lua output.tns
del output.lua

PS: in most cases (at least for me) is better to specify manually files in order to be compiled than trying type *.lua >output.lua

Offline Jonius7

  • python! Lua!
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1918
  • Rating: +82/-18
  • Still bringing new dimensions to the TI-nspire...
    • View Profile
    • TI Stadium
Re: Nspire-Lua IDE : plugin for Intellij IDEA
« Reply #8 on: June 29, 2013, 06:53:56 am »
I can't believe I haven't seen this before. This will really help me try and get back into Lua programming.
Now only thing is more convenient .lua -> tns conversion and loading into emulator, which there might be some tools lurking around that I haven't discovered, or forgotten, or not know how to use.
Programmed some CASIO Basic in the past
DJ Omnimaga Music Discographist ;)
DJ Omnimaga Discography
My Own Music!
My Released Projects (Updated 2015/05/08)
TI-nspire BASIC
TI-nspire Hold 'em
Health Bar
Scissors Paper Rock
TI-nspire Lua
Numstrat
TI-nspire Hold 'em Lua
Transport Chooser
Secret Project (at v0.08.2 - 2015/05/08)
Spoiler For Extra To-Be-Sorted Clutter:

Spoiler For Relegated Projects:
TI-nspire BASIC
Battle of 16s (stalled) | sTIck RPG (stalled) | Monopoly (stalled) | Cosmic Legions (stalled)
Axe Parser
Doodle God (stalled while I go and learn some Axe)

Offline imath

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 18
  • Rating: +0/-0
    • View Profile
Re: Nspire-Lua IDE : plugin for Intellij IDEA
« Reply #9 on: June 30, 2013, 12:39:23 am »
Pretty good.
I wanna write a visual IDE later based on XML and SM

Offline ExtendeD

  • CoT Emeritus
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 825
  • Rating: +167/-2
    • View Profile
Re: Nspire-Lua IDE : plugin for Intellij IDEA
« Reply #10 on: June 30, 2013, 04:47:16 am »
To load the file into the emulator, maybe some AutoIt hack would as I did for the NdlessEditor.
Ndless.me with the finest TI-Nspire programs

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: Nspire-Lua IDE : plugin for Intellij IDEA
« Reply #11 on: June 30, 2013, 05:26:49 am »
Hmm, seeing activity on this topic reeminded me that I had a 2.1 version of the plugin that I just uploaded : http://tiplanet.org/forum/archives_voir.php?id=8182
No major things but improvements here and there.

Also, depending on IDEA's version (apparently), some autocompletions get better, some "worse" (not so bad but...), meh, it's still very helpful :)


BTW, I have set up in the IDE a special "tool" that makes me able to directly launch TINCS with the script (it saves the .lua file, calls Luna on it, and launches it.)
It's a simple one-liner, and can trivially be ported to a Mac command. As for Linux (and actually nspire_emu, it would require a bit more work, yes...)
« Last Edit: June 30, 2013, 05:29:24 am by adriweb »
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline Jonius7

  • python! Lua!
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1918
  • Rating: +82/-18
  • Still bringing new dimensions to the TI-nspire...
    • View Profile
    • TI Stadium
Re: Nspire-Lua IDE : plugin for Intellij IDEA
« Reply #12 on: July 03, 2013, 02:53:01 am »
How do you get the interactive documentation and arguments help configured properly? I haven't got them working, I've got the autocompleting menus popping up fine but I'm not sure if I've stuffed up config of libraries at some point (putting into Kahlua)
« Last Edit: July 03, 2013, 02:53:11 am by Jonius7 »
Programmed some CASIO Basic in the past
DJ Omnimaga Music Discographist ;)
DJ Omnimaga Discography
My Own Music!
My Released Projects (Updated 2015/05/08)
TI-nspire BASIC
TI-nspire Hold 'em
Health Bar
Scissors Paper Rock
TI-nspire Lua
Numstrat
TI-nspire Hold 'em Lua
Transport Chooser
Secret Project (at v0.08.2 - 2015/05/08)
Spoiler For Extra To-Be-Sorted Clutter:

Spoiler For Relegated Projects:
TI-nspire BASIC
Battle of 16s (stalled) | sTIck RPG (stalled) | Monopoly (stalled) | Cosmic Legions (stalled)
Axe Parser
Doodle God (stalled while I go and learn some Axe)

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: Nspire-Lua IDE : plugin for Intellij IDEA
« Reply #13 on: July 03, 2013, 09:19:47 am »
I haven't figured out a way to get args hemp 100% of the time.
It' pretty much because things that are passed by the functions aren't really recognized as external elements (gc for example) that it can look up for help.
Try not passing (temporarily, while you write) gc as an argument, for example, and start typing 'gc:drawS' for example. Sometimes with "gc." I'm not sure.
The Lua addon is great but not so wonderful with external APIs that have objects stuff like this...

Anyway, my setup instructions is nothing more than what I've written in the first post of this topic
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline imath

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 18
  • Rating: +0/-0
    • View Profile
Re: Nspire-Lua IDE : plugin for Intellij IDEA
« Reply #14 on: July 06, 2013, 03:42:41 am »
hello adriweb,
maybe we can write a Visual Lua based on C#,GDI+,XML and Screen Manager.
how do you think of it?
I think it would be a vase but profound project.