Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Let gocode do the work #2

Closed
keks opened this issue Feb 27, 2014 · 10 comments
Closed

Let gocode do the work #2

keks opened this issue Feb 27, 2014 · 10 comments

Comments

@keks
Copy link

keks commented Feb 27, 2014

The Go toolchain contains gocode, a daemon that does everything for you (not sure about snippets), you just have to interface it. That way the extension doesn't have to be changed for different go syntax versions and always works with the installed version of go. The current parser should be kept as fallback though, so it still works if the official go toolchain is not installed/properly configured.

@keyneston
Copy link

A couple minor points gocode is an external depedency: https://github.com/nsf/gocode. Second it doesn't do syntax highlighting instead it does auto-completion.

Go does distribute in its misc directory syntax highlighting files for vim/emacs/sublime.

@joefitzgerald
Copy link
Contributor

atom-jshint has an example that could be used as a prototype for gocode integration.

Might play around with this this weekend.

@mattetti
Copy link

I think gocode support would be great but it should live as its own package, not part of the core lang package.

@joefitzgerald
Copy link
Contributor

I can see value in it being part of the core package (perhaps disabled by default). I am also sympathetic to the argument that it is an external dependency and so should be a separate package.

On the one hand you have ease of use for new users (who are most likely to need auto-completion, and who might not know where to go to get it if it requires additional action) and on the other hand you have valid concerns about scope and modularity.

Not sure who the ultimate arbitrator is between the two positions. @kevinsawicki is there any scope boundary for a language-<lang> package that we need to be cognizant of here?

@apires
Copy link

apires commented Mar 12, 2014

👍 for something like "language-go-autocomplete"

Gocode will only do autocomplete based on the compiled symbols it can find, so it's nice to still have a the regular auto-complete (or something like godef) as a backup.

I have a bit of code that will call out to gocode and get a definition, but without the Issue#18 from atom/autocomplete it seems like i'd have to replace autocomplete with a go-specific autocomplete?

@kevinsawicki
Copy link
Contributor

@joefitzgerald the current scope of the language-* packages has been syntax highlighting, snippets, and language properties such as folding and indent patterns.

That's not to say they couldn't do more, but none of them currently do more than those things.

So I would think gocode integration would be in a separate package as @mattetti mentioned

@joefitzgerald
Copy link
Contributor

I've added an issue in the go-plus repo for this: joefitzgerald/go-plus#2

@apires Can you share the code you have that calls out to gocode?

@apires
Copy link

apires commented Mar 20, 2014

It's a bit overly symplistic, it has my name hardcoded in it in this form (that should be $GOPATH/bin/gocode) and doesn't do anything too clever:

https://gist.github.com/apires/9671820

@probablycorey
Copy link

It looks like @joefitzgerald's go-plus package is doing a lot of the things mentioned in this issue.

@joefitzgerald
Copy link
Contributor

Just to add to @probablycorey's statement, joefitzgerald/go-plus#2 will specifically address autocomplete, but is blocked behind work required to extend autocomplete-plus and its provider API so that it is asynchronous. v2.0 of go-plus will be released next week, after which autocomplete-plus work and then gocode integration will occur.

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

No branches or pull requests

7 participants