Skip to content
Browse files

Added 'deferred function call' snippet and updated readme/history for…

… release 1.3.
  • Loading branch information...
1 parent 05c2fe8 commit 0e31889f800735c1f14ccaf669da049e0aa2fc5f Jim Dovey committed Nov 22, 2011
Showing with 93 additions and 46 deletions.
  1. +27 −1 History.rdoc
  2. +47 −44 README.rdoc
  3. +1 −1 Snippets/Deferred Call.tmSnippet
  4. +16 −0 Snippets/Deferred Function Call.tmSnippet
  5. +2 −0 info.plist
View
28 History.rdoc
@@ -1,5 +1,31 @@
+=== 1.3 / 2011-11-22
+* Includes a wrapper for +gotest+ on Cmd-Opt-T.
+* Imported some community additions and bugfixes to bring compatibility with OS X 10.7 and TextMate 1.5.1:
+ [https://github.com/AlanQuatermain/go-tmbundle/commit/97f8c44552b0347c9d89f948a5fb92172f32daca]
+ *mkhl* _Use default values for GOOS and GOARCH only when necessary_
+ [https://github.com/AlanQuatermain/go-tmbundle/commit/c85768b573f47d7274066b1260df6627ce35b82f]
+ *rsesek* _Include the receiver in entity.name.function scope so that it shows up in the symbol list_
+ [https://github.com/AlanQuatermain/go-tmbundle/commit/2eeb1c60f975af7cc3250964c9da58fca37d57f8]
+ *guncha* _Add gocode completion support_
+ [https://github.com/AlanQuatermain/go-tmbundle/commit/b730967fbd14e58bcc32d7f5157234cfa48f4043]
+ *guncha* _Add proper argument handling for functions_
+ [https://github.com/AlanQuatermain/go-tmbundle/commit/837e04fba7e6e4a3127006be5fa3f1d04e357cba]
+ *guncha* _Fix links not working properly when html output is produced while compiling a project with errors_
+ [https://github.com/AlanQuatermain/go-tmbundle/commit/69797af68e37e171fa12e3aa3f0ce9340369a453]
+ *chriseaton* _Size modifiers are not optional for float or complex_
+ [https://github.com/AlanQuatermain/go-tmbundle/commit/05ba567d62018b87619d77653b728fcd25c270fb]
+ *schmurfy* _added x86_64 as a valid architecture string_
+ [https://github.com/AlanQuatermain/go-tmbundle/commit/2912e001142b2e0921f4f5f5c568734ccc6bf701]
+ *TassoLee* _Fix for issue #6_
+ [https://github.com/AlanQuatermain/go-tmbundle/commit/67e6118d245ba4d9901b2fe869ca2c3a3bea4672]
+ *TassoLee* _Revert goroot_
+ [https://github.com/guncha/go-tmbundle/commit/27142544725331d465aed364eacb67d2c4b1eeb7]
+ *guncha* _Fix for source filenames with spaces bug_
+ [https://github.com/KnightBaron/go-tmbundle/commit/eb925bb53f71ab472d67c5ac9cfd78d7cc02be85]
+ *KnightBaron* _Use GOBIN shell variable instead of PATH if present_
+
=== 1.2 / 2010-06-13
-* Many new snippets and updates to the command-runner implementation, courtesy of Martin Kühl (http://github.com/mkuhl).
+* Many new snippets and updates to the command-runner implementation, courtesy of Martin Kühl (http://github.com/mkhl).
=== 1.0.3 / 2010-03-28
* Removed the no-longer-supported -oldparser flags from the invocation of the gofmt command
View
91 README.rdoc
@@ -1,6 +1,6 @@
== Go
(a TextMate language bundle)
-Version 1.2
+Version 1.3
=== Installation
@@ -16,51 +16,54 @@ Ensure you've got a recent copy of git installed, then copy this line to your Te
The bundle here implements a language syntax, some snippets, and some compile/format/documentation commands for the Go language (http://golang.org/). Much of the current infrastructure was created by Martin Kühl (http://github.com/mkhl), who is a significantly more seasoned TextMate bundle developer than I, and to whom I am eternally grateful.
=== Snippets
-+pkg+:: a package declaration including an optional comment block for packages other than 'main'.
-+imp+:: an import statement with optional alternative name.
-+imps+:: a multiple-import statement.
-+type+:: a type declaration, with name and variable type as tab-stops.
-+types+:: a block with multiple type declarations.
-+con+:: a single constant declaration.
-+cons+:: a multiple constant declaration block.
-+var+:: declare a variable with an optional initial value (long form, i.e. 'var x int = 10').
-+vars+:: a block of long-form variable declarations.
-+func+:: a plain (global) function declaration, with tab stops for name, parameters, and return types.
-+meth+:: declares a function on a particular type, with additional tab stops for receiver name and type.
-+in+:: an empty interface declaration (i.e. matches anything).
-+int+:: an interface definition with a single method.
-+st+:: a struct definition with a single member.
-+[]+:: a slice variable type; expands to '[]+type+', so is usable inside other snippets.
-+map+:: a map variable type; works similar to the slice type above.
-+ch+:: a channel type.
-+fun+:: a function type definition statement.
-+:+:: a short-form variable initializer (i.e. 'name := value').
-+mk+:: a make statement (used for creating & initializing channels, maps, etc.).
-+new+:: a new statement (used to create & initialize structure types).
-+Cmd-i+:: 'iota'
-+if+:: an if statement, properly formatted (Go requires the use of {} on ifs, unlike C; this throws me sometimes).
-+sw+:: a switch statement with an optional expression.
-+sel+:: a select statement.
-+case+:: a case clause, within a switch or select.
-+def+:: a default clause within a switch.
-+for+:: a for loop.
-+fori+:: a for loop with an index (similar to C for loops).
-+forr+:: a for loop iterating over a collection's range.
-+go+:: an immediate goroutine call (defines the function inline).
-+de+:: a deferred call (defines the function inline).
-+main+:: skeleton main() function.
-+init+:: skeleton init() function.
-+,+:: a pair ('first, second').
-+<+:: send/receive through a channel.
-+ret+:: a return statement with optional return value.
+[pkg] A package declaration including an optional comment block for packages other than 'main'.
+[imp] An import statement with optional alternative name.
+[imps] A multiple-import statement.
+[type] A type declaration, with name and variable type as tab-stops.
+[types] A block with multiple type declarations.
+[con] A single constant declaration.
+[cons] A multiple constant declaration block.
+[var] Declare a variable with an optional initial value (long form, i.e. 'var x int = 10').
+[vars] A block of long-form variable declarations.
+[func] A plain (global) function declaration, with tab stops for name, parameters, and a single optional result.
+[funcv] A plain (global) function declaration, with tab stops for name, parameters, and multiple results.
+[meth] Declares a function on a particular type, with additional tab stops for receiver name and type and a single optional result.
+[meth] Declares a function on a particular type, with additional tab stops for receiver name and type and multiple results.
+[in] An empty interface declaration (i.e. matches anything).
+[int] An interface definition with a single method.
+[st] A struct definition with a single member.
+[\[\]] A slice variable type; expands to '[]+type+', so is usable inside other snippets.
+[map] A map variable type; works similar to the slice type above.
+[ch] A channel type.
+[fun] A function type definition statement.
+[:] A short-form variable initializer (i.e. 'name := value').
+[mk] A make statement (used for creating & initializing channels, maps, etc.).
+[new] A new statement (used to create & initialize structure types).
+[Cmd-i] '+iota+'
+[if] An if statement, properly formatted (Go requires the use of {} on ifs, unlike C; this throws me sometimes).
+[sw] A switch statement with an optional expression.
+[sel] A select statement, for looping over channel conditions.
+[case] A case clause, within a switch or select.
+[def] A default clause within a switch.
+[for] A for loop.
+[fori] A for loop with an index (similar to C for loops).
+[forr] A for loop iterating over a collection's full range.
+[go] An immediate goroutine call (defines the function inline).
+[de] A deferred goroutine call (defines the function inline).
+[def] A simple deferred function call (by default supplies '+defer file.Close()+').
+[main] A template for a +main()+ function with a tab stop at its body.
+[init] A template for a module's +init()+ function, with a tab stop at its body.
+[,] A pair ('first, second'), suitable for declaring result variables from a multi-return-value function or a map range loop.
+[<] Send/receive through a channel. Provides tab stops for the value and the channel name.
+[ret] A return statement with optional return value.
=== Commands
-+Cmd-R+:: Compile and run the current file.
-+Cmd-B+:: Build the current project using gomake.
-+Cmd-Opt-B+:: Build the current project as a package using gomake & gopack.
-+Cmd-K+:: Compile the current file.
-+Ctrl-Shift-H+:: Reformat the document according to the Go style guidelines using gofmt.
-+Ctrl-H+:: Show the Go HTML documentation for the currently-selected symbol.
+[Cmd-R] Compile and run the current file.
+[Cmd-B] Build the current project using gomake.
+[Cmd-Opt-B] Build the current project as a package using gomake & gopack.
+[Cmd-K] Compile the current file.
+[Ctrl-Shift-H] Reformat the document according to the Go style guidelines using gofmt.
+[Ctrl-H] Show the Go HTML documentation for the currently-selected symbol.
=== Thanks
Thanks be to lasersox and Infininight over at the #textmate room on IRC (irc://irc.freenode.net/textmate) for all their help in cleaning up this here bundle, and for helping me to optimize my regex use in the language grammar.
View
2 Snippets/Deferred Call.tmSnippet
@@ -7,7 +7,7 @@
${0:// body}
}(${2:${1/(.+)?/(?1:values)/}})</string>
<key>name</key>
- <string>Deferred Call</string>
+ <string>Deferred Goroutine Call</string>
<key>scope</key>
<string>source.go</string>
<key>tabTrigger</key>
View
16 Snippets/Deferred Function Call.tmSnippet
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>content</key>
+ <string>defer ${0:file.Close()}</string>
+ <key>name</key>
+ <string>Deferred Function Call</string>
+ <key>scope</key>
+ <string>source.go</string>
+ <key>tabTrigger</key>
+ <string>def</string>
+ <key>uuid</key>
+ <string>AA2A0BCD-98B2-4B31-9F54-4207073E201C</string>
+</dict>
+</plist>
View
2 info.plist
@@ -172,12 +172,14 @@
<string>8C557B1F-C1C5-4FC3-830E-9D51DE6CFA5A</string>
<string>6B01E886-4CFA-476E-AE01-EFF406116978</string>
<string>92CF0E27-7ED9-4F9B-8061-DD2B38D22893</string>
+ <string>AA2A0BCD-98B2-4B31-9F54-4207073E201C</string>
<string>18A04BC9-D37A-46B9-8C92-4E8D287A46E4</string>
<string>54394BD4-1FFE-440F-9D3D-2D44F3B1BCC6</string>
<string>0FC09B94-D4C1-4C21-8076-EE7075174926</string>
<string>0E515A1F-B6F7-4473-B4C6-D6485E7CD133</string>
<string>4B3F378E-D9E8-4CCB-B537-96099B406511</string>
<string>214A69FB-0168-465E-AB51-D8C6C46BCF61</string>
+ <string>FE908865-7729-4926-9FAC-2D54895BEA48</string>
</array>
<key>uuid</key>
<string>9A94FED7-9430-410F-9C6A-5B9D48A89180</string>

0 comments on commit 0e31889

Please sign in to comment.
Something went wrong with that request. Please try again.