Find last action or action history in VSCode - visual-studio-code

Background
I was using the keyboard without paying much attention. Then I triggered something, then my selected code top:0 becomes <top:0></top:0> I think this is useful for me but I don't know what key (was a 3-key-combo) I have pressed.
Question
How to see action history like in Microsoft Office Word/Powerpint/Excel?
I did ...
Look up in user-defined key bindings.
Searched possible extension settings.
Searched VScode official documents.

You can do that just by pressing tab or enter after typing what you want. What that key does is it selects the first available suggested action, and in this case it is the emmet abbreviation of "create HTML tag". You can see more information in the visual studio code documentation here and the official emmet documentation here
Also for your information, you can press Ctrl + Shift + P and then type Developer: Toggle Keyboard Shortcuts Troubleshooting. This will open your console and it will announce every key you press, the thing is this does not have any history of whatever you did prior to opening it so there is no way to view history.

Related

VS Code's toggle-comment Keyboard Shortcut isn't working when I use Jupyter Notebooks

The default VS Code keybinding for toggling line comments isn't working in Jupyter Notebooks. The shortcut Ctrl+/ works fine when I use it in .py files, and it seems to work everywhere else as well. But when I am in a *.ipynb file, it just doesn't work. I noticed that when I use the browser VSCode version, the shortcut works in *.ipynb files.
I thought that changing the keybinding to something different might help solve the issue, but to no avail.
I tried recreating my project-environment. I recreated everything in new files, and in new folders. I even tried reinstalling VS Code. Nothing has worked for me.
VS Code Provides a Tool for Troubleshooting this Exact Issue
       
I have answered questions about VS Code Keyboard Shortcuts
several times, and what I learned from the experience, is that most people seem to prefer hitting there heads against a wall, rather than using the tool that VS Code developers graciously provided for them (or us I mean).
The Tool is named Keyboard Shortcuts Troubleshooter, and it is Toggled ON/OFF via a native VSC command. The command can be found in VS Code's "Quick Input Drop-down Menu". To execute the command, you need to open the Quick Input Menu using the F1 Key. Once the menu opens, your editor will change focus to its text-input, so you don't have to do anything other than simply typing the bold line of text below.
"Developer: Toggle Keyboard Shortcuts Troubleshooting"
While typing an option with the same name as what you are typing will appear in the menu. (PLEASE NOTE: _there are a few troubleshooters, one for keyboard shortcuts, and a couple others that pertain to Notebooks (DO NOT USE ANY TROUBLESHOOTER BUT THE KEYBOARD SHORTCUTS TROUBLESHOOTER).
Once you have found, and selected the "Developer: Toggle Keyboard Shortcuts Troubleshooting" command in the quick menu, the troubleshooter will be active.
PLEASE NOTE: SELECTING THE TROUBLESHOOTER TWICE WILL DEACTIVATE IT AND YOU WILL BE LEFT AT WHERE YOU STARTED.
To view the tool's output, you'll need to change your panel's view from terminal to the Output Console by selecting output at the top of your panel. Vs-code might automatically do this for you though. It didn't use to, but I think it does open the correct output window when you execute the +"Developer: Keyboard Shortcuts Troubleshooting"_ command. If it doesn't, then make sure you select LOG(Window) from the drop-down at the top-right of the Output-console's panel.
With the troubleshooter active, and the output open, use a keybinding (any keybinding) to test it. The output looks like this.
You Should have the Troubleshooter Working, which will give you all the info you need to understand the issue you have.
Bellow I have provided a snippet showing what the Output console looks like when I executed my custom Save-all Keybinding. So that your not completely on your own, your going to want to visit two links, if your able to be self-taught, these links golden.
The first is a guide. I provided this link, because if you can't get your troubleshooter working, this link provides a VS Code documented guide on how to use it. Plus a wealth of other info on this subject. [CLICK HERE]
The second is a Microsoft/VSCode/Wiki. Its covers this topic in a context that's has a little more depth to it. Over all I find this page very helpful, but it is a more advanced resource. [Click Here]
Click on the links that say CLICK HERE, the others go to the generic sites.
This output is for the keys:
[CTRL]+[SHIFT]+[SPACE]   [S]
It saves all files when pressed. And this is the output for that keybinding I just described.
> / Received keydown event - modifiers: [ctrl,shift], code: Space, keyCode: 32, key:
> | Converted keydown event - modifiers: [ctrl,shift], code: Space, keyCode: 10 ('Space')
> | Resolving ctrl+shift+[Space]
> \ From 21 keybinding entries, matched chord, when: no when condition, source: user.
> + Ignoring single modifier ctrl due to it being pressed together with other keys.
> / Received keydown event - modifiers: [], code: KeyS, keyCode: 83, key: s
> | Converted keydown event - modifiers: [], code: KeyS, keyCode: 49 ('S')
> | Resolving [KeyS] chorded from ctrl+shift+[Space]
> \ From 1 keybinding entries, matched workbench.action.files.saveFiles, when: no when condition, source: user.
NOTE: "I removed the timestamps from the beggening of the lines to make them shorter."
The issue might be due to some other extension. In my case, this issue was resolved by removing the "Dependency Analytics" extension. Due to this extension, *.ipynb files were picking CVE as cell language mode. I wasn't able to change the cell language mode to Python without removing the extension. Upon removing, the extension, *.ipynb files showed Python as cell language mode and this resolved issues with key bindings as well as with syntax highlighting.
Note: Cell language is the small text that comes on the bottom right of each cell in a ipynb file. This should be Python for key bindings and syntax highlighting to work properly.

VS Code, does not accept suggest on tab

I am currently working on VS Code with GitHub Copilot.
But when I have a suggestion:
And I press "Tab" to accept the suggestion, Vs Code adds a tab in the code:
Someone know how to resolve this ?
Explanation
In fact VS Code has a prioritization for the same shortcuts.
A custom shortcut is more prioritized than a default shortcut.
If you have a shortcut for your tab key in your VS Code, that can disorganize the prioritization of the default shortcut.
Solution
I don't find a solution to give a prioritization for a shortcut, so I set the default for all shortcuts using the tab key:
Note: is important to click on "Reset keybinding" to take the default prioritization.
Other solution
It's probably possible that VS Code gives a prioritization with the date of the last update of your shortcut. But I don't try this solution because you need to update all the shortcuts and we have several shortcuts for tab key.

How to search ('Ctrl+F') in 'output' panel in VS Code?

I used to be able to be able to Ctrl+F to search whatever was logged in VS Code. Now, for some unknown reason, the search bar doesn't show up when I type in Ctrl+F.
I am on version 1.57, which is the latest at this time.
This question if for the Debug Console which isn't the tab I am looking at.
Click anywhere inside the output panel, and then press Ctrl + F
I realized that the Vim extension is what is causing this. Ctrl+F is for scrolling and although previously Vim keyboard shortcuts didn't work in the output panel, they seem to have been extended to it recently see this issue I raised.

VSCode how to automatically insert Intellisense suggestions without having to press Enter?

Default VS Code Intellisense behaviour
User is presented with a menu of suggestions
User then has to press the Up or Down arrow keys to navigate through the menu
Finally user has to confirm with Enter to insert the suggestion and close the dialog
What I would like instead
Don't need to press Enter
Suggestions are automatically inserted (and cycled through) by pressing Up/Down
Pressing any other keys will close the dialog and resume typing
To be clear, I want to replicate the default behaviour of YouCompleteMe:
When you type, a completion menu pops up. If you like the completions, you use the <Tab> key (by default, can be changed to <Enter> or <Down> arrow or whatever) to select a completion string you want. The very act of "tabbing through" the list to select the item you want inserts the candidate string. When you tab to a different candidate, the editor code is replaced with the new candidate. There is no accept key because by the point where you have the candidate you want selected in the menu the candidate has already been inserted in the editor. There is nothing to "accept". You just keep typing, the candidate has already been inserted.
Is such behaviour possible with Visual Studio Code, either by default or through a plugin?
The editor.tabCompletion option is the closest thing currently available:
By default, tab completion is disabled. Use the editor.tabCompletion setting to enable it. These values exist:
off - (default) Tab completion is disabled.
on - Tab completion is enabled for all suggestions and repeated invocations insert the next best suggestion.
onlySnippets - Tab completion only inserts static snippets which prefix match the current line prefix.
(Emphasis mine)
... except that the first Tab press hides the suggestion window.
I did some digging about editor.tabCompletion, and I found that closing the suggestion window is part of the tab completion's option original design, and that while other users have asked about an option not to close the suggestion window or specifically YouCompleteMe-style behaviour, that this is currently not supported.
"editor.acceptSuggestionOnEnter": "off",
To disable Enter to accept suggestion.

In Visual Code editor, how can I which functions a key is bound to?

In Visual Studio Code editor (not Visual Studio to which this answer and this answer applies) how can I know which function is bound to a particular keyboard shortcut?
I know about assigning a keyboard shortcut to a function and then using the conflict resolution option that the editor provides to resolve any overloaded keystrokes. What I want to know is how to find which function is assigned to a particular keystroke. Apparently, in Visual Studio (IDE) there's an option to use a "Shortcut currently used by" dialog so that you could type in a keystroke/chord and it would show the function (rather than execute it) (see links above). Emacs has the same type of thing where you can type a keystroke and see what it is bound to.
The backstory on this: I used to open the recent files list via ctrl+R. Recently it says "Waiting for second key of chord...". I can see that the recent files function is STILL bound to ctrl+R but short of eyeball browsing hundreds of commands I can't determine how to backtrack to find whatever is using the ctrl+R key chord.
Open your keyboard shortcuts preferences (⌘K ⌘S). The search input field has a keyboard icon on the right side. Click that - or press ⌥⌘K - to record keys and VS Code will show you all commands for that specific keybinding.