Skip to content

Commit 02bba96

Browse files
committed
Merge branch 'release/v2.2'
2 parents 710fe0b + a32a0e4 commit 02bba96

File tree

8 files changed

+90
-20
lines changed

8 files changed

+90
-20
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
Planned:
2+
- Rework some snippets, like a single import without an alias
3+
- Add support for all go tools like fix, vet, lint, oracle
4+
5+
###3.0.0 / 2014-06-28
6+
Default behavior of some commands has changed, so the version was incremented a major number to indicate backwards-incompatible behavior
7+
8+
- [Install, Build, Test, and Run commands all operate on current package instead of current file](https://github.com/syscrusher/golang.tmbundle/commit/be18b3daa5335e095943e3f155930b80c0bfcf82)
9+
- [Rename "Compile" to "Build" to match go tool](https://github.com/syscrusher/golang.tmbundle/commit/403d900131e04fcf5403c2643e735ade62816e3c)
10+
- [Simplify go fmt, make idiomatic](https://github.com/syscrusher/golang.tmbundle/commit/403d900131e04fcf5403c2643e735ade62816e3c)
11+
- [Add go install command](https://github.com/syscrusher/golang.tmbundle/commit/403d900131e04fcf5403c2643e735ade62816e3c)
12+
- [Add godoc dependency](https://github.com/syscrusher/golang.tmbundle/commit/cab9712e926e5dd60fd97402f2db45db3c82e49c)
13+
114
###2.1.1 / 2014-06-24
215
- [FIX: gofmt no longer supports -tabwidth or -tabs](https://github.com/syscrusher/golang.tmbundle/commit/122fb557211f3c0db5421cf1288f5b5ebd6bb338)
316

Commands/Compile.tmCommand renamed to Commands/Build.tmCommand

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,15 @@
1010
<string>#!/usr/bin/env ruby18
1111
1212
require "#{ENV['TM_BUNDLE_SUPPORT']}/gomate"
13-
Go::go "build", :verb =&gt; "Compiling"
14-
</string>
13+
Go::go "build", :verb =&gt; "Building"</string>
1514
<key>input</key>
1615
<string>document</string>
1716
<key>inputFormat</key>
1817
<string>text</string>
1918
<key>keyEquivalent</key>
2019
<string>@b</string>
2120
<key>name</key>
22-
<string>Compile</string>
21+
<string>Build</string>
2322
<key>outputCaret</key>
2423
<string>afterOutput</string>
2524
<key>outputFormat</key>

Commands/Reformat Document.tmCommand renamed to Commands/Fmt.tmCommand

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Go::gofmt
1717
<key>keyEquivalent</key>
1818
<string>^H</string>
1919
<key>name</key>
20-
<string>Reformat Document</string>
20+
<string>Fmt</string>
2121
<key>outputCaret</key>
2222
<string>interpolateByLine</string>
2323
<key>outputFormat</key>

Commands/Install.tmCommand

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>autoScrollOutput</key>
6+
<true/>
7+
<key>beforeRunningCommand</key>
8+
<string>saveModifiedFiles</string>
9+
<key>command</key>
10+
<string>#!/usr/bin/env ruby18
11+
12+
require "#{ENV['TM_BUNDLE_SUPPORT']}/gomate"
13+
Go::go "install", :verb =&gt; "Installing"</string>
14+
<key>input</key>
15+
<string>document</string>
16+
<key>inputFormat</key>
17+
<string>text</string>
18+
<key>keyEquivalent</key>
19+
<string>@I</string>
20+
<key>name</key>
21+
<string>Install</string>
22+
<key>outputCaret</key>
23+
<string>afterOutput</string>
24+
<key>outputFormat</key>
25+
<string>html</string>
26+
<key>outputLocation</key>
27+
<string>newWindow</string>
28+
<key>requiredCommands</key>
29+
<array>
30+
<dict>
31+
<key>command</key>
32+
<string>go</string>
33+
<key>locations</key>
34+
<array>
35+
<string>/opt/local/bin/go</string>
36+
<string>/usr/local/bin/go</string>
37+
<string>/usr/local/go/bin/go</string>
38+
</array>
39+
<key>variable</key>
40+
<string>TM_GO</string>
41+
</dict>
42+
</array>
43+
<key>scope</key>
44+
<string>source.go</string>
45+
<key>uuid</key>
46+
<string>B455A84C-0F20-494A-A3CC-49A89434DAB4</string>
47+
<key>version</key>
48+
<integer>2</integer>
49+
</dict>
50+
</plist>

Commands/Test.tmCommand

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Go::go "test", :verb =&gt; "Testing"
1919
<key>keyEquivalent</key>
2020
<string>@R</string>
2121
<key>name</key>
22-
<string>Run Tests</string>
22+
<string>Test</string>
2323
<key>outputCaret</key>
2424
<string>afterOutput</string>
2525
<key>outputFormat</key>

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
## Golang
2-
(a TextMate 2 language bundle)
3-
4-
Version 2.1.1
1+
## golang.tmbundle v3.0.0
2+
(a TextMate 2 bundle for the go programming language)
53

64
### Installation
75
TextMate by default will detect .go files and load [Jim Dovey's bundle](https://github.com/AlanQuatermain/go-tmbundle). This is a fork with additional improvements merged from around the community.
86

7+
Big changes from the default version:
8+
- go test, build, run, and install all operate on the package level instead of per file
9+
- added println and and printf snippets
10+
- bugfixes
911

1012
To install this bundle manually, open a Terminal window and do:
1113

@@ -16,10 +18,11 @@ git clone git://github.com/syscrusher/golang.tmbundle.git
1618
```
1719

1820

19-
This bundle uses gocode for completion, which can be installed via:
21+
This bundle uses gocode for completion and godoc for documentation, which can be installed with:
2022

2123
```Shell
2224
go get -u github.com/nsf/gocode
25+
go get -u code.google.com/p/go.tools/cmd/godoc
2326
```
2427

2528
### Features

Support/gomate.rb

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# TextMate's special GOPATH used in .tm_properties files prepended to the environment's GOPATH
1111
ENV['GOPATH'] = (ENV.has_key?('TM_GOPATH') ? ENV['TM_GOPATH'] : '') +
1212
(ENV.has_key?('GOPATH') ? ':' + ENV['GOPATH'] : '')
13-
13+
1414
module Go
1515
def Go::go(command, options={})
1616
# TextMate's special TM_GO or expect 'go' on PATH
@@ -22,16 +22,20 @@ def Go::go(command, options={})
2222
opts = {:use_hashbang => false, :version_args => ['version'], :version_regex => /\Ago version (.*)/}
2323
opts[:verb] = options[:verb] if options[:verb]
2424

25-
if command == 'test' && ENV['TM_FILENAME'] =~ /(_test)?(\.go)$/
26-
basename = $`
27-
args.push("-v")
28-
args.push("#{basename}.go")
29-
args.push("#{basename}_test.go")
25+
if command == 'run'
26+
file_length = ENV['TM_DIRECTORY'].length + 1
27+
go_file = ENV['TM_FILEPATH'][file_length..-1]
28+
args.push(go_file)
3029
opts[:chdir] = ENV['TM_DIRECTORY']
3130
else
32-
# At this time, we will always run 'go' against a single file. In the future there may be new
33-
# commands that will invalidate this but until then, might as well start simple.
34-
args.push(ENV['TM_FILEPATH'])
31+
# Default to running against directory, which in go should be the package
32+
# Useful for more cases, like install and build
33+
# Assumes a standard setup and may not function with all pkg managers
34+
opts[:chdir] = ENV['TM_DIRECTORY']
35+
pkg_length = ENV['GOPATH'].length + 4 # GOPATH + /src/
36+
go_pkg = ENV['TM_DIRECTORY'][pkg_length..-1] # subtract above, is pkg name
37+
args.push("-v") # list packages being operated on
38+
args.push(go_pkg)
3539
end
3640
args.push(opts)
3741

info.plist

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<plist version="1.0">
44
<dict>
55
<key>contactEmailRot13</key>
6-
<string>[email protected]</string>
6+
<string>[email protected]</string>
77
<key>contactName</key>
88
<string>syscrusher</string>
99
<key>description</key>
@@ -19,6 +19,7 @@
1919
<string>0B3C3EB0-9F51-4997-A87D-ECA507D8E31E</string>
2020
<string>0F6A8710-54FC-48F5-9D02-D093DA001D17</string>
2121
<string>73628139-0077-4F09-9B72-77546D7C2D2D</string>
22+
<string>B455A84C-0F20-494A-A3CC-49A89434DAB4</string>
2223
<string>------------------------------------</string>
2324
<string>D3CD6B51-3A7E-4356-85F4-B76B8336BEF2</string>
2425
<string>7BCFCFC8-9152-4638-8436-E17B0C754C8D</string>

0 commit comments

Comments
 (0)