They’re not terribly pretty but it’s better than nothing.īelow that, where it says “Activation,”, make sure it’s set to "Key Equivalent" then put your cursor in the text field to the right. This lets any output from the command show up in a tooltip near the cursor, which means if you have errors while running frogc you can see them. Underneath the text area, where it says “Input,” set it to "None".īelow that, where it says “Output,” set it to "Show as Tooltip". If it does, then change the “Save” option from “Nothing” to either “Current File” or “All Files in Project”. This might appeal to you (it does to me one less keystroke!). In the large text area on the right (labeled “Command(s)”), enter the following:Ībove the text area, you have the option of having the command save the file before running. You should see a new “untitled” command appear under the Dart bundle. With the “ +” button at the bottom left, choose “New Command”. In TextMate, open the Bundle Editor (press Command-Option-Control-B, or go to Bundles > Bundle Editor > Show Bundle Editor)Ĭlick on the Dart entry in the left-hand list. The most useful command (indeed, the first thing I thought of) is a command to compile your current Dart script with frogc for you. But it doesn’t include any snippets or commands. dart you get colored syntax and code folding and that sort of thing. The Google Dart Bundle is great for adding syntax support for Dart, so when you create a file ending in. Write a Command to Compile Dart to JavaScript This way you can easily update the bundle in-place with svn up "~/Library/Application Support/TextMate/Pristine Copy/Bundles". To do this, navigate to that directory in Terminal (this should do it: cd "~/Library/Application Support/TextMate/Pristine Copy/Bundles") and then run the second svn checkout line above (the one that checks out just the. tmbundles out directly to their bundle directory. tmbundle to have TextMate install it.Ī lot of TextMate users like to simply check. tmbundle by following this path from the project root: /dart/tools/utils/textmate/Dart.tmbundle. If you’ve checked out the entire project, you can navigate to the. Open up Terminal (found in your /Applications/Utilities/ folder). We’ll be using it in a TextMate command later to turn our Dart file(s) into JavaScript so we can actually use our Dart code today. It’s a command line tool, but it’s thankfully easy to use. (Note that if you don’t want to install the Dart Editor, you can download just the Dark SDK for your OS at this URL (it’s only 2 or 3 MB): įrogc is the Dart-to-JavaScript compiler. The current Activetuts+ Facebook Fan Bonus takes you through the basic usage of the Dart Editor. I won’t be getting into details on using it in this tutorial, but feel free to play around with it. The Dart Editor is based on Eclipse, so if you’ve used that you’ll be right at home with the Dart Editor. It’s around 40 MB, so it’s not a terribly heavy download. Under “Step 1” of that page, you’ll find a link to a ZIP file containing the Dart Editors. If you’re on Windows or Linux, yet are reading this tutorial despite its Mac-centric nature, you can download the Dart Editor for those platforms from the Dart Editor for Windows and Linux pages. On the official Dart site (see the previous section), you can download the Dart Editor from the following link: Even if you’re a hardcore TextMate fanatic (like I am), it’s still not a terrible idea to have the “official” Dart Editor installed and handy. We won’t really be using the Dart Editor (the point of this tutorial is to use TextMate for Dart development), but the download includes the Dart SDK, which is really what we’re after. Beyond that, Activetuts+ has previously published my introductory tutorial on the language, What is Dart, and Why Should You Care? If you’re not familiar with Dart at this point, I can point you to the official source of information. You don’t need much, but having some Dart files around to open in TextMate will make this go much smoother. Lastly, I assume you have a little Dart experience. I also assume you are familiar with and are capable of checking code out of a Subversion repository. I assume you are familiar with TextMate bundles to at least the degree of what they are and that they add functionality (usually language-specific) to TextMate. But TextMate users usually find a way to bend TextMate to their will, and this Quick Tip will get you started a-bending to use Dart with TextMate. Google provides an Eclipse-based Dart Editor that provides a handy means to get started. Dart is a pretty cool new language that could mean a change in the way you write web applications.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |