Eclipse - How to find missing closing brace - eclipse

I'm using the Groovy editor in Eclipse. When I compile/seed my script I sometimes get the below output.
839: expecting '}', found '' # line 839, column 1
The line above is the last line in the script which doesn't tell me much. It just says there is a closing brace missing somewhere in the script. One way I typically try is to zoom out (ctrl -) as much as possible in my editor (after source code formatting) then I try to look for something that looks oddly indented. The problem is some blocks are quite long so this is not ideal...
Is there a better approach or easier way to find out where the missing brace is in Eclipse? Or using another app (i.e. Notepad++, Sublime)? I would like to avoid using online tools pasting sensitive code.

When you place the cursor after an opening brace, the editor will highlight the closing brace. And you can jump to the closing brace using Go to Matching Bracket (Ctrl+Shift+P). Similarly, you can place the cursor just before a closing brace to highlight the opening brace and use the same command to jump to it. Using these aids, you should be able to narrow down where the unpaired opening brace is.

Related

Is there a way to make VSCode Intellisense suggestions end outside the semicolon?

Intellisense suggestions are handy because I'm lazy, but any time I hit tab/enter to select one, it ends inside the ;. So then I have to arrow right and manually add a new line. Is there a setting or extension that autocompletes to outside the ; and optionally adds new line? or even just complete outside the semicolon. It's kind of cumbersome when writing many CSS rules to have to arrow right in between every line.
Vscodes native way to add a new line anywhere on a line is CTRL + Enter
You can add a new line above at any time using CTRL + SHIFT + Enter
You can try:
"editor.acceptSuggestionOnCommitCharacter": true,
Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (;) can be a commit character that accepts a suggestion and types that character

How do I select text inside of braces in Visual Studio Code?

In Atom I can select inside of brackets with CMD+CTRL+M. How can I do this in Visual Studio Code? I've checked the keyboard bindings, but didn't find anything.
There are 2 even better alternative commands in the keybinding file you might want to check out:
editor.action.smartSelect.grow
and
editor.action.smartSelect.shrink
They select everything in between the next boundary (quotes, brackets, curly braces...) and the selection grows to the next boundary when you hit the shortcut again.
Default shortcut is ctrl+shift+cmd+right / ctrl+shift+cmd+left, which is a bit too "finger heavy" for my taste, so you might want to rebind it (I use ctrl+up / ctrl+down).
Shift+Alt+Right for selecting all text inside the braces.
CTRL+Shift+\ for jumping between opening/closing braces (or) parentheses.

Smart indenting after starting braces is not working

I'm currently writing php-code in Eclipse 3.02 and a tiny but irritating bug/feature has popped up. When I change line after an opening curly brace { the marker always jumps to column 1, forcing me to manually tab to get the correct indentation. I have only experienced this whith opening curly braces. If I don't use open braces (i.e. press enter after else, for or closed curly brace }) it indents correctly. Is this a known error and is it solvable?
Make sure you got Statements within block selected (and all other situations you want automatic indentation).

How to move out of auto-completed brackets in IntelliJ IDEA (without using the arrow keys)?

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

Netbeans Keyboard Shortcut to Jump out of Quotations

I'm using Netbeans 7 and programming PHP. I was wondering if anyone knew of a keyboard shortcut to jump out of quotations marks and parenthesis (besides the right arrow key). For example I would like to type a quotation, type some text, then:
"my cursor would be here -> |"
Then hit tab or something equivalent to jump outside of the quotations:
"some text"| <- my cursor would now be here
Is this possible to accomplish using netbeans?
Type the second (end) quote. Netbeans realizes what's going on and does exactly what you describe.
you should take the auto quotation as a help to minimaze errors:
"The user often writes a code that has opening and closing brackets, and this is very often source of compilation errors. If the IDE would insert a closing bracket each time opening bracket is typed, the likelihood of error is smaller, and the user also has a better visualization of the structure."
source: https://ui.netbeans.org/docs/hi/promoB/smartBrackets.html
I was looking to a "short cut" myself to allow me to jump outside the quotation even when the cursor is not at the end of the content, but I could not find it.
Like me, you might find this method useful as well: select the text you want to wrap in quotes/brackets and the press the opening quotes/brackets you like: NetBeans will do it for you.
source: How to surround a text in quotes in netbeans IDE
code safe ;)