microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.55k stars 29k forks source link

`editor.experimentalEditContextEnabled` disrupts extensions like vscodevim and vscode-neovim #228223

Open wenfangdu opened 1 month ago

wenfangdu commented 1 month ago

This new option disrupts extensions like vscodevim and vscode-neovim. These extensions register commands such as type and replacePreviousChar.

Originally posted by @xiyaowong in https://github.com/microsoft/vscode/issues/183814#issuecomment-2343097924

aiday-mar commented 4 weeks ago

Hi thank you for filing this issue. I am not a user of vscode vim or vscode neo vim. Could you please add exact detailed steps for how to reproduce this issue? Could you please include a description of the expected result and the actual result?

wenfangdu commented 4 weeks ago

@aiday-mar Then it's a great time to learn Vim ;). Here's a Vim cheat sheet, https://vim.rtorr.com/, you can compare the commands with editor.experimentalEditContextEnabled on/off, e.g. gg is supposed to go to the top of the editor, G is supposed to go to the bottom of the editor, with editor.experimentalEditContextEnabled on, gg/G don't act as they should. I'm using vscode-neovim, you can start with that too.

aiday-mar commented 4 weeks ago

Hi thanks a lot for the help. I was able to reproduce this issue and after some investigation, I have found that we were not sending the correct payloads in the input events to the commands. The following PR fixes this: https://github.com/microsoft/vscode/pull/229129.

I will close this issue, but please let me know if you continue seeing this issue once the PR is merged, with the VS Code Neovim or Vim commands by opening a new issue.

aiday-mar commented 4 weeks ago

I will reopen this issue. After some more investigation the PR does not completely fix the issue. I will investigate some more

aiday-mar commented 4 weeks ago

After some more investigation, I have made the following PR https://github.com/microsoft/vscode/pull/229166 which I believe now should generally fix all potential issues with extension custom registered commands. One of the issues that the PR fixes is that we were previously setting the cursor states before executing the command, which we should not do, as extensions such as Neovim set the cursor states explicitly.

When next Insiders comes out, please let me know if you continue seeing issues with the extension with the edit context setting enabled.

wenfangdu commented 3 weeks ago

@aiday-mar Well done, it's much better now, I'll leave this open until I see no issues when using experimentalEditContextEnabled with the stable vscode build.

Btw, when will experimentalEditContextEnabled be released in the stable build?

wenfangdu commented 3 weeks ago

@aiday-mar Please see edit.

aiday-mar commented 3 weeks ago

Hi @wenfangdu thanks for the ping. The experimental edit context should be made available in the stable build some time next week when the next stable build comes out.

aiday-mar commented 1 week ago

Hi @wenfangdu pinging you about the issue. The experimental edit context is in the latest Insiders which was released last week. Let me know if you continue seeing issues with this setting.

wenfangdu commented 1 week ago

@aiday-mar Thanks for the reminder, I'll use it for some time and get back to you.

wenfangdu commented 2 days ago

@aiday-mar As I was using vscode-neovim, I did notice one important issue.

OS: macOS 15 VSCode: 1.94.2 IME: Sogou Pinyin

Repro Steps:

  1. Turn on editor.experimentalEditContextEnabled
  2. Quit all vscode instances and reopen
  3. Use IME to input
  4. The IME input box misaligns
  5. Focus the search panel and then focus back to the editor panel
  6. The IME input box aligns correctly

https://github.com/user-attachments/assets/534bddf5-98f4-4c37-8c02-eef7406ddc63