During debugging in Eclipse , my code went into the while loop ( I dont want to loop until the condition is met )
so please tell me how to come out of while loop during debugging ??
And i see that F7 is disabled under Debug Menu
please see the screen shot here
http://tinypic.com/view.php?pic=wajzeu&s=5
You can select the line that is just outside your while loop in the code editor, then right click and choose Run to Line in the context menu (Or simply use the default hotkey Ctrl + R )
Pressing ctrl+R is the correct option but if your break point is on a line which is inside the for loop, then you will have to first remove the break point and then press ctrl+R on the line on which you want the control to land. I faced this issue while debugging.
Related
I am using VSCode on a Mac.
Does anyone know how to select the entire line that the cursor is on? I know about Command+I, but that only selects what appears to be the whole line, which is not always the whole line if I have word wrap enabled.
I am looking for something like Sublime Text's "Expand Selection to Line" command.
All you need to do is put the cursor anywhere on the line, do not make any selection at all and then do the desired command (Cut, copy, or paste).
When no text selected, VS Code will automatically select the entire line.
just triple click the end of the line it will select the entire line
Triple click at any point on the line
Click once on number of the line
Press Command + L
An alternative to what people have posted is, when your cursor is at the start/end of the line, you can hit shift + end/home respectively.
I find this useful for wrapping a line in curly braces/quotes/etc. whereas the other answers include spaces in the select so whatever you're wrapping it in will be wrapped around that whitespace.
Install the MetaGo extension and use the "metaGo: selectLineDown" command, which will come installed already overriding the "expandLineSelection" command.
This extension has many additional commands that you'll likely find useful as well, including moving up/down over code blocks, centering the active line, and going to any character on the screen.
Now, when I press Command+I, the whole line is selected. I am guessing this was caused by an update to VS Code, but I am not sure.
Ctrl + L on Windows or Command + L on Mac to select the whole line in VS Code.
You can use your mouse to select the whole line by triple-clicking on the line but the better way is to click on the line number to select the whole line or multiple lines.
Tripple click at any point on the line
In case you're wondering why Cmd+L is not working, there might be a chance that there are duplicate shortcuts. You can find out by opening Keyboard Shortcuts in VSC and remove the one that's not needed.
I know its old but for anyone seeking, you can press Alt + arrow up/down to duplicate your cursor to other lines and then without selecting anything copy and paste multiple lines.
I recently switched from Eclipse to IntelliJ IDEA, and found myself wondering how to move the cursor out of a pair of auto-completed brackets.
In Eclipse after I finished typing in a pair of brackets, pressing tab brings me out of the brackets. How can I do the same thing without using the arrow keys?
Many thanks for your help!
IDEA doesn't have such feature yet. The closest equivalent is the Complete Current Statement editor action (Ctrl+Shift+Enter).
UPDATE
Initial implementation for this feature is available in 2018.2 EAP version - press Tab to jump out.
It works more like in MS Visual Studio - without visual indication of tab 'exit' position. For now, it should work in Java, SQL, Python and some other files. It will take some time for other languages to catch up - some language-specific code changes are required.
The feature is disabled by default, you can enable it in
Settings -> Editor -> General -> Smart Keys -> Jump outside closing
bracket/quote with Tab
Ctrl + Shift + Enter does not seem to work for me in IDEA 12.1.4, but I found the closest feature to what I was looking for was Shift + Enter. This completes the line, creates a new line below the current line and moves the cursor to it.
You can do this by pressing the closing symbol that you would've pressed otherwise, but was auto completed. For example, if you have just typed the f below, you would press shift and 0 (or closing parenthesis), and it will move your cursor outside of the parenthesis.
String asdf = "hello world";
System.out.println(asdf);
I went to preferences->Keymap and set a shortcut for "Move Caret to Line End" to Shift-Space. It takes me to the end of the current line I am on without adding anything, if that's what you want.
Not currently supported by Intellij. There is an open feature request on this at http://youtrack.jetbrains.com/issue/IDEA-74666. Extra votes would be nice.
Intellij supports the ctrl+shift+m shortcut that jumps to the end of the block:
https://www.jetbrains.com/help/idea/2016.2/navigating-to-braces.html
It's not quite what you're looking for, but you can type the character you are trying to move outside of (a closing paren, for example) and that should pop you outside of the auto-completed character.
Not ideal, but functional as far as I've tested it.
I set these setting:
1) I added Semicolon shortcut to Complete Current Statement:
Instead of using for loop command, I using fori command (because for command needs semicolon character):
2) I added Alt+Semicolon shortcut to Move Caret to Code Block End:
So when I inside the loop, by pressing Alt+Semicolon jumping end of the bracket, by pressing Semicolon I jumping out the bracket subsequently.
by adding these shortcuts, the speed of coding will be faster.
Such key is called "End".
You can assign any unused shortcut to "Move Caret to Line End" action in "Settings/Preferences | Keymap".
P.S. You can use Ctrl+Shift+Enter to complete your statement (in your case it will place caret at the end of line and will add ";" there) -- action called "Complete Current Statement" and shortcut can be checked/changed in a same way as described earlier.
If you decide to move back to Eclipse and use PyDev this feature by default is disabled, First Switch to PyDev Perspective and you can enable it by going under Preferences>PyDev>Editor>Typing>Enable link on Automatic parenthesis or literals closing
Group,
Is there an Eclipse keyboard shortcut key to exit a for/while loop while debugging?
Thanks,
Ranjit
I'm not aware of a keyboard shortcut to exit a for/while loop, but you can move your cursor to the next statement after the for/while loop and use the "Run To Line" shortcut Ctrl+R
Pressing ctrl+R is the correct option but if your break point is on a line which is inside the for loop, then you will have to first remove the break point and then press ctrl+R on the line on which you want the control to land. I faced this issue while debugging.
This behavior is dring me batty.
I type the following:
fileName.append(c.get(Calendar.HOUR_OF_DAY))
Now when I typed that the content assist poped up. I did not pick HOUR_OF_DAY from the content assist nor did I press enter to fill it in automatically. I just typed "HOUR_OF_DAY". I typed both end parens ")" at the end of line too, I did not press tab.
My cursor is now at the end of the line and I type ;
Eclipse inserts the ; AFTER the cursor! So when I press enter, the semicolon moves to the next line!
I've tried everything I can think of in the preferences. I turned on "auto smeicolon" option that is supposed to place semicolons at the end of the line automatically but it doesn't fix this.
One clue: if I press "ENTER" before typing ";" at the end of the line, the content assist window goes away and the ; is inserted properly with the cursor now afte the ;. So content assist is messing with me.
Any help is appreciated.
Go to Window -> Preferences -> Java -> Editor -> Typing and uncheck Semicolons in the Automatically insert at correct position group.
Yeah I just started seeing this exact behavior after changing some of my preferences, I switched them back and the behavior went back to normal.
Preferences > Java > Editor > Content Assist:
These settings are the default and do not produce the bad behavior you describe.
When I was seeing the unwanted behavior, I had the delay set to 50ms and the auto activation triggers set to ".(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
Let's say I have a file with 10 lines and I have a problem with the name of the package (or something) and the cursor is on the last line of the text.
How can I go directly to that line to see what the problem is and what suggestions there are to remove the problem, using a shortcut?
Question: Is there a keyboard-shortcut for this?
Or something like this:
Go to the next error and Go to the previous error.
Windows and Linux
Go to the next error: Ctrl + .
Go to the previous error: Ctrl + ,
Show quick fixes: Ctrl + 1
Mac
Go to the next error: Cmd + .
Go to the previous error: Cmd + ,
Show quick fixes: Cmd + 1
To go to problem within project just type Shift+Alt+Q then press X. It will open the "Problems" window. Now use ↑ or ↓ to select the error/warning and press Enter to go to it.
I know it isn't simple as Crtl+. but it works for a whole project.
To complete the previous answers, you can use the combobox linked to the toolbar buttons for next/previous annotation to set the annotation level.
That makes browsing through errors using ctrl+./ ctrl+ easier,
TO GO TO NEXT ERROR ONLY in eclipse with Ctrl + . command, tick off warnings as shown in screenshot