Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Sublime Text 3, Highlights and Autocomplete — Gideros Forum

Sublime Text 3, Highlights and Autocomplete

CitizenKCitizenK Member
edited January 2014 in General questions
As I couldn't find anything, here is a quick&dirty start of a syntax file for Sublime Text 3. It contains syntax highlighting and autocompletion for Gideros. Just extract SublimeGideros under {data_path}\Packages (for me, this is under "C:\Users\xxxxx\AppData\Roaming\Sublime Text 3\Packages\"). In Sublime, select View -> Syntax -> Gideros Lua.

This is just some auto generated stuff, so it may not be the best, but it's a start and better than nothing if anyone likes to work with Sublime Text 3 (I use it for pretty much all my coding, so I would like to keep it with Gideros).

Feel free to edit it (and maybe post a better version) as you wish.

Comments

  • And here is the link, where auto completion list is generated from the docs:
    http://docs.giderosmobile.com/reference/autocomplete.php
    Just in case someone wants to use it ;)

    Likes: wefe

    +1 -1 (+1 / -0 )Share on Facebook
  • It's the same list. Just in a different format to use it with Sublime Text 3.
  • @CitizenK

    Thanks for that!

    I was using Textmate 2, but no autocompletion was becoming a bummer.

    [ Run project from Sublime Text 3 - OS X ]

    I've pulled the applescript from the gideros Textmate 2 bundle created by @jack0088 and made it work with Sublime Text 3.

    Download the file below, follow the readme, then hit 'command + b' to run project from Sublime.
    zip
    zip
    Gideros_SublimeText3_Build_OSX.zip
    4K

    Likes: altai

    +1 -1 (+1 / -0 )Share on Facebook
  • CitizenKCitizenK Member
    edited January 2014
    Here is a test of a build system for Windows.

    Requirements: You need PHP installed on the Windows PC.

    - In Sublime go to Tools -> Build System -> New Build System...
    - Replace the content with:
    {
    	"cmd": ["php","-f","make.php","$project_path"],
    	"file_regex": "!ERROR -- File:\"(...*?)\", Line:([0-9]*)",
    	"selector": "source.lua"
    }
    - If PHP is not in your path, you need to enter the full path to php instead of just "php"
    - Save the file as "GiderosLua.sublime-build"
    - Extract make.php from the zip file and put it into your project directory
    - Open make.php and edit path to gdrbridge and remote ip to match your system
    - In Sublime select Tools -> Build System -> GiderosLua
    - End your lua code with printing "---END---" or Sublime will go on to wait for error output forever (which may not be a big issue, but uses some CPU).
    - Done. Press "Ctrl+B" to run your project on the remote device. Press F4 to jump to errors in your code.

    Also make sure that the Gideros IDE isn't running when you start remote code in Sublime Text 3.

    It's a bit fragile because there seems to be no way to know when a script ended. So you need to print "---END---" for Sublime to know that it ended.

    For similar reasons there may be issues depending on your configuration and network/device speed. Sublime runs gdrbridge.exe multiple times but as it doesn't know what the remote device is doing, this may cause issues sometimes. If it doesn't respond, try to just run it again. If there are still issues, try changing the UTIME in the script to a (much) higher number. This is the time in microseconds, the script pauses before sending more commands to the remote device.

    I'm just starting with Gideros but this works pretty well for me so far and I love using Sublime Text 3 for it. The build system and highlights make Sublime Text 3 into a great development environment for Gideros.
    zip
    zip
    make.zip
    1K

    Likes: ar2rsawseen, altai

    +1 -1 (+2 / -0 )Share on Facebook
Sign In or Register to comment.