gotools-sublime
gotools-sublime copied to clipboard
improve gocode performance
Current gocode's auto-complete affects input fluency badly.
Think about to improve it, for example:
- keep a gocode process running, rather than open a process for each calling. use gocode's daemon mode?
- add a setting for only triggering auto-completion after several punctuation
Ideas before can be implemented:
- gocode is daemon by default.
- ST doesn't provide the API to get the word separator.
Just simple improvement according to gocode command and on_query_completions' arguments. https://github.com/liuhewei/gotools-sublime/commit/c70de8cb5bd0911090af2a479cd02ee3e9353915
New ways to optimize:
- Use golangconfig to optimize the ToolRunner.run: - don't need to search for gocode path everytime. - config PATH to reduce the search: https://github.com/golang/sublime-config/blob/master/docs/user.md
- gocode new build arg?
go get -u -ldflags -H=windowsgui github.com/nsf/gocode
I've used golangconfig to replace gotools_settings in v1.0.3. Then, the ToolRunner.run needn't search for toolpath everytime, so the performance is great now. I think the issue can be closed.
mdempsky/gocode
is an improved fork of the original nsf/gocode
, refer to: https://github.com/mdempsky/gocode/commit/e117c263fb7092eedd7cab24f41d90a9d76bd23a
@liuhewei mdempsky/gocode
has implemented client mode, which improves performance significantly https://github.com/mdempsky/gocode/issues/11
@jostyee Thanks for the information. Is it enough to use mdempsky/gocode
instead of nsf/gocode
binary file?
I've tried mdempsky/gode, it has really better performance than nsf/gocode. Thanks @jostyee :-)
@liuhewei I've been using this lib for nearly half a year and very satisfied with it.
Don't forget to set -sock=none
to enable client mode.
This flag -sock
is not compatible with nsf/gocode, am I right? Any way, mdempsky/gocode is fast enough in my environment :)
@liuhewei https://github.com/nsf/gocode/blob/46e8fd2234a86934e3e8496c7405984ff7b18df5/gocode.go#L17
mdempsky/gocode
add a none
value to this flag.