/autocomplete-go

An Atom autocomplete-plus provider for the Go language that uses gocode to provide suggestions.

Primary LanguageJavaScriptOtherNOASSERTION

autocomplete-go Build Status Build status

An autocomplete-plus provider for the go language that uses gocode to provide suggestions.

Prerequisites

This package requires the following packages to be installed:

Additionally, you should have gocode installed and available on your path:

go get -u github.com/nsf/gocode

If you have the go-get package installed, this package will prompt you to get gocode (if it is missing) or update gocode (if it is out of date).

FAQ

I am not getting suggestions I expect!

gocode uses the output from go install to provide its suggestions. You have a few options to ensure you always get up-to-date suggestions:

  • Always run go install ./... in your package when you make a change
  • Run gocode set autobuild true to have gocode attempt to run go install ./... for you
  • Configure a package (like build) to run your build command on every save

Configuration

  • scopeBlacklist: Suggestions will not be shown when the cursor is inside the specified comma-delimited scope(s) (default: .source.go .comment)
  • suppressBuiltinAutocompleteProvider: Suppress the provider built-in to the autocomplete-plus package when editing .go files (default: true)
  • suppressActivationForCharacters: Suggestions will not be provided when you type one of the specified characters (default: comma, newline, space, tab, /, \, (, ), ", ', :, ;, <, >, ~, !, @, #, $, %, ^, &, *, |, +, =, [, ], {, }, `, ~, ?, -)
  • snippetMode: Snippets can be generated when inserting the suggestion for a func; this option allows you to control what is generated (default: name)
    • name: E.g.: fmt.Println(a) with a selected such that it will be replaced on the first keystroke
    • nameAndType: E.g.: fmt.Println(a ...interface{}), with a ...interface{} selected such that it will be replaced on the first keystroke
    • none: E.g.: fmt.Println(), with the cursor placed between the parenthesis