nsf / gocode

An autocompletion daemon for the Go programming language
MIT License
5.01k stars 658 forks source link

Sublime3 plugin performance improvements #531

Closed jeroenrinzema closed 5 years ago

jeroenrinzema commented 5 years ago

As mentioned at the gocode fork of @stamblerre #13. When trying to type in sublime does the view freeze until gocode has returned it's results. This pull requests makes all autocomplete requests called async and are synced with the active view once done.

Before: 48439430-894da080-e786-11e8-9ef9-b4825b953ec3

After: 48561207-c5504500-e8ef-11e8-9967-39ee1c1854b6

nsf commented 5 years ago

Thanks, didn't know anybody uses this plugin. I wrote it for myself mainly as a minimalistic thing. To be honest I'm not sure if I like it or not. It doesn't work as well if you explicitly call autocompletion as I do with ctrl+space. Because it briefly shows default sublime textual autocompletion and then swaps it to gocode's. Maybe I'll fix that one day. Will keep using the old version myself. Never the less, merged it.

jeroenrinzema commented 5 years ago

@nsf Maybe an idea to include a settings option that disables the Sublime default textual autocomplete and only displays the results from gocode? I could also create a PR that resolved the ctrl+space issue.

nsf commented 5 years ago

Thanks, will try it.

frou commented 5 years ago

Thanks for this. I have also been using (a modified version of) the Sublime code.

I just modified @jeroenrinzema's async completion to do the following to stop those uninteresting default completions from flashing up briefly:

https://github.com/frou/GoFeather/blob/976469b29fdfc333e1a312703db7b5b3890a194c/plugin_autocomplete.py#L77-L101

jeroenrinzema commented 5 years ago

@frou Also already made a improved version of the gocode plugin at stamblerre's fork of gocode. I still have to make a PR to this repo to update the plugin.

frou commented 5 years ago

Gee, there's a lot of flux with all these major variations of the overall codebase in play! :)