GoLand code completion
Hi, is there a way to enable code completion in JetBrain's GoLand IDE?
I have a magefile.go and also the project has a go.mod file. I can't get the IntelliSense to autocomplete any of the magefile/mage methods.
Anyone knows if it is possible?
Thanks
If you're trying to autocomplete inside the magefile itself... you probably have to tell your editor to include the mage build tag in its compilation to get auto-complete. This is an unfortunate problem with most IDE's autocomplete in that if the current file has a build tag, they won't autocomplete.
I just ran into the same problem. It seems that the only solution is to add mage to the custom tags as described here:
https://www.jetbrains.com/help/go/configuring-build-constraints-and-vendoring.html#
It looks like doing this though means you also end up getting autocompletion on mage exports in non-mage .go files.
I did a little bit of research, and I wasn't able to find a way to quickly change between build tags. There might be an open issue for Jetbrains GoLand to do this.
Thanks @ghostsquad! It works perfectly! I'm ok with completion on other files if that mean that I can create mage files with autocompletion help.
@natefinch is it ok to add this info somewhere in the docs? Which section would be a good place to make a PR?