Is it possible to go back one level of breadcrumbs using hotkey in VS Code? - visual-studio-code

VSCode has breadcrumbs feature that looks like this:
Is it possible to go back one level in these breadcrumbs using a hotkey? So in the case above, I am inside propTypes. I press hotkey and I go to BatchTypesTable.
I can achieve this already by clicking on the breadcrumb itself but I want to have a hotkey to do this.

On MacOS, my keyboard workflow is:
open breadcrmb with shiftcommand.
then navigate the top level with option← and option→
use plain arrows to navigate inside the drop-down list
So, I guess on windows top-level navigation would be alt←?
Relevant VSC documentation here. Although it seems to be incomplete and partially incorrect?

Related

How to detect VSCode panel visibility from the extension code?

I would like to create an extension to toggle all the currently visible panels by a single shortcut. So something like the command "Hide/show All Tool Windows" from JetBrains IDEs, which I think is still missing in VS Code.
VS Code can have up to 3 panels visible:
Sidebar (the left-side panel)
Panel (the bottom panel)
AuxiliaryBar (the new right-side panel)
For that purpose, I need to detect the current state of all the panels from the extension code, so I can toggle only the panel(s) which are currently visible.
But alas I can't find it anywhere in the documentation. This page (https://code.visualstudio.com/api/references/when-clause-contexts) contains several variables like sideBarVisible, but I really don't get how to access those context variables from the vscode namespace which you can access from the extension.
import * as vscode from 'vscode';
So, is there a way how to detect if the panel is open or closed from the extension code?
Do you really need to know whether they are open or closed? Can't you just toggle them all?
vscode.commands.executeCommand('workbench.action.toggleSidebarVisibility')
vscode.commands.executeCommand('workbench.action.togglePanel')
vscode.commands.executeCommand('workbench.action.toggleAuxiliaryBar')

Eclipse Back/Forward navigation using mouse buttons

There is an addin for Visual Studio called MouseNavi that allows you to use mouse thumb buttons to navigate your history.
Does a similar extension exist for Eclipse?
I don't know of any Eclipse plugin that does this, but assuming you're using Windows:
This one should enable you to do what you want: http://www.highrez.co.uk/downloads/XMouseButtonControl.htm
With that tool you can assign each mouse button a sequence of keys (Alt+Left for example) and because it can be made application specific it won't interfere with other programs where you don't want that mapping.
Alt+Left and Alt+Right to navigate through the latest opened editors.
Also, Alt+L to open up the shortcuts popup, so you can see what's available.
No real mouse navigation control though (not that I know of... at least). Although, should not be very difficult to create one and attach it to the same handlers that deal with the navigation commands.
^Q takes you to last edited location. You can cycle using it. No mouse bindings.

How do I move shortcut buttons into the GUI

Is there anyway of moving common tasks like uncommenting code (I see I can only do it for a limited selection of things like refactoring etc) onto the main GUI as a button - much like visual studio's buttons?
Commenting and uncommenting code is cmd-/.
The general answer to this question is no.
Shortcut is handy. Hit cmd-shift-? to bring down the help menu and put focus in the search field. Type something like "comment" and it'll find matching menu items.
You can customize with prebuilt actions by right/option-clicking on the toolbar and ->customize.
As for anything real custom, you have to learn the keyboard shortcuts for them.

Navigating the Content Assist List in Eclipse

Here are the ways the Eclipse documentation states you can navigate the Content Assist list:
You can use the mouse or the keyboard
(Up Arrow, Down Arrow, Page Up, Page
Down, Home, End, Enter) to navigate
and select lines in the list.
But all of the options require you to move your hands significantly away from their natural place on the keyboard!
Are there any other, quicker ways I can navigate this list? Something like tab, or the j/k from vi?
This is a great feature, and you can implement it like so: bind movement keys in Eclipse's key binder and then use them in the content assist menu!
Preferences/General/Keys
Line Down: Bind to Ctrl+K
Line up: Bind to Ctrl+I
(both when 'Editing Java Source')
and then try moving with Ctrl-K/I when the content assist pops up!
In Kepler, as jed mentions in the comments, select "when editing text" instead and it should work.
If you try to fill in the content manually, Eclipse will move.
The search is quite advanced, e.g. "ArL" can match ArrayList, etc., so if you know what you are looking for, instead of navigation you could use search.
This is certainly not a solution for everyone, but if you switch to the Emacs keyboard layout you can just use the key bindings for the "previous line" and "next line" commands, e.g., Ctrl-P and Ctrl-N.

How to Display Current Function in Eclipse

I miss a certain functionality in Eclipse. I would like to know the name of the current function the cursor is currently inside. This is useful when browsing unknown code using the search function, for example.
Any idea how to show it? Maybe a plugin?
I'm using the "Toggle Breadcrumb" option from toolbar:
It shows a nice breadcrumb, ending with current function name.
It's quite handy for me, as Outline becomes cumbersome to use if you have zilions of functions.
It produces the following structure above your Java Editor (truncated at the picture below):
The "Outline" view shows the current function.
It may be necessary to enable the 'Link to Editor' option in the Outline View dropdown menu. This might be off by default for CDT.
I was looking for something similar (Xcode-like bar at the top showing the current function, where you can also go to another function by clicking on it to open a popup list of functions). Here is what I settled on with Eclipse 3.5.1 CDT:
I moved the Outline view to the top, resized it to make it a 1-line horizontal strip (don't make it too narrow), and selected "Link With Editor" in its menu, so that it always shows the current function. However, this doesn't open a popup list like Xcode. For that functionality, I assigned a shortcut to the "Show Outline" command which does open a popup list of all functions.
The Eclipse function 'show outline' will pop up a list of outline objects, and it will highlight the object your cursor is inside in grey. It's typically bound to 'ctrl-o' (the letter 'o', not zero), but you can re-bind it as you see fit. I'm running Eclipse with the CDT plugin and it works pretty well for me.
To enable the breadcrumb invoke Toggle Java Editor Breadcrumb in the toolbar or press Alt+Shift+B in the Java editor.
You can also display the Quick Outline (ctrl+o). This way you see the context quickly without having to have a permanent Outline Window linked to the Editor.
Use the "Link With Editor" option on the outline menu
Press Ctrl+o (cursor is currently inside a function at a particular line).
It highlights the current method, or name of the class if the cursor is outside the method body.
You can click on highlighted method.
It has got inline search feature ...start typing name of the method to navigate to the specified method or method with matching search pattern.
If you press again Ctrl+o to shows the inherited members/methods.
Using outline with "link with editor" option worked also for me, thanks!
Just an addition, you can move outline pane in to the same window group as search, progress etc. saves the space in your perspective instead of keeping it at another group.