golang / sublime-build

The official Sublime Text package for Go build system integration.
BSD 3-Clause "New" or "Revised" License
344 stars 46 forks source link

Cannot navigate from build errors to source code location. #3

Closed ChrisHines closed 8 years ago

ChrisHines commented 8 years ago

When the compiler produces errors in the form file/path.go:19 undefined asdf we should be able to select the error or navigate to prev/next build result with the Sublime build system navigation commands. This does not seem possible yet.

jbuberel commented 8 years ago

@wbond Can you comment on what would be required to add this support to the build output console?

wbond commented 8 years ago

It looks like we need to add result_file_regex, result_line_regex and result_base_dir settings to the output. I need to check and make sure those will work with the output panel name we are using. We may have to use the default build system output panel to get those commands to work.

I'll work on a CL for this.

natefinch commented 8 years ago

This would definitely make the package 1000 times more useful.... being able to click on the name of the file and go to a compile error is really the main reason I'd want to build inside sublime.

jbuberel commented 8 years ago

The only tricky part that I can think of is the case of a multi-entry $GOPATH. In fact, I think there are several interesting use cases to consider because the Go compiler may emit path information that is relative to some portion of the GOPATH. This may not map directly to your Sublime project folder settings:

I'm not saying the package should support all of these, but that we should be clear about which of them are supportable.

wbond commented 8 years ago

CL posted at https://go-review.googlesource.com/#/c/16153/.

@jbuberel The filename output from go is relative to the working directory, so I was able to get the correct behavior just by setting the result_base_dir setting to the working directory.

jbuberel commented 8 years ago

Just pushed v0.8.1 tag. This feature is now available. On Windows, I am able to double-click an entry in the console output, and it will take me to that file:line combination.

natefinch commented 8 years ago

Works for me on linux. Nice work! This is awesome!