From 482ec58ee61da5507dc674e0beebd2a1637387a9 Mon Sep 17 00:00:00 2001 From: Paul Okstad Date: Thu, 6 Sep 2018 08:47:26 -0700 Subject: [PATCH 1/4] infer the GOPATH if not set --- Support/go_setup.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) mode change 100644 => 100755 Support/go_setup.sh diff --git a/Support/go_setup.sh b/Support/go_setup.sh old mode 100644 new mode 100755 index 0e1cf09..753c957 --- a/Support/go_setup.sh +++ b/Support/go_setup.sh @@ -1,4 +1,8 @@ #!/usr/bin/env bash if [ -z "${GOPATH}" ]; then - export GOPATH="${TM_GOPATH}" + if [ -z "${TM_GOPATH}" ]; then + export GOPATH="${HOME}/go" + else + export GOPATH="${TM_GOPATH}" + fi fi From 3cdd7e40ee6dc4fcba80468cb4e677eb47cd0b3d Mon Sep 17 00:00:00 2001 From: Paul Okstad Date: Thu, 6 Sep 2018 08:48:10 -0700 Subject: [PATCH 2/4] add Gomate gogetdoc command --- Commands/Gogetdoc.tmCommand | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Commands/Gogetdoc.tmCommand diff --git a/Commands/Gogetdoc.tmCommand b/Commands/Gogetdoc.tmCommand new file mode 100644 index 0000000..1e5c9c4 --- /dev/null +++ b/Commands/Gogetdoc.tmCommand @@ -0,0 +1,32 @@ + + + + + beforeRunningCommand + nop + command + #!/bin/bash +gomate gogetdoc + + input + selection + inputFormat + text + keyEquivalent + @d + name + Gogetdoc + outputCaret + afterOutput + outputFormat + html + outputLocation + newWindow + scope + source.go + uuid + 5CAB3BF3-E841-43DB-9A5E-B1BA61B2604E + version + 2 + + From 4284da5ba96c095a8475cca5c6057be81d4280fd Mon Sep 17 00:00:00 2001 From: Paul Okstad Date: Thu, 6 Sep 2018 10:26:32 -0700 Subject: [PATCH 3/4] add GOROOT inferring --- Support/go_setup.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Support/go_setup.sh b/Support/go_setup.sh index 753c957..a362407 100755 --- a/Support/go_setup.sh +++ b/Support/go_setup.sh @@ -6,3 +6,11 @@ if [ -z "${GOPATH}" ]; then export GOPATH="${TM_GOPATH}" fi fi + +if [ -z "${GOROOT}" ]; then + if [ -z "${TM_GOROOT}" ]; then + export GOROOT="/usr/local/go" + else + export GOROOT="${TM_GOROOT}" + fi +fi From fd11bc226a05927f36fe6ef2c8d363868c5c9b36 Mon Sep 17 00:00:00 2001 From: Paul Okstad Date: Sat, 8 Sep 2018 09:14:39 -0700 Subject: [PATCH 4/4] Gomate functionality Bundle has been expanded to support Gomate getdoc, references, outline, and notes commands. --- ...tdoc.tmCommand => Gomate getdoc.tmCommand} | 8 +++-- Commands/Gomate install.tmCommand | 33 ++++++++++++++++++ Commands/Gomate notes.tmCommand | 34 +++++++++++++++++++ Commands/Gomate outline.tmCommand | 34 +++++++++++++++++++ Commands/Gomate references.tmCommand | 34 +++++++++++++++++++ README.md | 1 + info.plist | 6 ++++ 7 files changed, 147 insertions(+), 3 deletions(-) rename Commands/{Gogetdoc.tmCommand => Gomate getdoc.tmCommand} (85%) create mode 100644 Commands/Gomate install.tmCommand create mode 100644 Commands/Gomate notes.tmCommand create mode 100644 Commands/Gomate outline.tmCommand create mode 100644 Commands/Gomate references.tmCommand diff --git a/Commands/Gogetdoc.tmCommand b/Commands/Gomate getdoc.tmCommand similarity index 85% rename from Commands/Gogetdoc.tmCommand rename to Commands/Gomate getdoc.tmCommand index 1e5c9c4..1432fe1 100644 --- a/Commands/Gogetdoc.tmCommand +++ b/Commands/Gomate getdoc.tmCommand @@ -5,8 +5,10 @@ beforeRunningCommand nop command - #!/bin/bash -gomate gogetdoc + #!/usr/bin/env bash +. "${TM_BUNDLE_SUPPORT}/go_setup.sh" + +$GOPATH/bin/gomate getdoc input selection @@ -15,7 +17,7 @@ gomate gogetdoc keyEquivalent @d name - Gogetdoc + Gomate getdoc outputCaret afterOutput outputFormat diff --git a/Commands/Gomate install.tmCommand b/Commands/Gomate install.tmCommand new file mode 100644 index 0000000..adf6602 --- /dev/null +++ b/Commands/Gomate install.tmCommand @@ -0,0 +1,33 @@ + + + + + beforeRunningCommand + nop + command + #!/usr/bin/env bash +. "${TM_BUNDLE_SUPPORT}/go_setup.sh" + +${GOROOT}/bin/go get -u github.com/pokstad/gomate/cmd/gomate +${GOPATH}/bin/gomate install + + input + none + inputFormat + text + name + Gomate install/update + outputCaret + afterOutput + outputFormat + html + outputLocation + newWindow + scope + source.go + uuid + 36773731-D5AC-49F4-938C-08EFC7C042D8 + version + 2 + + diff --git a/Commands/Gomate notes.tmCommand b/Commands/Gomate notes.tmCommand new file mode 100644 index 0000000..4f4e33f --- /dev/null +++ b/Commands/Gomate notes.tmCommand @@ -0,0 +1,34 @@ + + + + + beforeRunningCommand + nop + command + #!/usr/bin/env bash +. "${TM_BUNDLE_SUPPORT}/go_setup.sh" + +$GOPATH/bin/gomate notes + + input + none + inputFormat + text + keyEquivalent + ~N + name + Gomate notes + outputCaret + afterOutput + outputFormat + html + outputLocation + newWindow + scope + source.go + uuid + 96924418-0F77-4085-BBA1-194A51EC2880 + version + 2 + + diff --git a/Commands/Gomate outline.tmCommand b/Commands/Gomate outline.tmCommand new file mode 100644 index 0000000..412bf1a --- /dev/null +++ b/Commands/Gomate outline.tmCommand @@ -0,0 +1,34 @@ + + + + + beforeRunningCommand + nop + command + #!/usr/bin/env bash +. "${TM_BUNDLE_SUPPORT}/go_setup.sh" + +$GOPATH/bin/gomate outline + + input + selection + inputFormat + text + keyEquivalent + ~O + name + Gomate outline + outputCaret + afterOutput + outputFormat + html + outputLocation + newWindow + scope + source.go + uuid + 3EA461FE-2FDE-43EF-86DE-F11258319F4E + version + 2 + + diff --git a/Commands/Gomate references.tmCommand b/Commands/Gomate references.tmCommand new file mode 100644 index 0000000..d2f2a69 --- /dev/null +++ b/Commands/Gomate references.tmCommand @@ -0,0 +1,34 @@ + + + + + beforeRunningCommand + nop + command + #!/usr/bin/env bash +. "${TM_BUNDLE_SUPPORT}/go_setup.sh" + +$GOPATH/bin/gomate references + + input + none + inputFormat + text + keyEquivalent + @r + name + Gomate references + outputCaret + afterOutput + outputFormat + html + outputLocation + newWindow + scope + source.go + uuid + 639324A9-89F9-414A-9340-3316966D87A5 + version + 2 + + diff --git a/README.md b/README.md index abd2737..e2d2f3f 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ go get -u github.com/golang/lint/golint | Standard linter go get -u github.com/alecthomas/gometalinter | Combination of multiple linters go get -u github.com/rogpeppe/godef | goto definition go get -u golang.org/x/tools/cmd/gorename | Rename go identifiers +go get -u github.com/pokstad/gomate | Various uses: symbol documentation, references, outline ### TextMate Variables TextMate does not inherit the users environment unless it is launched from the command line. diff --git a/info.plist b/info.plist index 63525e9..cc1c91c 100644 --- a/info.plist +++ b/info.plist @@ -39,6 +39,12 @@ 25CE5652-3DF2-478F-820B-965F6F7F57A4 C2D3D065-3434-4AC0-BB50-5D8676052D1F ------------------------------------ + 36773731-D5AC-49F4-938C-08EFC7C042D8 + 5CAB3BF3-E841-43DB-9A5E-B1BA61B2604E + 639324A9-89F9-414A-9340-3316966D87A5 + 96924418-0F77-4085-BBA1-194A51EC2880 + 3EA461FE-2FDE-43EF-86DE-F11258319F4E + ------------------------------------ 98F0F28C-3B03-4792-AF44-24E2C4327EED submenus