alanquatermain / go-tmbundle Goto Github PK
View Code? Open in Web Editor NEWA TextMate bundle for the Go programming language.
Home Page: http://alanquatermain.net/
License: Other
A TextMate bundle for the Go programming language.
Home Page: http://alanquatermain.net/
License: Other
Any why isn't /usr/local/bin
one of them?
this might be my dumbness or change in go but this is what i get.. http://d.pr/i/JzsS any ideas why?
var (
factories = make(map[string]func() (Collector, error))
collectorState = make(map[string]*bool)
)
func registerCollector(collector string, isDefaultEnabled bool, factory func() (Collector, error)) {
// ...
}
Note that everything is black after collectorState
variables.
I get an indentation error when pressing return after the last "}" when writing a function.
Keep up the good work!
Hi,
I tried using the bundle to give go a try but I cannot make it works. Go is installed by homebrew and I have all the go* binaries in my path but when I hit Apple+R all I get is an error "Couldn't find g" with all the locations in the search PATH printed below.
I tried to find where the error occured in the code without luck (the path followed is not easy to find with one executable calling another and another including another one xD).
Any idea what could go wrong ?
The current PATH is:
/usr/bin
/bin
/usr/sbin
/sbin
Please add the directory containing “gocode” to PATH in TextMate's Shell Variables preferences.
Alternatively, the PATH can be retrieved from Terminal but this requires a relaunch:
Do I need to set up a PATH (not mentioned in README) or is it a bug in the bundle? I installed go via brew.
When compiling (⌘K), if there's an error in compiler output, clicking on it's link jumps to the file in question, but not the offending line. It happens because the following TextMate link is generated:
txmt://open?line=&url=file:///Users/gunca/Desktop/test.go
TextMate Version 1.5.10 (1623)
Bundle version: tip
go fmt uses tabs, and ctrl+shift+h uses spaces. I opened gomate.rb and found this:
if ENV['TM_SOFT_TABS'] && ENV['TM_SOFT_TABS'] == 'YES'
args.push('-tabs=true')
else
args.push('-tabs=false')
end
Isn't the logic reversed here?
When formatting a Go file in TextMate with this bundle, I get:
flag provided but not defined: -tabwidth
usage: gofmt [flags] [path ...]
-cpuprofile="": write cpu profile to this file
-d=false: display diffs instead of rewriting files
-e=false: report all errors (not just the first 10 on different lines)
-l=false: list files whose formatting differs from gofmt's
-r="": rewrite rule (e.g., 'a[b:len(a)] -> a[b:]')
-s=false: simplify code
-w=false: write result to (source) file instead of stdout
This seems to be caused by this line:
Line 80 in 42b66fe
I didn't see this error with go1.2.
$ go version
go version go1.3 darwin/amd64
I've just installed go using the default binary install for MacOS X (x64 arch), and the "compile" bundle command doesn't work with this error : "Couldn't find 6g".
Don't know whether that's expected, but I just wanted to let you know.
It appears that strings, and I guess runes too, but they are only single characters, do not create custom syntax blocks as the language specifies. E.g. this should not be a comment:
"https://example.com"
I'm not sure what stage it fails at, but it treats the part of the filename before the space as the entire filename.
For instance, if the .go file resides in
/Users/kelsey/One Two/
, the Run command fails with
: fatal error: open /Users/kelsey/One:: No such file or directory
The following Go compiler error doesn't get turned into a source code link:
rest.go:255: syntax error: unexpected name, expecting semicolon or newline or }
The problem is that Go::link_errs
sees that there are three :
characters on the line and tries to interpret what's between the second and third :
s as a column number, which doesn't work.
link_errs
should probably not be counting colons like this. Instead it should use a single regex that optionally recognizes a column number if it's present.
The following examples will illustrate the issue because github uses your go-tmbundle for syntax highlighting:
One line function head:
func OneLiner(w io.Writer, r io.Reader) {}
Across lines function head:
func OneLiner(
w io.Writer,
r io.Reader,
) {}
Selection behavior of double-clicking in Go code is weird and annoying in some contexts:
foo := bar()
, double-clicking foo
also selects the space after it.var foo = 0
, double-clicking foo
also selects the space before it.This must be due to some subtlety of the language-grammar file, but I don't know nearly enough about those to be able to diagnose the problem.
Since goimports is a superset of gofmt functionality, (perhaps optionally) using it instead of gofmt on save not only formats code, but handles imports as well.
Since I've upgraded to OSX Mavericks, the gocode completion stopped working.
Gocode is installed, TextMate has both TM_GOCODE and PATH configured to reach the gocode binary.
I also have SublimeText 2 installed, it's gocode completion works fine.
Is there any way to debug this, console output, text mate bundle output?
Not sure what I'm missing. Bundle seems to be installed correctly. Syntax highlighting works. Made sure that /user/local/go/bin is in the path. However Command+R doesn't make window pop up. Nothing happens. Any clue what might be the problem?
i am not sure if this is the best place to raise this....i get this error when i try to compile with a golang bundle. i hoping somebody can help me resolve this issue. prog compiles and works fine using command line -
:29:in require': no such file to load -- /Applications/TextMate.app/Contents/SharedSupport/Support/lib/Builder (LoadError) from :29:in
require' from /Users/ns/Library/Application Support/TextMate/Bundles/Go.tmbundle/Support/goerrs.rb:3:in ' from :29:in
require' from :29:in require' from /Users/ns/Library/Application Support/TextMate/Bundles/Go.tmbundle/Support/gomate.rb:5:in
' from :29:in require' from :29:in
require' from /tmp/temp_textmate.KoOLaG:3:in `'
Hi! It'd be great if the syntax highlighting could support accent characters.
Please also checkout related issues: github-linguist/linguist#3118 (comment) and atom/atom#10309
Hello,
The last version has support for Textmate 1?
It would be nice to be able to use goimports in place of gofmt. Maybe with an environment variable?
Example: https://github.com/cockroachdb/cockroach/blob/master/pkg/server/server.go#L406-L414
ClusterID
is purple and AnnotateCtxWithSpan
is orange. The only difference I can tell is that this occurs when there are multiple returned items (itemOne, itemTwo)
vs just one uuid.UUID
When a type X func()
is introduced it should not expect {}
When I press esc in a .go file, I get:
Can't find “gocode” on PATH.
The current PATH is:
/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin
/usr/X11/bin
/usr/local/sbin
/Users/daryls/programming/golang/go/binPlease add the directory containing “gocode” to PATH in TextMate's
Shell Variables preferences.Alternatively, the PATH can be retrieved from Terminal but this
requires a relaunch:Set PATH and Relaunch.
So, I press Esc then TextMate 2 freezes.
Illustrating with function highlighting in Github (which uses this package)
// A does not have a function body (implemented in assembly for example).
func A() int
// B is not highlighted correctly.
func B(a, b int) int { return a+b }
When invoking the "Tidy" command with a recent release of go, the command fails because gofmt doesn't support the -oldprinter option anymore.
/Users/user/Library/Application Support/TextMate/Bundles/go.tmbundle/Support/goerrs.rb:3:in `require': no such file to load -- /Applications/TextMate.app/Contents/SharedSupport/Support/lib/Build
I don't have a Build.rb in this directory.. are there any dependencies to other bundles?
"%q" in a format string such as passed to fmt.Printf shows in red.
It'd be best to allow the bundle to be selected/installed from the Bundle preference pane of TM2. That would make installation even easier.
When invoking the "Tidy" command with the last release of go, the command fails because gofmt doesn't support the -oldparser option anymore.
The Go highlighter sometimes highlights percent signs in strings, even though the usage of the string is not as a C-style printf format string, but an ordinary literal string.
Example:
https://github.com/mcandre/mcandre/blob/master/go/ddg/ddg.go
My global Textmate 2 preferences are tabSize = 2, softTabs = true. This bundle rewrites the 2-spaces as tabs on save. For troubleshooting, disabling Go > Themes or Go > Language Grammars > Go stops the rewrites on save. Other language bundles function correctly.
The "Compile" command (Cmd-K) is only useful for single-file executables. When building a package, or even a multi-file executable, it'll fail with undefined-symbol errors because it only tries to compile the one source file being edited.
A "Build" command that runs "go build" in the current file's directory would be more useful. The sdefresne fork of this repo already has it; hopefully it's easy to move over.
https://github.com/nhooyr/color uses %r as a verb. I don't think we should highlight unrecognized verbs as invalid, rather just ignore them as normal strings.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.