-
Notifications
You must be signed in to change notification settings - Fork 657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gocode add restful api #498
Comments
It's a wrong assumption on your side. There is this thing called file cache. Most operating systems do have one. OS caches recently read files in-memory in case if you have free RAM for it. Usually these days people have quite a lot of RAM. Assumption that binary is always re-read from HDD is wrong. I can guarantee that this does not happen on linux. Most likely same behaviour is true for other modern OSes as well. Now as for what visual studio code plugin does - I don't know. With the right setup gocode can return autocompletion response in less than ~100ms for most cases. However "gocode set" command drops gocode cache and gocode ends up re-reading the whole set of libraries your currently edited project uses. Blame vscode plugin authors for that if that's true. If you want an advice from me: I will not add RESTful API to gocode. Hopefully sooner or later gocode will be replaced by a better language server protocol based service if somebody writes it. |
I am using visual studio code + go extension, when request autocomplete ,first send 'gocode set' to get config,then send custom config like gocode set lib-path '/', after that send gocode autocomplete.. command to get autocomplete list. It will call gocode program(about 10M) three times, I'm not using ssd,so it const about 1.2 seconds to show the autocomplete list.
Simply, I modified the gocode client code, add http service(37374) for commands, and write results to http response,
then modified the vsc-go plugin ,using http method instead of calling gocode .
After that, it's very very fast.
So, I think gocode server can provide a restful api .
The text was updated successfully, but these errors were encountered: