Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ - Copy only visible text after code folding?

Tags:

People also ask

How do you collapse a block of code in IntelliJ?

Expand or collapse code elements To collapse or expand all code fragments, press Ctrl+Shift+NumPad - / Ctrl+Shift+NumPad + . IntelliJ IDEA collapses or expands all fragments within the selection, or, if nothing is selected, all fragments in the current file, for example, all methods in a file.

How do I move a block of code to the left in IntelliJ?

I can shift a line of code or a block of code in Eclipse by the following way: Focus a line or select a block of source code. Source menu -> Click "Shift Left" or "Shift Right"

How do I copy a whole line in IntelliJ?

Duplicate the current line or selectionPress Ctrl+D or choose Edit | Duplicate Line or Selection from the main menu . Alternatively, you can press Ctrl+Shift+A , start typing the command name in the popup, and then choose it there.


Is it possible to fold large blocks of code in IntellJ, select a section of code that encloses the folded section, and only copy the text that is visible?

For instance, if I have a JSON file like:

{
    "list1" : [
         1,
         2,
         3
     ],
    "list2" : [
         "a",
         "b",
         "c"
     ]
}

and I fold the lists so the IDE displays them as:

{
    "list1" : [...],
    "list2" : [...]
}

Is there a way to copy ONLY the text displayed above? Regular copy includes the code that is hidden from view.


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!