What is the keyboard shortcut to preview a method's code as a pop-up?
I'm looking to preview the code inside of a given method much like one would preview the javadoc by placing the caret on the method and pressing F1.
I used to know this shortcut, but my memory is failing me harder than the various search algorithms and mom isn't home right now. ;-)
Is Ctrl+Shift+I what you're looking for? Found it here
I think you need the shortcut keys to Quick Definition. So jos76's idea is correct. But we have to map it to your keymap.
As I found from Settings -> Keymap, these are the keyboard shortcuts for Mac OS 10.5+. You may change as your convenience.
And you can also try
Place cursor on the method.
From Main menu View -> Quick Definition(2nd row under view, You can also see shortcut key combinations appearing there). So there would be a pop up appearing with method implementation view as you suggested :))
So it looks like this.
Related
Is there a keyboard shortcut I can use to jump to the method that would get run if I clicked the run button?
In this case, how can I jump my keyboard cursor to JustATest.testName()?
You can jump to a specific method or field by adding a pound character (#) when you do a class search.
Depending on your keyboard setup, a class search is done with Command+N or Ctrl+N.
So, you'd want to type in the pop-up dialog TestClassTest#testMethod, and it will take your cursor straight to it. There might be a bit of shakiness with split panes, but for the most part, this is a simple solution that works in the general case.
The other way involves placing a bookmark on that line of code, and recalling it either through the Favorites bar or through the provided shortcuts.
Outside of that, you don't have many other options. IntelliJ wouldn't be able to divine that this method will for sure be run, since any manner of exceptions could occur before it gets to that method. At that point, you're left with just breakpoints in your code.
for example we have following method:
...
public void method1(){
method2();
}
...
method2 can throws exception and Eclipse offer either wrap by try catch or declare throws declaration.
Each time I need pick up the mouse and hover mouse cursor to this row.
Is it possible select wrap or throws without using mouse?
I think that 'F2' is the right key to see the tooltip visible when hoovering mouse over an item in Eclipse editor. It may contain suggestions of fixing if there's a problem with the item being hoovered over. The functionality is called "Show Tooltip Description".
Mentioned in other answers shortcut Ctrl+1 shows a "Quick Fix" tooltip which is slightly a different trick than "Show Tooltip Description". I would say that both tooltip provide user with some common functionalities but both offer also their own options.
Yes, use Ctr+1keyboard shortuct. In your case, it is called quick fix and it works errors and warnings. With the same shortcut you can use quick assists, they are used for local code manipulations. Read more HERE.
Regards
Move your cursor to the method and press Ctrl+1, then use your arrowkeys. This trick (ctrl+1) can help you speed up development for a lot of things, like automaticly assign statements to variables.
Press F2 for focus,
Using Ctrl + 1 for proposal table,
i am having trouble with custom quick-fixes, which i want to provide in my Eclipse plug-in, and i'm hoping for someone more experienced than me in Eclipse PDE to have some hints for me on this issue.
As i have understood, i can provide custom so-called "quick fixes" (or "resolutions", in Eclipse inside terminology), by extending the extension point org.eclipse.ui.ide.markerResolution for a specific marker id, such as for example some default Eclipse marker, org.eclipse.core.resources.problemmarker.
This works for me for the default marker types and for custom marker types, BUT:
The QuickFixes, which my IMarkerResolutionGenerator provides, are only accessible from the "Problems"-View, not from the Editor, in which my markers show up.
What i have: I create markers in the default text editor, which causes (1) an icon with the markers tooltip message to show up on the left editor ruler at the line, which the marker is assigned to, (2) a marker on the right side of the editor, (3) some underlined characters in the editor, and (4) an entry in the "Problems"-view.
What i want: Just like in Java IDE support, i want to press Strg+1, or Context-Menu->Quick Fix, or to click at the error icon on the left-side-ruler, to see the available quick-fixes and to select one.
However: Only in the Problems-View am i able to get the Quick-Fixes, by pressing Strg+1 or from the context menu.
Is this the normal behaviour, and do i have to access another extension point, or the specific editors features, to hook my quick fixes into them? I haven't found anything much detailed about it, except that everybody seems to be pretty happy with this only extension point that i have mentioned above. What am i missing?
For completion, here is my extension point definition:
<extension point="org.eclipse.ui.ide.markerResolution">
<markerResolutionGenerator
class="com.markers.test.MarkerResolutionGenerator"
markerType="org.eclipse.core.resources.problemmarker">
</markerResolutionGenerator>
</extension>
I have the same problem and I'm not sure, if this is the right way, but at least it works:
If you want to see your quick fixes in the source viewer you have to set an QuickAssistAssistant for it. In your class implementing SourceViewerConfiguration override getQuickAssistAssistant. You can instantiate org.eclipse.jface.text.quickassist.QuickAssistAssistant, but you have to set a QuickAssistProcessor, so implement the org.eclipse.jface.text.quickassist.IQuickAssistProcessor interface, especially computeQuickAssistProposals to return your quick fix proposals.
public IQuickAssistAssistant getQuickAssistAssistant(ISourceViewer sourceViewer) {
IQuickAssistAssistant quickAssist = new QuickAssistAssistant();
quickAssist.setQuickAssistProcessor(new MyQuickAssistProcessor());
quickAssist.setInformationControlCreator(getInformationControlCreator(sourceViewer));
return quickAssist;
}
Also have a look at the code in the last post here, it is a bit messy, but you will get it. And look at this code here for an example implementation of ICompletionProposal, which you will have to return in your QuickAssistProcessor.
If you simply add one line to the marker extension point:
<super type="org.eclipse.core.resources.textmarker"/>
and add attributes to the marker
marker.setAttribute(IMarker.CHAR_START, ...);
marker.setAttribute(IMarker.CHAR_END, ...);
You will be able get this:
But I still can't found how to change marker icon (to variant with bulb) a show possible quick fix also after click on the annotation icon.
I have a pretty annoying issue with text highlighting on my EL statements.
I have scrolled through every field in the Options/Fonts&Colors/Syntax Control Panel three times, paying extra attention to the Expression Language options and I can not find the parameter that controls the white background of the whole ${initParam.productImagePath} expression statement.
Try looking under Fonts&Color -> Syntax. Then select the language and check all the color settings there.
UPDATE
I would add that sometimes the settings are inherited... it can be really hard to find which setting controls the color.
You can save the color settings exporting ("Export" button) then change every setting under "Expression Language" just to see if it changes.
Also, you can look through all colors in all languages and tabs until you find the color that matches the one you are seeing in the editor.
I'm guessing you may have done all this already, but I want to be sure I give the most complete answer I know of just in case.
Did you also check the entries in the Fonts&Colors Highlighting-Tab?
Your image shows that the white expression is not in the current selected line, so my guess is that you have enabled "highlight Search" (small Editor Toolbar). Another guess: if you are using the jVi Plugin, there's another highlight search parameter in jVi's settings dialog.
What is the name of this dialog? I cannot use plugin spy as this dialog does not stay open very long. This is the dialog to switch editor.
Ctrl+F6 — Switch between last used files.
It shows you the list of last used files. If you hold Ctrl and press F6 more than once - you will iterate on this list.
Firstly, the word 'dialog' might be misleading. This 'popup list' interface doesn't have window decorations, so it's hard to say whether it's a dialog, frame or something else. This might mean you're looking in the wrong places.
FYI, Switch Editor (CTRL+F6), Switch View (CTRL+F7) and Switch Perspective (CTRL+F8) all use the same type of popup so finding one of their class names should help you find what you're looking for.
This SWT spy might help you find the component. To get around the issue with it not being open long, press and release the SHIFT key while the list is open, and it will now stay open if you release all the keys, and will only close if you click away or use ESC/ENTER.