kasecato / vscode-intellij-idea-keybindings

Port of IntelliJ IDEA key bindings for VS Code.
https://marketplace.visualstudio.com/items?itemName=k--kato.intellij-idea-keybindings
MIT License
827 stars 135 forks source link

`jumpToNextSnippetPlaceholder` on `Enter` unexpected behaviour #343

Closed ladusee closed 7 months ago

ladusee commented 7 months ago

This keybinding recently started to interfere with basic editor behavior.

Command: jumpToNextSnippetPlaceholder Keybinding: Enter When: editorTextFocus && hasNextTabstop && inSnippetMode Source: IntelliJ IDEA Keybindings

This gets triggered when accepting suggestion/autocomplete in some cases - instead of accepting selected suggestion cursor jumps outside of brackets. Caught it in JSX/TSX syntax when working with attributes/props.

Removing this keybinding fixed the issue.

Steps to reproduce:

  1. create an HTML div element in js/ts/jsx/tsx file
  2. add style attribute. When editor suggests style - select it
    <div style={~cursor is here after accepting suggestion~} />
  3. press Enter

Expected result:

<div style={
     ~cursor is here~
} />

Actual result (cursor jumped outside of brackets):

<div style={}~cursor is here~ />

This issue is not JSX-specific, happened in regular JS/TS as well. Seems to be related to When keybinding instructions and should be reproducible in other languages.

lgou2w commented 7 months ago

I'm having the same problem with the Rust language.

Pressing Enter when suggestion/autocomplete is in focus causes completion to fail!

focus

failed

baveku commented 7 months ago

remove keybinding jumpToNextSnippetPlaceholder and it's worked. I have been trying for 2 weeks to find the problem; :| I'm a noop. right?

kasecato commented 7 months ago

Related with https://github.com/kasecato/vscode-intellij-idea-keybindings/issues/239 since v1.6.1

kasecato commented 7 months ago

Thanks for your detailed reporting, I just fixed and released it as v1.7.1. Please check it