Hi,
Most new comers will wonder how to write their code, what editor to use and how to get syntax highlighting and autocomplete.
Hidden (I say hidden 'coz I just read that today). I downloaded the file from http://www.capgo.com/Resources/SoftwareDev/LuaXcode3SyntaxColor.zip and unzipped it and copied the files to the ~/Library/Application Support/Developer/Shared/Xcode/Specifications/ directory. You might have to create the directory called Specifications before you can copy the files there.
What I also did was add a few more commands. These were to test, like display.newImage, display.newRect, etc.
Then I started XCode and with NO project, just chose a blank file, called it main.lua and started to type in some code…
Voila, Syntax Highlighting, press ESC, code completion… WOW!! Amazing, now the process of development can be more fun and faster than working with TextEdit or TextWrangler.
I also got my hands on Corona Project Manager yesterday, add this to your repertoire of tools and you are all set.
I shall try to add the Corona keywords and share them with you here.
I found this to be the easiest and more intuitive way to code for Corona. Now if there was a way to compile and run from xcode itself.
cheers,
Jayant C Varma [import]uid: 3826 topic_id: 3775 reply_id: 303775[/import]
>>>You might have to create the directory called Specifications before you can copy the files there.
Do you have xCode installed? If so, then the path up to ~/Library/Application Support/Developer/Shared/Xcode/ is already there.
and ~ is equivalent to your home dir (/Users//)
cheers,
Jayant C Varma [import]uid: 3826 topic_id: 3775 reply_id: 11650[/import]
I took the text from Matthew Pringle’s text at the forum in the link above and created a PDF that new users can follow to use XCode as the default editor for Corona and use Syntax Highlighting.
I wonder if there’s a clever way to get either the simulator to run or the debugger without having to change the build tool [import]uid: 9371 topic_id: 3775 reply_id: 12430[/import]
I followed everyting, copied files, restarted Xcode, hilighting works but autocomplete still don’t work T_T
Any help please… I really need it to work.
SOLVED – Autocomplete works after pressing return and start working with the second line of the code… how nonsense. [import]uid: 35267 topic_id: 3775 reply_id: 21889[/import]
I don’t know if this is commen knowledge, but there is also a possibility to do custom user scripts for xcode. For example a script that (un)comments selected text or inserts a module template.
Here is an example of what you need to do to have a lua (un)comments shortcut:
Go to the user script menu in XCode (the one with the weird sign)
Choose “Edit User Scripts”. Now a window called “Edit User Scripts” will pop up.
Click the plus sign in lower left corner. Choose “New Submenu” from pop-up menu.
Name the submenu “Corona”
Click the plus sign in lower left corner again and choose “New Shell Script” and name it “Un/Comment”.
Copy and paste this code to the script code box :
//////////////////////////////////////////////
#! /usr/bin/perl -w
my $outputString = “”;
my $cCmt = “–”;
my $fileString = <%%%{PBXHeadText}%%%
HEADTEXT
my $commentString = $cCmt;
my @selection = ;
if (!@selection) { push @selection, “”; };
my $firstLineOfSelection = $selection[0]; my $addingCommentsString = 1; if ($firstLineOfSelection =~ /^$commentString/) { $addingCommentsString = 0; }
@ojnab,
yes, not only that you can use a variety of languages like Perl, Python, Apple Script and Shell Script to write these scripts to manipulate xcode.