Skip to content
This repository has been archived by the owner on Feb 17, 2021. It is now read-only.
/ gocode Public archive
forked from mdempsky/gocode

An autocompletion daemon for the Go programming language

License

Notifications You must be signed in to change notification settings

stamblerre/gocode

Repository files navigation

Autocompletion/refactoring daemon for Go language.

Work in progress..

Currently available things:
 - .a (archive aka package) type info parser
 - type inference (more or less complete)
 - vim plugin (omnifunc autocompletion)
 - autocompletion
 - renaming (semicomplete, not well tested)

Screenshots:
 http://nsf.github.com/images/gocode1.png
 http://nsf.github.com/images/gocode2.png
 http://nsf.github.com/images/gocode3.png
 http://nsf.github.com/images/gocode4.png

Demo:
 http://nsf.110mb.com/gocode-demo.swf (3.6mb)
 http://nsf.github.com/images/gocode-renaming-demo.swf

Short usage guide:

Everything is pretty simple. Just 'make install' it and make sure it
is available on your PATH (vim plugin assumes that).

In order to install vim plugin you need to have vim scripts installed
from the Go source tree ($GOROOT/misc/vim). After that just run
'update.sh' script from the 'vim' dir in the gocode source tree. It
will work on mac and linux (installs vim plugin files in ~/.vim/...).
Make sure you have 'filetype plugin on' in vim and you're done! Use
<C-x><C-o> for omnicompletion.

Daemon is started automatically and it is panic-safe. Means if it dies
with a panic during autocompletion, it will drop its cache and
continue serving requests. On panic it prints stack trace also. In order
to see a stack trace you may want to run it manually somewhere in the
terminal using this command: 'gocode -s'. If the daemon was started
previously, you can shut it down using this command: 'gocode close'.

In order to use renaming functionality simply type ":GocodeRename"
when the cursor is on top of an identifier. Vim will ask you for a new
name and do the job. But keep in mind that this feature is still in
development and may contain bugs. Do backups or use source code
management system (git, hg or whatever).

NOTE: If you want to use a non-default Go compiler library path, use
'lib-path' config variable (gocode set lib-path "<path">). The default
is (in terms of previously existed environment variables):
$GOROOT/pkg/$GOOS_$GOARCH

NOTE: I'm trying to keep git master branch always in a working state.
Therefore it's safe and a good idea to keep your app in sync with git
repo.

NOTE: Gocode always requires the latest Go compiler version.

Bug reports:

If something doesn't work as expected, post your issues here:
http://github.com/nsf/gocode/issues

About

An autocompletion daemon for the Go programming language

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 65.8%
  • Emacs Lisp 19.9%
  • Python 6.8%
  • Vim Script 5.6%
  • Shell 1.9%