Skip to content
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

keyboard input blocked when enabled with vscodevim #183

Closed
somecho opened this issue Nov 15, 2023 · 6 comments
Closed

keyboard input blocked when enabled with vscodevim #183

somecho opened this issue Nov 15, 2023 · 6 comments
Labels
🐛 bug Defect / Bug

Comments

@somecho
Copy link

somecho commented Nov 15, 2023

👓 What did you see?

When both the vscodevim/Vim plugin and the Cucumber plugin is enabled, the keyboard input is blocked and unresponsive. When Cucumber is disabled, vim key input works as normal. When Cucumber is enabled and Vim is disabled, normal keyboard input also works as normal.

📦 Which tool/library version are you using?

vscodevim: 1.26.2
cucumber: 1.7.0
vscode: 1.84.2

🔬 How could we reproduce it?

Steps to reproduce the behavior:

  1. Install both plugins
  2. Start editing files
@kieran-ryan
Copy link
Member

Hi @somecho, curious! I ran with the same configuration (see below) without issue. I wonder whether there's another external factor? Would you perhaps be able to share a screenshot or screen recording of Visual Studio Code when the issue arose and showing which mode Vim was in at the time; and a screenshot of the 'Output' for the Vim extension in the console window?

Screen.Recording.2023-11-15.at.20.05.33.mov
Screenshot 2023-11-15 at 20 13 31

Version information

Version: 1.84.2 (Universal)
Commit: 1a5daa3a0231a0fbba4f14db7ec463cf99d7768e
Date: 2023-11-09T10:52:33.687Z (6 days ago)
Electron: 25.9.2
ElectronBuildId: 24603566
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Darwin x64 20.6.0
VSCode Vim: 1.26.2
Cucumber: 1.7.0

@somecho
Copy link
Author

somecho commented Nov 21, 2023

Hi! Sorry for the late reply and the accidental duplicate issue, the network glitched just as I submitted the issue. I made a screen recording. I turned off all extensions except Vim. Typed some stuff, then turned on only the cucumber extension. After a little bit of typing, the keyboard input starts to get blocked, but mouse input is fine. The blocked keyboard input behavior happens on all buffers/files, not just cucumber feature files. You can also see the vim output terminal in the recording.

2023-11-21.10-08-50.mp4

Let me know if there's any other information I can provide you with!

@kieran-ryan
Copy link
Member

Thanks for the video @somecho and for taking the time to provide this information. As you are in 'normal' mode in Vim, my expectation would be that no keyboard input to insert or write new text would be accepted until the mode has been changed to 'insert'; however I may be misunderstanding the issue. Is your expectation to be able to insert text in normal mode? Should have mentioned previously, if you can 'Toggle Screencast Mode' through VSCode command palette and show video again, it will allow visibility of your keyword input and what input is not receiving the desired outcome. It could be useful to also see the Output of 'Cucumber Language Server'.

If the functionality of the Vim extension is indeed altered, I would suggest to raise a new issue on the VSCode Vim project including the same information; and link back to this issue. If no one has observed this behaviour with other extensions while using the Vim extension and there is no change required in how the Vim extension is being used; then a further debug and fix may be required in the Cucumber extension. Thanks again for capturing, hopefully we can find a root cause.

@somecho
Copy link
Author

somecho commented Nov 27, 2023

Hello! Yes, in 'normal' mode, no keys will be entered, however keyboard input is still blocked, meaning cursor movements do not happen, hence the momentary pauses in the video where the cursor stops moving. Also, it seems like when the keyboard input is unblocked, the keys pressed during the blockage gets entered after wards, hence also the line of gibberish near the end of the clip.

Here's an output of cucumber language server:

[Info  - 12:08:32 PM] Initializing connection from Visual Studio Code 1.84.2
[Info  - 12:08:32 PM] Root uri    : file://d:\code\PROJ
[Info  - 12:08:32 PM] Current dir : C:\Users\scho\AppData\Local\Programs\Microsoft VS Code
[Info  - 12:08:32 PM] Registering request handler for workspace/didChangeConfiguration failed.
[Info  - 12:08:32 PM] Client does not support client/registerCapability. This is OK.
[Info  - 12:08:32 PM] Cucumber Language Server 1.4.0 initialized
[Info  - 12:08:32 PM] Scheduling reindexing in 3000 ms
[Info  - 12:08:32 PM] Scheduling reindexing in 3000 ms
[Info  - 12:08:32 PM] Reindexing file://d:\code\PROJ
[Info  - 12:08:34 PM] * Found 5 feature file(s) in ["src/test/**/*.feature","features/**/*.feature","features/*.feature","tests/**/*.feature","test/**/*.feature","**/test/features/*.feature","features/*.feature","**/features/*.feature","/features/*.feature","*specs*/**/.feature"]
[Info  - 12:08:34 PM] * Found 36 steps in those feature files
[Info  - 12:08:35 PM] Reindexing file://d:\code\PROJ
[Info  - 12:08:52 PM] * Found 5 feature file(s) in ["src/test/**/*.feature","features/**/*.feature","features/*.feature","tests/**/*.feature","test/**/*.feature","**/test/features/*.feature","features/*.feature","**/features/*.feature","/features/*.feature","*specs*/**/.feature"]
[Info  - 12:08:52 PM] * Found 36 steps in those feature files
[Info  - 12:08:52 PM] * Found 609 glue file(s) in ["features/**/*.js","features/*.js","**/features/*.js"]
[Info  - 12:08:52 PM] * Found 0 parameter types in those glue files
[Info  - 12:08:52 PM] * Found 19 step definitions in those glue files
[Info  - 12:08:52 PM] * Built 22 suggestions for auto complete
[Info  - 12:09:07 PM] * Found 609 glue file(s) in ["features/**/*.js","features/*.js","**/features/*.js"]
[Info  - 12:09:07 PM] * Found 0 parameter types in those glue files
[Info  - 12:09:07 PM] * Found 19 step definitions in those glue files
[Info  - 12:09:07 PM] * Built 22 suggestions for auto complete
[Info  - 12:09:30 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:31 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:31 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:31 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:31 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:31 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:32 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:32 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:32 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:32 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:33 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:33 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:33 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:33 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:33 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:33 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:33 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:33 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:34 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:34 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:34 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:34 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:34 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:34 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:34 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:34 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:34 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:35 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:35 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:35 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:35 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:35 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:35 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:35 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:35 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:35 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:36 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:36 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:36 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:36 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:36 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:36 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:36 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:37 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:38 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:38 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:38 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:38 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:38 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:39 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:41 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:42 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:43 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:46 PM] Reindexing file://d:\code\PROJ
[Info  - 12:09:48 PM] * Found 5 feature file(s) in ["src/test/**/*.feature","features/**/*.feature","features/*.feature","tests/**/*.feature","test/**/*.feature","**/test/features/*.feature","features/*.feature","**/features/*.feature","/features/*.feature","*specs*/**/.feature"]
[Info  - 12:09:48 PM] * Found 36 steps in those feature files
[Info  - 12:10:03 PM] * Found 609 glue file(s) in ["features/**/*.js","features/*.js","**/features/*.js"]
[Info  - 12:10:03 PM] * Found 0 parameter types in those glue files
[Info  - 12:10:03 PM] * Found 19 step definitions in those glue files
[Info  - 12:10:03 PM] * Built 22 suggestions for auto complete

Another thing I observed is that when I open a feature file, an indexing is scheduled, followed by the actual indexing later. It turns out the keyboard input gets blocked during the time it is looking for glue files.

[Info  - 12:09:43 PM] Scheduling reindexing in 3000 ms
[Info  - 12:09:46 PM] Reindexing file://d:\code\PROJ
[Info  - 12:09:48 PM] * Found 5 feature file(s) in ["src/test/**/*.feature","features/**/*.feature","features/*.feature","tests/**/*.feature","test/**/*.feature","**/test/features/*.feature","features/*.feature","**/features/*.feature","/features/*.feature","*specs*/**/.feature"]
[Info  - 12:09:48 PM] * Found 36 steps in those feature files
[Info  - 12:10:03 PM] * Found 609 glue file(s) in ["features/**/*.js","features/*.js","**/features/*.js"]
[Info  - 12:10:03 PM] * Found 0 parameter types in those glue files
[Info  - 12:10:03 PM] * Found 19 step definitions in those glue files
[Info  - 12:10:03 PM] * Built 22 suggestions for auto complete

Here for example, it took 15s to find 609 glue files, during which the keyboard input is blocked.

The indexing does not occur when you reopen an indexed feature file. However, when you update the feature file, e.g. add a new step or modify one, the reindexing occurs and keyboard input is once again blocked.

I hope this information helps!

@kieran-ryan
Copy link
Member

kieran-ryan commented Dec 3, 2023

Here for example, it took 15s to find 609 glue files, during which the keyboard input is blocked.

Based on this information (a large number of glue files and the number of seconds to read them) the issue appears to relate to an existing performance issue with the extension (#152).

@somecho, to validate this assumption, would you be able to test this with a project containing a smaller number of glue files, or by temporarily specifying a subset of your existing glob patterns; and indicate whether you observe keyword input being blocked for a shorter period of time or not at all? If this is true, that would explain why I was unable to reproduce the issue, as I tested the extensions together with a small step definition example - having a small compute footprint. Further, if this is the case, perhaps we can mark this issue as a duplicate of the performance issue - which will need some work to define a solution.

@kieran-ryan kieran-ryan added the 🐛 bug Defect / Bug label Dec 7, 2023
@kieran-ryan
Copy link
Member

@somecho, thanks for your support - I was able to reproduce with the Vim extension by creating a large number of step definitions - I will link to the performance issue and close this ticket. Would require the implementation of a caching mechanism in the underlying Language Service to resolve rather than complete reindexing of the workspace on every write - PRs are welcome, so feel free to take a look if of interest. Thanks for your contribution, will keep you posted on any update

@kieran-ryan kieran-ryan closed this as not planned Won't fix, can't repro, duplicate, stale Jan 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Defect / Bug
Projects
None yet
Development

No branches or pull requests

2 participants