Giter Club home page Giter Club logo

Comments (10)

The-Compiler avatar The-Compiler commented on July 3, 2024

Reply by @stevenguh over in #38:

For this case, it can be adjacent to original issue. But let's open another issue to track it. I think the cause of this is probably because multiple onDidChangeValue events are called before the pervious one has a chance to complete, and the time to finish onDidChangeValue probably also increased by #34. Two attempts in my heads are

  1. Have a queue to batch the onDidChangeValue to handle event in sequence. However, probably won't work by itself for the upcoming 1.57 (#34) due to how we modify the input.
  2. Change the input handling completely to eliminate modification of the input field.

indeed it gets much better when I set whichkey.delay to 1 instead of 0. Maybe that logic should be active in some way even without a delay

The difference is that

const updateQuickPick = async () => {
this.quickPick.busy = false;
this.enteredValue = '';
await this.setValue('');
this.quickPick.title = this.title;
this.quickPick.items = this.items;
};

is running on asynchronously when delay is 1. The might be due to us needing to have a workaround to await for set value for #34.
@The-Compiler Wondering what's the version of vscode you are running? Can you also try which-key version v0.8.4 to see if it's any better? Btw, I am also having trouble reproducing the issue on my computer

from vscode-which-key.

The-Compiler avatar The-Compiler commented on July 3, 2024

I'm on VS Code 1.56.2 on Archlinux:

Version: 1.56.2
Commit: 054a9295330880ed74ceaedda236253b4f39a335
Date: 2021-05-12T16:45:26.313Z
Electron: 12.0.4
Chrome: 89.0.4389.114
Node.js: 14.16.0
V8: 8.9.255.24-electron.0
OS: Linux x64 5.12.3-arch1-1

What's the easiest way I can try the older version? I'm trying to get a development setup, but no dice so far - I'll open a separate issue for that, though chances are that's a problem on my side of some sorts.

from vscode-which-key.

stevenguh avatar stevenguh commented on July 3, 2024

Thanks for opening a well organized separate issue 😄

What's the easiest way I can try the older version? I'm trying to get a development setup, but no dice so far - I'll open a separate issue for that, though chances are that's a problem on my side of some sorts.

You can choose to Install Another Version from the extension page of VSCode.
image

from vscode-which-key.

The-Compiler avatar The-Compiler commented on July 3, 2024

Sorry for the looong delay, I kinda lost track of this one (but it still trips me up from time to time 😅).

Indeed v0.8.4 works fine, and a git bisect tells me that 3212562 ("Fix the onDidChangeValue API change of QuickPick") introduced the issue.

If you're on Linux, the easiest way to reproduce this is sleep 2 && xdotool type ' pf' and then focusing the VS Code window. In about 3 out of 4 cases, this will result in being in the "Project" menu, rather than the file menu.

from vscode-which-key.

stevenguh avatar stevenguh commented on July 3, 2024

Indeed v0.8.4 works fine, and a git bisect tells me that 3212562 ("Fix the onDidChangeValue API change of QuickPick") introduced the issue.

Thanks for tracking it down 😄 I suspect that would be that case since that commit introduced a lot more awaits in order get around vscode API change while keeping existing model. vscode api 🤦🏻‍♂️

  1. Have a queue to batch the onDidChangeValue to handle event in sequence. However, probably won't work by itself for the upcoming 1.57 (#34) due to how we modify the input.
  2. Change the input handling completely to eliminate modification of the input field.

Those two options I mentioned are still applicable, but I'd like to push the new version out first then come back to this.

If you're on Linux, the easiest way to reproduce this is sleep 2 && xdotool type ' pf' and then focusing the VS Code window. In about 3 out of 4 cases, this will result in being in the "Project" menu, rather than the file menu.

I don't have a native linux, I probably will setup a VM for it when I get to this.

from vscode-which-key.

The-Compiler avatar The-Compiler commented on July 3, 2024

What OS are you on? I do have access to Windows and macOS 10.14, so I can find a similar reproducer there most likely.

from vscode-which-key.

stevenguh avatar stevenguh commented on July 3, 2024

I have access to macOS and Windows. It will speed things up if you can find a way to reproduce on one of those platforms :)

from vscode-which-key.

The-Compiler avatar The-Compiler commented on July 3, 2024

Hah, while trying to find a reproducer there, I just discovered that the issue actually vanished after upgrading to VS Code 1.57.0 🎉

If you were using the Insiders Build that might've been the reason why you couldn't reproduce it! If you still want to track this down, download the older VS Code and:

Windows

^j::
Send, {Space}
Sleep, 100
Send, pf
return
  • Double click it
  • Press Ctrl-j in VS Code.

macOS

  • Run sleep 2 && osascript -e 'tell application "System Events" to keystroke space' -e 'tell application "System Events" to keystroke "pf"'
  • Grant permissions
  • Run again
  • Switch to VS Code

But probably not worth the trouble, given that this is a corner case which doesn't appear with the newest VS Code version now. So if you prefer, feel free to close! 😅

from vscode-which-key.

stevenguh avatar stevenguh commented on July 3, 2024

If it doesn't appear in the latest version, let's close this one. We can reopen it if it appears again and spend some time attempting to fix it on our side.

from vscode-which-key.

The-Compiler avatar The-Compiler commented on July 3, 2024

Agreed, thanks!

from vscode-which-key.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.