ryanluker / vscode-coverage-gutters

Display test coverage generated by lcov and xml - works with many languages
https://marketplace.visualstudio.com/items?itemName=ryanluker.vscode-coverage-gutters
MIT License
460 stars 88 forks source link

editor.action.commentLine key binding not working on Macos #319

Closed massicer closed 3 years ago

massicer commented 3 years ago

Summary

Currently it appears that one of our default keybindings is colliding with the commentLine command in fresh mac os installs. We should be able to just simply choose a new keybinding for this but I am not 100% sure which one too choose šŸ¤” .

Work

Dev Triage

https://github.com/ryanluker/vscode-coverage-gutters/blob/master/package.json#L192-L195 https://code.visualstudio.com/docs/getstarted/keybindings#_detecting-keybinding-conflicts


Original Ticket

Describe the bug Key binding for command editor.action.commentLine doesn't work anymore on MacOS.

To Reproduce Steps to reproduce the behavior:

  1. Install the extension.
  2. Try to use editor.action.commentLine command with default key binding command + shift + 7 on a selected portion of code.
  3. command is not triggered.

Expected behaviour The command should be triggered and the selected code should be commented.

Desktop (please complete the following information):

ryanluker commented 3 years ago

Thanks for submitting an issue @massicer. This has come up before with another user https://github.com/ryanluker/vscode-coverage-gutters/issues/88 but I am not sure you are having the same issue.

I tried this out locally and it appears to work with a fresh install for myself on windows, can you confirm by going into the keyboard shortcuts and seeing if there is a conflict for the two Commands? commentLine and displayCoverage. image image

You can also type in the shortcut to see if any other commands are also using this šŸ¤” image

Background Info

https://code.visualstudio.com/docs/getstarted/keybindings#_keyboard-shortcuts-reference

massicer commented 3 years ago

Hey @ryanluker , here are the screenshots that were taken after a fresh install.

Thank you for your work!

Screenshot 2021-06-15 at 09 16 54 Screenshot 2021-06-15 at 09 17 28 Screenshot 2021-06-15 at 09 18 38
ryanluker commented 3 years ago

@massicer Interesting, this must be a mac osx issue šŸ¤” . You are able to switch to a different key binding though correct?

In terms of fixing this issue we will probably will have to set a different default for the display coverage keybinding... https://github.com/ryanluker/vscode-coverage-gutters/blob/master/package.json#L192-L195

I will update the original issue body to include some info on how to fix this.

ryanluker commented 3 years ago

@massicer One odd thing I noticed is that your default is not the same as the default from microsofts pdf documentation šŸ¤” .

āŒ˜/ Toggle line comment https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf

When you did the fresh install did you delete the vscode config folder? https://code.visualstudio.com/docs/getstarted/settings#_settings-file-locations

massicer commented 3 years ago

@ryanluker yes, I also checked my custom keybindings using the tip reported here: https://code.visualstudio.com/docs/getstarted/keybindings#_viewing-modified-keybindings

But I also figured out this issue was caused by my keyboard layout (ITALIAN) since when I set it to USA everything worked well and additionally the keybinding for the command with id editor.action.commentLine changed from cmd+shift+7 to cmd+/.

I suppose this happens since in my layout in order to produce / you have to type shift+7.

I will solve my issue by changing the default keybinding for coverage-gutters.displayCoverage.

Thanks anyway for your support šŸ˜Š

ryanluker commented 3 years ago

@massicer Thanks for getting back to me with the solution to the mystery hah. Happy coding šŸ˜ .