Vertical line between matching curly braces for java in eclipse

前端 未结 8 2153
甜味超标
甜味超标 2020-12-23 14:17

I am new to eclipse IDE.
Can we do following in eclipse for java editor?

{
|
|
}

How it is configured in eclipse to show vertical lines

相关标签:
8条回答
  • 2020-12-23 14:40

    You can identify the matching curly braces in eclipse by position the cursor right after of the curly brace (the opening or the closing one) and the matching one will be automatically enclosed in a rectangle. You can't do what you said. After you position the cursor as I said , you can press CTRL + SHIFT + P to jump to the matching brace.

    0 讨论(0)
  • 2020-12-23 14:41

    To my understanding this is not possible. Eclipse does have functionality that will help you work with brackets however, and it is actually a little more refined and user friendly then the Notepad++ style you are looking for.

    1. First, it has a feature for matching brackets highlighting under Preferences->Java->Editor. When your cursor is on a bracket it will highlight the matching bracket.
    2. Along these same lines, if your cursor is on a bracket and you press ctrl + shift + p it will jump to the matching bracket.
    3. It has line folding that can be toggled in Preferences->Java->Editor->Folding for brackets, comments, etc.
    4. Double clicking after an open or close bracket will highlight everything in that code block.
    5. Eclipse supports automatic indentation as well. This should be a visual queue as to which chunk of code belongs to which bracket.

    Hope this helps! Happy Coding!

    0 讨论(0)
  • 2020-12-23 14:41

    You can also highlight enclosing brackets in Eclipse - see http://blog.deepakazad.com/2012/03/jdt-3842-m6-new-and-noteworthy.html

    0 讨论(0)
  • 2020-12-23 14:48

    The closest solution I can suggest is:

    1. Click on Eclipse IDE > Window > Preferences > General > Editors > Text Editors

    2. Then click on the link "whitespace characters" to specify what should be shown.

    3. Then enable tick box "Leading and Enclosed" for Tab only and leave the rest unchecked.

    This is not perfect solution, but it might be useful.

    Example

    0 讨论(0)
  • 2020-12-23 14:48

    Eclipse's structured editors (including the Java editor) provide a highlight of whatever structural element the cursor is within. The highlight is in the left border of the editor. For example, in the screen shot below, the cursor is in the listIterator() method, and the highlight (pointed out with arrows) is highlighting the structural element, in this case, the Java method.

    Unfortunately, I don't think the color or appearance of that highlight can be configured.

    enter image description here

    0 讨论(0)
  • 2020-12-23 14:48

    I do not think this functionality exists in Eclipse.

    If it does, it most likely can be found under:

    Window > preferences > General > Appearence

    or

    Window > preferences > General > Editors

    There might be plugins that can add this behavior. (not sure of any off the top of my head, sorry)

    What value do you get from this feature (bracket matching or folding)? maybe there is another Eclipse feature built in that can replace what you use the lines for.

    0 讨论(0)
提交回复
热议问题