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

"Stuck" keystroke while waiting for autocomplete popup #1272

Closed
tylerstillwater opened this issue Oct 8, 2017 · 11 comments
Closed

"Stuck" keystroke while waiting for autocomplete popup #1272

tylerstillwater opened this issue Oct 8, 2017 · 11 comments

Comments

@tylerstillwater
Copy link
Contributor

No idea what is causing this or how to start debugging it, but here's what happens:

  1. Type a few characters
  2. Everything stops responding. Can't type anymore or do anything at all.
  3. Last key typed repeats itself about 30 times
  4. Autocomplete popup happens

If I completely disable autocomplete:

    "editor.quickSuggestions": {
        "other": false,
        "comments": false,
        "strings": false
    }

The issue disappears. New issue though: now I don't have autocomplete. :)

@tylerstillwater
Copy link
Contributor Author

Update on this: I recently upgraded my Go version and it seems gocode didn't like that very much.

I deleted everything under $GOPATH/pkg, reinstalled gocode with go install -a, then reinstalled all my packages with go install -a && go test -i. This seems to have "fixed" the issue.

However, there does remain an issue with vscode: if gocode is having trouble or takes a while to respond, VSCode locks up and causes my system to lock up also (though that part might be gocode). Not sure if this is a VSCode issue or a vscode-go issue.

@ramya-rao-a
Copy link
Contributor

Last key typed repeats itself about 30 times

That scares me

if gocode is having trouble or takes a while to respond, VSCode locks up

We could kill the process that calls gocode if it takes say more than 3 seconds.
And if this happens often, then we could disable completion and notify the user to check whats wrong with gocode.

Thoughts?

@tylerstillwater
Copy link
Contributor Author

I'm thinking that perhaps the issue might be gocode chewing up every single free cycle, slowing my system to a crawl and causing everything to behave oddly. I watched my processors the last time it happened and they all spiked to 100%.

However, that still shouldn't cause VSCode to repeat the last keypress as far as I'm concerned. I get the feeling it registers the key down event, gets stuck waiting on gocode, then registers the keyup event. Perhaps it thinks the key is being held? I don't know.

Regardless, I think killing the gocode process would be a decent way to approach this. It may even be worth adding a "fix it for me" popup or something like that. Basically it just cleans out the $GOPATH/pkg directory so everything has to be rebuilt and gocode is happy again.

@tylerstillwater
Copy link
Contributor Author

A bit more here: I just did "go.gocodeAutoBuild": false in my settings and everything is fine now. Not quite sure what is happening, but maybe it's just because I have a large project.

Regardless, it's smooth now. I'll just have to manually build once in a while.

@ramya-rao-a
Copy link
Contributor

Thanks @tylerb for getting back.

@tylerstillwater
Copy link
Contributor Author

tylerstillwater commented Nov 1, 2017 via email

@ramya-rao-a ramya-rao-a reopened this Nov 2, 2017
@ramya-rao-a
Copy link
Contributor

Sorry about that.
Yes, that's true. We should have a timeout on the process that is spawned to run gocode

@tylerstillwater
Copy link
Contributor Author

tylerstillwater commented Nov 2, 2017 via email

@ramya-rao-a
Copy link
Contributor

I'll have to get a repro to understand whats happening behind the scenes
I'll take a look when I get some time

@tylerstillwater
Copy link
Contributor Author

Looks like this is not be the fault of VSCode or the extension. I found pqrs-org/Karabiner-Elements#545 and it appears to be the cause of my issue. The spike in load caused by gocode triggered this issue for me.

@ramya-rao-a
Copy link
Contributor

Wow, I would have never guessed that
Thanks for looping back @tylerb

@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants