Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: syscrusher/golang.tmbundle
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.2.0
Choose a base ref
...
head repository: syscrusher/golang.tmbundle
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Oct 14, 2015

  1. Copy the full SHA
    0fa56a5 View commit details

Commits on Oct 16, 2015

  1. Merge pull request #10 from mkaz/master

    Fix duplicate `go get` in imports statement
    syscrusher committed Oct 16, 2015
    Copy the full SHA
    432af5b View commit details

Commits on Oct 18, 2015

  1. New path to godoc

    Fixed warning:
    ```
    warning: code.google.com is shutting down; import path code.google.com/p/go.tools/cmd/godoc will stop working
    the code.google.com/p/go.tools/cmd/godoc command has moved; use golang.org/x/tools/cmd/godoc instead.
    ```
    msoap committed Oct 18, 2015
    Copy the full SHA
    f7e24e6 View commit details
  2. Copy the full SHA
    6201a07 View commit details
  3. Merge pull request #11 from msoap/patch-1

    New path to godoc
    syscrusher committed Oct 18, 2015
    Copy the full SHA
    f490d6f View commit details
  4. Merge pull request #12 from msoap/hidpi_icons

    Changed icons for completion menu to HiDPI version
    syscrusher committed Oct 18, 2015
    Copy the full SHA
    9faf1ad View commit details
  5. v3.2.1

    syscrusher committed Oct 18, 2015
    Copy the full SHA
    93b9280 View commit details

Commits on Nov 26, 2015

  1. Copy the full SHA
    6eac772 View commit details

Commits on Nov 27, 2015

  1. Grammar: Fix scope identifiers to allowed ones

    See:
    
    * Bundle Development -> Language Grammars -> TextMate Scopes
    
    * https://gist.github.com/lcaballero/5035909#file-tmlaguage-syntax-keys-L2307
    nanoant committed Nov 27, 2015
    Copy the full SHA
    88bbe65 View commit details
  2. Grammar: Simplify & shorten regexes

    1. [[:alnum:]_] -> \w
    2. [[:blank:]]  -> \s
    3. [:digit:]    -> \d
    4. Remove excessive (?: ... )
    nanoant committed Nov 27, 2015
    Copy the full SHA
    f070508 View commit details
  3. Copy the full SHA
    4fd348f View commit details
  4. Copy the full SHA
    a8328ab View commit details
  5. 1
    Copy the full SHA
    d2b0efd View commit details
  6. Merge pull request #13 from nanoant/patch/pdf-completion-icons

    Use scale independent PDF completion icons
    syscrusher committed Nov 27, 2015
    Copy the full SHA
    3cd7495 View commit details
  7. Merge pull request #14 from nanoant/patch/grammar-updates

    Patch/grammar updates
    syscrusher committed Nov 27, 2015
    Copy the full SHA
    07d9f26 View commit details
  8. v3.3.0

    syscrusher committed Nov 27, 2015
    Copy the full SHA
    25ea2b5 View commit details

Commits on Nov 30, 2015

  1. Copy the full SHA
    04083c4 View commit details
  2. Copy the full SHA
    4eb174d View commit details

Commits on Dec 1, 2015

  1. REDO: Remove leading path separator (:) from GOPATH

    If TM_GOPATH was not set, the resulting GOPATH was starting with
    colon (i.e. ":$GOPATH"), which was causing troubles in go1.5
    
    Reapply cherrypick of efa0658 from tg.
    Previously attempted in cf4a250,
    accidentally overwritten in 2653890.
    Issue identified by tg in #17.
    tg authored and syscrusher committed Dec 1, 2015
    Copy the full SHA
    4372808 View commit details
  2. Merge pull request #15 from nanoant/patch/grammar-type-decl

    Make Go.tmbundle understand type declarations
    syscrusher committed Dec 1, 2015
    Copy the full SHA
    520dd4f View commit details

Commits on Dec 2, 2015

  1. Copy the full SHA
    9f4fca8 View commit details

Commits on Dec 3, 2015

  1. Merge pull request #18 from willfaught/master

    Add a note about environment variables
    syscrusher committed Dec 3, 2015
    Copy the full SHA
    859c66a View commit details

Commits on Dec 4, 2015

  1. Copy the full SHA
    b4427d9 View commit details

Commits on Dec 7, 2015

  1. New HTML (Go) grammar for Go HTML templates

    Includes support for indention and folding. More information about Go HTML
    templates can be found at:
    
      https://golang.org/pkg/html/template/
    nanoant committed Dec 7, 2015
    Copy the full SHA
    197a72f View commit details

Commits on Dec 11, 2015

  1. Copy the full SHA
    4fa99bf View commit details

Commits on Dec 12, 2015

  1. Copy the full SHA
    d1d3a80 View commit details

Commits on Dec 19, 2015

  1. Merge pull request #19 from rdwampler/master

    Use requiredCommands for goimports and golint
    syscrusher committed Dec 19, 2015
    Copy the full SHA
    3ee5bc8 View commit details
  2. Merge pull request #20 from nanoant/patch/go-html-template

    New HTML (Go) grammar for Go HTML templates
    syscrusher committed Dec 19, 2015
    Copy the full SHA
    fcdf6a9 View commit details
  3. Merge pull request #21 from msoap/complete_fix

    Don't save document before completion
    syscrusher committed Dec 19, 2015
    Copy the full SHA
    a58a45e View commit details
  4. v3.4.0

    syscrusher committed Dec 19, 2015
    Copy the full SHA
    7cb7593 View commit details

Commits on Dec 21, 2015

  1. Grammar: Fix var x = init(...) highlighting

    This fixes change introduced in a8328ab that
    was adding type highlighting in `var x Type`. However the rule (.*)\s*(?:=|$)
    was greedy consuming everything until `=` or `$` (end of line). As a
    consequence it was effectively matching everything till end of line, consuming
    also `=` and everything that follows, resulting incorrect highlight, for eg.:
    
      var addr = flag.String("addr", ":8080", "TCP address to listen to")
    
    Now replacing RE to use lazy (non-greedy) (.*?)\s*(?:=|$) rule.
    nanoant committed Dec 21, 2015
    Copy the full SHA
    6e3d229 View commit details

Commits on Dec 26, 2015

  1. Merge pull request #22 from nanoant/patch/fixup-grammar

    Grammar: Fix var x = init(...) highlighting
    syscrusher committed Dec 26, 2015
    Copy the full SHA
    5263bbb View commit details

Commits on Dec 31, 2015

  1. A more helpful struct snippet

        struct {
          member
        }
    
    vs.
    
        type Foo struct {
          Bar string
        }
    jish committed Dec 31, 2015
    Copy the full SHA
    82d13ce View commit details

Commits on Apr 10, 2016

  1. Merge pull request #24 from jish/helpful-struct

    A more helpful struct snippet
    syscrusher committed Apr 10, 2016
    Copy the full SHA
    01407ec View commit details
  2. Copy the full SHA
    ea01788 View commit details
  3. Partial fix for issue #26: Remove Ruby18 dependency where possible.

    Most of the bundle is compatible with greater ruby versions, except the 'Open
    Package' command. That will be addressed in another commit.
    syscrusher committed Apr 10, 2016
    Copy the full SHA
    dd5f608 View commit details
  4. Release v3.5.0

    syscrusher committed Apr 10, 2016
    Copy the full SHA
    d95f487 View commit details

Commits on May 23, 2016

  1. Copy the full SHA
    59c296e View commit details
  2. Release 3.5.1

    syscrusher committed May 23, 2016
    Copy the full SHA
    6fd548c View commit details

Commits on May 25, 2016

  1. Copy the full SHA
    ce970fd View commit details
  2. Copy the full SHA
    aa8d016 View commit details
  3. Feature: Completions include $GOPATH.

    Previously we were not reasonably parsing and passing $GOPATH along to gocode.
    syscrusher committed May 25, 2016
    Copy the full SHA
    d8c0e1f View commit details
  4. Feature: Completions include current package.

    Pass along path to current file and gocode handles the rest.
    syscrusher committed May 25, 2016
    Copy the full SHA
    4e69ce6 View commit details
  5. Copy the full SHA
    e932933 View commit details

Commits on Jun 7, 2016

  1. Feature: Improved, expanded documentation coverage. Now includes all …

    …variables and types.
    
    Adds new dependency: `go get -u github.com/zmb3/gogetdoc`. Requires Go 1.6+.
    syscrusher committed Jun 7, 2016
    Copy the full SHA
    b19d188 View commit details

Commits on Aug 16, 2016

  1. Remove unused require_cmd library include (#28)

    This was missed in d092aba.
    infininight authored and syscrusher committed Aug 16, 2016
    Copy the full SHA
    02d18b2 View commit details

Commits on Aug 19, 2016

  1. Revert "Remove unused require_cmd library include (#28)"

    This reverts commit 02d18b2.
    syscrusher committed Aug 19, 2016
    Copy the full SHA
    2a503ab View commit details
  2. Remove unused require_cmd include again. Substitute necessary escape_…

    …codes
    
    include. Unify import quotation method and organization...
    
    -require ENV['TM_SUPPORT_PATH'] + '/lib/ui.rb'
    +require ENV['TM_SUPPORT_PATH'] + "/lib/ui.rb"
     require ENV['TM_SUPPORT_PATH'] + "/lib/escape.rb"
    -require ENV['TM_SUPPORT_PATH'] + "/lib/tm/require_cmd.rb"
    -require ENV['TM_SUPPORT_PATH'] + "/lib/tm/htmloutput.rb"
    +require ENV['TM_SUPPORT_PATH'] + "/lib/exit_codes.rb"
     require ENV['TM_SUPPORT_PATH'] + "/lib/web_preview"
    +require ENV['TM_SUPPORT_PATH'] + "/lib/tm/htmloutput.rb"
    syscrusher committed Aug 19, 2016
    Copy the full SHA
    dcd0edd View commit details
  3. gomate: remove unused imports (escape, ui, web_preview, tm/require_cm…

    …d). add explicit tm/process import (previously included through tm/executor).
    syscrusher committed Aug 19, 2016
    Copy the full SHA
    2491b60 View commit details

Commits on Aug 20, 2016

  1. Cleanup and documentation. Remove unnecessary escaping. Additional no…

    …te about ENV vars. Remove Ruby 1.8 dependency for gomate.
    syscrusher committed Aug 20, 2016
    Copy the full SHA
    e84addd View commit details
121 changes: 0 additions & 121 deletions CHANGELOG.md

This file was deleted.

4 changes: 2 additions & 2 deletions Commands/Build.tmCommand
Original file line number Diff line number Diff line change
@@ -7,10 +7,10 @@
<key>beforeRunningCommand</key>
<string>saveModifiedFiles</string>
<key>command</key>
<string>#!/usr/bin/env ruby18
<string>#!/usr/bin/env ruby
require "#{ENV['TM_BUNDLE_SUPPORT']}/gomate"
Go::go "build", :verb =&gt; "Building"</string>
Go::go "build", :verb => "Building"</string>
<key>input</key>
<string>document</string>
<key>inputFormat</key>
51 changes: 37 additions & 14 deletions Commands/Complete.tmCommand
Original file line number Diff line number Diff line change
@@ -3,32 +3,55 @@
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>saveActiveFile</string>
<string>nop</string>
<key>command</key>
<string>#!/usr/bin/env ruby18
require ENV['TM_SUPPORT_PATH'] + '/lib/ui.rb'
require "open3"
require ENV['TM_SUPPORT_PATH'] + "/lib/ui.rb"
require ENV['TM_SUPPORT_PATH'] + "/lib/escape.rb"
require ENV['TM_SUPPORT_PATH'] + "/lib/tm/require_cmd.rb"
require ENV['TM_SUPPORT_PATH'] + "/lib/tm/htmloutput.rb"
require ENV['TM_SUPPORT_PATH'] + "/lib/exit_codes.rb"
require ENV['TM_SUPPORT_PATH'] + "/lib/web_preview"
require ENV['TM_SUPPORT_PATH'] + "/lib/tm/htmloutput.rb"
# TextMate's special GOPATH used in .tm_properties files prepended to the environment's GOPATH
ENV['GOPATH'] = (ENV.has_key?('TM_GOPATH') ? ENV['TM_GOPATH'] : '') +
(ENV.has_key?('GOPATH') ? ':' + ENV['GOPATH'] : '').sub(/^:+/,'')
# current document
# Call tool to determine gopath
if ENV.has_key?('TM_GO_DYNAMIC_GOPATH')
Dir.chdir(ENV['TM_DIRECTORY']) do
ENV['GOPATH'] = `#{ENV['TM_GO_DYNAMIC_GOPATH']}`.chomp
end
end
gocode = ENV['TM_GOCODE'] || 'gocode'
# load current document from stdin
document = []
File.open(ENV['TM_FILEPATH'], "r+") do |file|
document = file.readlines
while line = $stdin.gets
document.push(line)
end
# byte offset of cursor position from the beginning of file
cursor = document[ 0, ENV['TM_LINE_NUMBER'].to_i - 1].join().length + ENV['TM_LINE_INDEX'].to_i
output = `"$TM_GOCODE" -f=csv -in=#{e_sh ENV['TM_FILEPATH']} autocomplete #{cursor}`
# send document to stdin of gocode and read output
output = ""
Open3.popen3("#{gocode} -f=csv autocomplete #{ENV['TM_FILEPATH']} #{cursor}") {|stdin, stdout, stderr|
stdin.puts document.join
stdin.close
output = stdout.readlines.join
}
# quit if no completions found
TextMate.exit_show_tool_tip("No completions found.") if output.length == 0
# set up images for use by DIALOG
# this probably should be done only once, somehow.
icon_plist = "{ " + [ "const", "func", "package", "type", "var" ].map { |v|
"#{v} = '#{ENV['TM_BUNDLE_SUPPORT']}/icons/#{v}.png';"
"#{v} = '#{ENV['TM_BUNDLE_SUPPORT']}/icons/#{v}.pdf';"
}.join(" ") + " }"
system( ENV['DIALOG'], "images", "--register", icon_plist )
@@ -59,7 +82,7 @@ def make_completion_hash(line)
def get_f_args(sig)
depths = depth_at_i(sig)
pos = sig.index(")")
while pos != nil &amp;&amp; depths[pos] &gt; 0
while pos != nil &amp;&amp; depths[pos] > 0
pos = sig.index(")", pos+1)
end
return sig[ Range.new(sig.index("(")+1, pos - 1) ]
@@ -73,7 +96,7 @@ def make_completion_hash(line)
while pos != nil
if depths[pos] == 0
args &lt;&lt; sig[ Range.new(start, pos-1) ]
args &lt;&lt; sig[ Range.new(start, pos-1) ]
start = pos+1
end
pos = sig.index(",", pos+1)
@@ -91,12 +114,12 @@ def make_completion_hash(line)
insert = ""
end
return { 'match' =&gt; match, 'display' =&gt; display, 'insert' =&gt; insert, 'image' =&gt; image }
return { 'match' => match, 'display' => display, 'insert' => insert, 'image' => image }
end
# build the list of completion choices.
hash = output.split("\n").collect { |v| make_completion_hash( v ) }
options = { :extra_chars =&gt; "_", :case_insensitive =&gt; false }
options = { :extra_chars => "_", :case_insensitive => false }
# if there is only one match, insert. no need to show the menu
if hash.length == 1
@@ -114,7 +137,7 @@ end</string>
<key>hideFromUser</key>
<string>true</string>
<key>input</key>
<string>none</string>
<string>document</string>
<key>inputFormat</key>
<string>text</string>
<key>keyEquivalent</key>
84 changes: 84 additions & 0 deletions Commands/Def.tmCommand
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?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>beforeRunningCommand</key>
<string>nop</string>
<key>command</key>
<string>#!/usr/bin/env ruby18
require ENV['TM_SUPPORT_PATH'] + '/lib/textmate'
require ENV['TM_SUPPORT_PATH'] + '/lib/tm/process'
require ENV['TM_SUPPORT_PATH'] + '/lib/tm/save_current_document'
require 'pathname'
# TextMate's special TM_GODEF or expect 'godef' on PATH
godef_cmd = ENV['TM_GODEF'] || 'godef'
TextMate.save_if_untitled('go')
# load current document from stdin
document = []
while line = $stdin.gets
document.push(line)
end
# byte offset of cursor position from the beginning of file
cursor = document[ 0, ENV['TM_LINE_NUMBER'].to_i - 1].join().length + ENV['TM_LINE_INDEX'].to_i
args = []
args.push(godef_cmd)
args.push('-f')
args.push(ENV['TM_FILEPATH'])
args.push('-o')
args.push("#{cursor}")
# /usr/local/Cellar/go/1.7.1/libexec/src/database/sql/sql.go:960:15
out, err = TextMate::Process.run(*args)
if err.nil? || err == ''
file_details = out.split(':')
file = Pathname.new(file_details[0]).realpath
TextMate.go_to(:file =&gt; file,
:line =&gt; file_details[1].to_i,
:column =&gt; file_details[2].to_i)
elsif err.casecmp "godef: no identifier found";
require "#{ENV['TM_SUPPORT_PATH']}/lib/ui.rb"
package = TextMate::UI.request_string :title =&gt; "Open Package", :default =&gt; '', :prompt =&gt; "Which package do you wish to open?"
#TODO: Find and open package
else
TextMate.exit_show_tool_tip(err)
end</string>
<key>input</key>
<string>selection</string>
<key>inputFormat</key>
<string>text</string>
<key>keyEquivalent</key>
<string>^.</string>
<key>name</key>
<string>Go to Definition</string>
<key>outputCaret</key>
<string>afterOutput</string>
<key>outputFormat</key>
<string>text</string>
<key>outputLocation</key>
<string>toolTip</string>
<key>requiredCommands</key>
<array>
<dict>
<key>command</key>
<string>godef</string>
<key>moreInfoURL</key>
<string>https://github.com/rogpeppe/godef</string>
<key>variable</key>
<string>TM_GODEF</string>
</dict>
</array>
<key>scope</key>
<string>source.go</string>
<key>uuid</key>
<string>A04DD936-EEB1-484E-BF47-98BD6709D00C</string>
<key>version</key>
<integer>2</integer>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -5,40 +5,40 @@
<key>beforeRunningCommand</key>
<string>saveModifiedFiles</string>
<key>command</key>
<string>#!/usr/bin/env ruby18
<string>#!/usr/bin/env ruby
require "#{ENV['TM_BUNDLE_SUPPORT']}/gomate"
Go::godoc
Go::gogetdoc
</string>
<key>fallbackInput</key>
<string>word</string>
<key>input</key>
<string>selection</string>
<string>document</string>
<key>inputFormat</key>
<string>text</string>
<key>keyEquivalent</key>
<string>^h</string>
<key>name</key>
<string>Documentation for Word / Selection</string>
<string>Show Documentation</string>
<key>outputCaret</key>
<string>afterOutput</string>
<key>outputFormat</key>
<string>html</string>
<string>text</string>
<key>outputLocation</key>
<string>toolTip</string>
<key>requiredCommands</key>
<array>
<dict>
<key>command</key>
<string>godoc</string>
<string>gogetdoc</string>
<key>locations</key>
<array>
<string>/opt/local/bin/godoc</string>
<string>/usr/local/bin/godoc</string>
<string>/usr/local/go/bin/godoc</string>
<string>/opt/local/bin/gogetdoc</string>
<string>/usr/local/bin/gogetdoc</string>
<string>/usr/local/go/bin/gogetdoc</string>
</array>
<key>variable</key>
<string>TM_GODOC</string>
<string>TM_GOGETDOC</string>
</dict>
</array>
<key>scope</key>
1 change: 1 addition & 0 deletions Commands/Fmt.tmCommand
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@
<key>command</key>
<string>#!/usr/bin/env bash
. "${TM_SUPPORT_PATH}/lib/bash_init.sh"
. "${TM_BUNDLE_SUPPORT}/go_setup.sh"
(eval "${TM_GOFMT:-gofmt}") || exit_show_tool_tip</string>
<key>input</key>
Loading