aliariff / vscode-auto-add-brackets

Automatically add complete brackets when writing interpolated string
https://marketplace.visualstudio.com/items?itemName=aliariff.auto-add-brackets
MIT License
10 stars 4 forks source link

Bug: This package remaps "shit+4" to "$" #29

Closed Nicolab closed 1 year ago

Nicolab commented 1 year ago

Hello,

Thanks for this package. I have been using it for a long time without worry, but there is a bug that has appeared.

By activating "keyboard shortcuts troubleshooting" from command palet, we can see that it comes from the package. I deactivate it, it's good the "4" works again. Here the log:

2023-01-27 20:47:01.435 [info] [KeybindingService]: / Received  keydown event - modifiers: [shift], code: Digit4, keyCode: 52, key: 4
2023-01-27 20:47:01.436 [info] [KeybindingService]: | Converted keydown event - modifiers: [shift], code: Digit4, keyCode: 25 ('4')
2023-01-27 20:47:01.437 [info] [KeybindingService]: | Resolving shift+[Digit4]
2023-01-27 20:47:01.437 [info] [KeybindingService]: \ From 9 keybinding entries, matched auto.addInterpolation, when: editorTextFocus && editorLangId == 'typescriptreact' && vim.mode != 'Normal' && vim.mode != 'Visual' && vim.mode != 'VisualBlock' && vim.mode != 'VisualLine', source: user extension aliariff.auto-add-brackets.
2023-01-27 20:47:01.437 [info] [KeybindingService]: + Invoking command auto.addInterpolation.

I'm on Macbook pro with AZERTY keyboard. This bug appens on a TSX file.

thomasdarde commented 1 year ago

Seeing the same issue

thomasdarde commented 1 year ago

A solution is shown here : https://github.com/aliariff/vscode-auto-add-brackets/issues/9#issuecomment-548724717

thomasdarde commented 1 year ago

I tried to investigate to understand how to fix this. The "isssue" is in this file : https://github.com/aliariff/vscode-auto-add-brackets/blob/main/package.json the keybindings are mapped to shift-3 or shift-4 for example

It seems it can me mapped to a virtual key code instead ( https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes?redirectedfrom=MSDN ) But there is no such key code for the sharp sign

aliariff commented 1 year ago

Thank you, @thomasdarde, I have added the solution in the readme section (https://github.com/aliariff/vscode-auto-add-brackets#known-issues)

@Nicolab I will close this issue for now, let us know if the issue still persists in your local.