Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with the Go maker #43

Closed
lithammer opened this issue Jan 19, 2015 · 5 comments
Closed

Issue with the Go maker #43

lithammer opened this issue Jan 19, 2015 · 5 comments

Comments

@lithammer
Copy link
Contributor

Hi, I'm having some issue with the Go maker which I think might be related to the recent changes to :Neomake vs :Neomake!.

Because Go is compiled and they way stuff are "namespaced" using the :Neomake command doesn't make sense. But using :Neomake! never produces any errors.

Consider this project:

main.go

package main

func main() {
        baz()
}

This produces a compile error because the function baz() isn't available in the package main. And running go build from the terminal shows this:

$ go build
# github.com/renstrom/go-maker
./main.go:4: undefined: baz

And there doesn't seem to be anything wrong with the errorformat either because running :Neomake on the main.go file will correctly tag baz() as undefined. So I'm not really sure what's going on here.

@benekastah
Copy link
Collaborator

Yeah, it looks like go build is not appropriate as a filetype maker (which passes the filename as an argument as you mentioned). Since project-level makers (the :Neomake! kind) have been used far less than filetype makers so far, I haven't come up with a place to put shared ones yet, so suggestions welcome there.

The reason why :Neomake! doesn't report any errors is probably because you don't have any specific makers set up for the project level. Most likely it is just running whatever your makeprg is. If that is make, you will see this if you run :cwindow:

|| make: *** No targets specified and no makefile found.  Stop.
|| 

To get this working for you in the near-term, you can put this in your .vimrc:

let g:neomake_go_maker = neomake#makers#go#go()
let g:neomake_enabled_makers = ['go']

If you want to customize it, copy the config from go.vim and change it as you like. Now :Neomake! will run go build for you.

The permanent solution is to find the right way to share makers for :Neomake! like we do for :Neomake, and move this maker to the appropriate location after that.

@lithammer
Copy link
Contributor Author

Well I'm using vim-go which sets makeprg=go build. So running :Neomake! and :cwindow seems to produce the correct result?

screen shot 2015-01-19 at 19 20 33

Though running "regular" :Neomake and :cwindow doesn't open the quickfix window at all.

@benekastah
Copy link
Collaborator

Yes, it seems like the problem is that :Neomake! does not yet set signs (that feature is only available for a single file). That really needs to be corrected. The regular :Neomake puts its contents into the loclist, so you can open it by running :lwindow.

@benekastah
Copy link
Collaborator

I'm closing this because I think the issue is more compactly addressed in #46. Let me know if there are outstanding issues not addressed by that bug.

@itcowed
Copy link

itcowed commented Mar 16, 2015

i think one thing that was brought up here but not addressed is that it's awkward to have the same program being used as a file maker and a project maker at the same time. often one would like to set different command line options (if it's the same program), or use completely different executables for each task (i use ghci-ng for Neomake and cabal for Neomake! - for instance)

it almost seems like there should be neomake_{ft}{file|project}{cmd}_maker

EDIT: clarified wording

currently i am left to use a wrapper script :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants