folding

How to fold for, while and if blocks in Java Eclipse [duplicate]

帅比萌擦擦* 提交于 2019-12-12 00:15:51
问题 This question already has answers here : Is there a way to fold eclipse sub-blocks like an “if” statement? (8 answers) Closed 4 years ago . I'm using Eclipse Luna for Java. By default, Eclipse only lets me fold Comments, Header Comments, Inner Types, Members and Imports. Is there a plugin that allows me to fold for , while and if blocks? I searched the marketplace and various sources and found nothing for this. Edit: Before downvoting, consider I have thoroughly researched this before posting

Hierarchy of JUnit tests

大城市里の小女人 提交于 2019-12-11 03:38:32
问题 I need the following test @runwith(cache, memory) class CollectionA is -- this is a suite (aka folder) class Cache { -- this is a sub-suite (aka folder) @test testCache1() -- this is a method (aka file) @test testCache2() @test testCache3() } class RAM { -- this is a sub-suite (aka folder) @test testRAM1() @test testRAM2() } @test testIO() @test testKeyboard() @test testMouse() @test testMonitor() @test testPower() @test testBoot() Please note that only Cache and RAM need to be grouped. The

Using Vim, what is the best way to implement PHP code folding that only folds functions blocks?

£可爱£侵袭症+ 提交于 2019-12-11 03:13:04
问题 I'm currently using Vim to edit PHP files and would like to implement code folding for functions only. I've tried setting the foldmethod=expr and using a regex with foldexpr in my .vimrc file. The problem is i don't fully understand how foldexpr is using the regex to apply folding to the source code and i can't seem to get it right. Basically i want all PHP functions (inside classes too) to be folded and that's it. The nearest i've got is: set foldexpr=getline(v:lnum-1)=~'function'?'>1':'='

Vim folding : how to hide all the single lines not containing a search pattern (or fold zero line)?

五迷三道 提交于 2019-12-11 01:48:25
问题 I have text files which are simply lists with no paragraphs. When I want to focus on an item, I am able to fold everything except for matches to my search, thanks to Vim Wikia (Tip 282 :"Simple Folding") : :set foldexpr=getline(v:lnum)!~@/ :nnoremap <F8> :set foldmethod=expr<CR><Bar>zM This proves to be useful : thus I can see very clearly the items I am looking for : they appear in white on a black background, whereas the folds are darkgrey (ctermfg) on grey (ctermbg). But there is a - minor

LLVM-IR syntax folding for Vim

本秂侑毒 提交于 2019-12-10 23:27:09
问题 I am working with LLVM-IR code, generated by clang -emit-llvm and want to get code folding working. So far I am using foldmethod=expr and foldexpr=LLVMFold() . I would like to use syntax based folding (i.e. foldmethod=syntax ) using the syntax file from the llvm repository. Available here. Note that the first regex is from the syntax file for the label. function! LLVMFolds() let thisline = getline(v:lnum) if match(thisline, '^[-a-zA-Z$._][-a-zA-Z$._0-9]*:') >= 0 return ">2" elseif match

A problem with folding bash functions in vim

天大地大妈咪最大 提交于 2019-12-10 17:20:01
问题 I have a bash script file which starts with a function definition, like this: #!/bin/bash # ..... # ..... function test { ... ... } ... ... I use vim 7.2, and I have set g:sh_fold_enabled=1 such that folding is enabled with bash. The problem is that the folding of the function test is not ended correctly, i.e. it lasts until the end of file. It looks something like this: #!/bin/bash # ..... # ..... +-- 550 lines: function test {---------------------------------------- ~ ~ The function itself

Change map type of an MKMapView

[亡魂溺海] 提交于 2019-12-10 17:17:38
问题 I'm trying to develop an interface for the user to change mapType views. I'd like to implement this by adding a fold effect to the bottom-right corner of the mapview where the user can press or press and drag in the bottom-right corner and the map will fold up just enough to reveal the 3 different mapTypes: regular, hybrid, and satellite. This is the same functionality that google maps on the iPhone has. Load the app and notice the 'paper-folding' button in the lower right corner. Press it

Code/text folding in SWING

…衆ロ難τιáo~ 提交于 2019-12-10 15:46:01
问题 I'm looking for a way to provide 'text folding' capabilities to a swing JTextArea or JTextPane More specifically, I want to add a block of data in a text component and I want the component to display only some header line. Then the user can unfold the block by clicking some icon. This is just like the code folding feature in most IDE. I've found ->some sample code<- after some thorough search, but the mechanisms used here are quite obscure to me and it stops working when I try to remove text

IntelliJ IDEA plugin to fold .conf files?

情到浓时终转凉″ 提交于 2019-12-10 13:50:00
问题 I have a Scala app built with Lift framework. It has a few .conf files. When I open those .conf files in my IntelliJ IDEA Ultimate Fancy Pants Edition, I do not see any buttons to fold those curly braces in those files. Hotkeys do not do it either. Browsed for plugins, none applicable found. Is there any solution to enable code folding in .conf files? Update : Here is an illustration of what would be lovely. Those "-" and "+" icons do not appear in .conf files: 回答1: Those .conf files are of

Android code folding the Switch block

纵饮孤独 提交于 2019-12-10 03:09:03
问题 Under Android Studio 1.0.2 is there a way to fold the block of code for a Switch conditional statement? I could not find how to do it online or in File > Settings. 回答1: Select the code block and right click to choose fold code block (it "says" Ctrl-Shift-Period but Ctrl-Shift-Period doesnt really do it....) 回答2: To fold an arbitrary selected block Select contiguous fragment of code in the editor. On the main menu, choose Code|Folding|Fold Selection/Remove Region, or press Ctrl + Period Source