[ANN] CodeFolder 0.1
This plugin provides code folding for the following:
- code license (by use of a regular expression)
- for, while, if, and switch statements
The source code has been posted also and you are free to
add code folding for other statements.
This plugin is available at:
http://www.intellij.org/twiki/bin/view/Main/CodeFolder
DISCLAIMER: This plugin uses the Psi Api which is not supported
by Intellij
I have not added this plugin to the PluginManager's
Xml registry yet. I will do so tomorrow.
Enjoy!!
Kelly Ray Jensen
请先登录再写评论。
Nice.
Why is it in the project preferences and not in the IDE prefs?
I think you should do something similar to IJ itself, i.e.: Have settings to
enable folding of if, switch, etc., and a different set of what to collapse
by default. IntelliJ doesn't have the first one, i.e. you can always fold
methods, but you can control if by default methods are collapsed or not.
Amnon
"Kelly Ray Jensen" <kellyrayj@myrealbox.com> wrote in message
news:pan.2002.11.17.10.52.47.530799@myrealbox.com...
>
>
>
>
>
>
>
>
A few problems found:
- NullPointerException on Expand All (mentioned by the plugin author) - it
was actually a bug in IDEA and it's fixed in #681
- If I select to fold if, while etc statements they are all added
collapsed. I personally find it inconvenient.
- Fold regions are added only once and never updated (for example, if I
type new if-statement).
Notes about plugin's source code:
- There is no need to run command in CommandProcessor to add/remove code
foldings.
- It's better to group added of multiple fold regions in one call to
FoldingModel.runBatchFoldingOperation(). This will result in better
performance.
P.S. Great plugin btw!
--
Valentin Kipiatkov
JetBrains, Inc
http://www.intellij.com
"Develop with pleasure!"
"Kelly Ray Jensen" <kellyrayj@myrealbox.com> wrote in message
news:pan.2002.11.17.10.52.47.530799@myrealbox.com...
>
>
>
>
>
>
>
>
Thanks for the comments!
I will fix these issues soon.
Kelly
On Mon, 18 Nov 2002 15:49:42 +0300, Valentin Kipiatkov wrote:
>> This plugin provides code folding for the following:
>>
>> - code license (by use of a regular expression)
>> - for, while, if, and switch statements
>>
>> The source code has been posted also and you are free to
>> add code folding for other statements.
>>
>> This plugin is available at:
>>
>> http://www.intellij.org/twiki/bin/view/Main/CodeFolder
>>
>> DISCLAIMER: This plugin uses the Psi Api which is not supported
>> by Intellij
>>
>> I have not added this plugin to the PluginManager's
>> Xml registry yet. I will do so tomorrow.
>>
>> Enjoy!!
>>
>> Kelly Ray Jensen
Nice plugin!
And here's a feature request: provide an option (or make it the default
behaviour :) to show the conditions for if statements and fold only the
content (similar to what IDEA does, it shows the method's signature and
folds the content). The same goes for the other statements as well, this
would enhance the readability of the code when folded.
Thx,
Andrei
"Kelly Ray Jensen" <kellyrayj@myrealbox.com> wrote in message
news:pan.2002.11.17.10.52.47.530799@myrealbox.com...
>
>
>
>
>
>
>
>
O.k. I'll add it for the next version.
thanks,
Kelly
Andrei Oprea wrote:
>
>
>
>
>
>
>
Some more suggestions:
- add folding for 'try' and 'catch' blocks
- add a generic folding for any statement block
- add separate folding for 'if' and 'else'
- add folding for multiline comments
- by default everything should be either unfolded
or there should be some option to control that
- some menu entries under View/Folding may make
sense (Expand/Collapse Code Folding)
Great plugin, thanks!
Marius
Kelly Ray Jensen wrote:
>> Nice plugin!
>>
>> And here's a feature request: provide an option (or make it the default
>> behaviour :) to show the conditions for if statements and fold only the
>> content (similar to what IDEA does, it shows the method's signature and
>> folds the content). The same goes for the other statements as well, this
>> would enhance the readability of the code when folded.
>>
>> Thx,
>> Andrei
>>
>> "Kelly Ray Jensen" wrote in message
>> news:pan.2002.11.17.10.52.47.530799@myrealbox.com...
>>
>> >This plugin provides code folding for the following:
>> >
>> >- code license (by use of a regular expression)
>> >- for, while, if, and switch statements
>> >
>> >The source code has been posted also and you are free to
>> >add code folding for other statements.
>> >
>> >This plugin is available at:
>> >
>> >http://www.intellij.org/twiki/bin/view/Main/CodeFolder
>> >
>> >DISCLAIMER: This plugin uses the Psi Api which is not supported
>> >by Intellij
>> >
>> >I have not added this plugin to the PluginManager's
>> >Xml registry yet. I will do so tomorrow.
>> >
>> >Enjoy!!
>> >
>> >Kelly Ray Jensen
>>
>>
>>
Thanks for the suggestions.
- add folding for 'try' and 'catch' blocks
- some menu entries under View/Folding may make
sense (Expand/Collapse Code Folding)
- by default everything should be either unfolded
or there should be some option to control that
I will add the above for the next version also and the other
ones for a later version.
Any more requests?
Kelly
Marius Scurtescu wrote:
>
>
>
>
>
I am writing a plugin with some similiar behavior (but enough different to need a new plugin). Valentin said:
+ - Fold regions are added only once and never updated (for example, if I type new if-statement).+
How can I implement this? I assume I need to register some listener somewhere to know when a new if-statment is created?
The interface com.intellij.psi.PsiTreeChangeListener
lets you know when new PsiElements are being created.
You can also extend the com.intellij.psi.PsiTreeChangeAdapter
class.
Kelly
John Murph wrote:
>
>
>
Hey kelly how about posting the code for the VI plugin you started? lots of people want it (based on votes) and there are some that are willing to work on it.
Charles,
There is going to be a new version of the Vi plugin tomorrow.
A few weeks ago I was contacted by Dewayne McNair concerning
the Vi plugin. He had created his own version of the plugin
which was more complete than mine. I sent my code to him so
that he could merge the two code bases.
I contacted him today and he said that he will release the new
version tomorrow.
Kelly
On Sat, 23 Nov 2002 01:43:10 +0000, charles decroes wrote:
lots of people want it (based on votes) and there are some that are
willing to work on it.
that is great. I hope he releases the code with it, so we can all work on it.
Being able to fold anonymous classes would be great. Thanks for the great
stuff!
Eugene
"Kelly Ray Jensen" <kellyrayj@myrealbox.com> wrote in message
news:arm72v$fec$1@is.intellij.net...
>
>
>
>
>
>
default
the
and
>
Why not classes/interfaces in general then?
You can have several classes in the same file and inner
classes as well.
Marius
Eugene Belyaev wrote:
>>Thanks for the suggestions.
>>
>>- add folding for 'try' and 'catch' blocks
>>- some menu entries under View/Folding may make
>>sense (Expand/Collapse Code Folding)
>>- by default everything should be either unfolded
>>or there should be some option to control that
>>
>>I will add the above for the next version also and the other
>>ones for a later version.
>>
>>Any more requests?
>>
>>Kelly
>>
>>Marius Scurtescu wrote:
>>
>>
>>>Some more suggestions:
>>>- add folding for 'try' and 'catch' blocks
>>>- add a generic folding for any statement block
>>>- add separate folding for 'if' and 'else'
>>>- add folding for multiline comments
>>>- by default everything should be either unfolded
>>>or there should be some option to control that
>>>- some menu entries under View/Folding may make
>>>sense (Expand/Collapse Code Folding)
>>>
>>>Great plugin, thanks!
>>>
>>>Marius
>>>
>>>Kelly Ray Jensen wrote:
>>>
>>>
>>>>O.k. I'll add it for the next version.
>>>>
>>>>thanks,
>>>>
>>>>Kelly
>>>>
>>>>Andrei Oprea wrote:
>>>>
>>>>
>>>>>Nice plugin!
>>>>>
>>>>>And here's a feature request: provide an option (or make it the
>>>>
>>>>>behaviour :) to show the conditions for if statements and fold only
>>>>
>>>>>content (similar to what IDEA does, it shows the method's signature
>>>>
>>>>>folds the content). The same goes for the other statements as well,
>>>>
>>>this
>>>
>>>>>would enhance the readability of the code when folded.
>>>>>
>>>>>Thx,
>>>>>Andrei
>>>>>
>>>>>"Kelly Ray Jensen" wrote in message
>>>>>news:pan.2002.11.17.10.52.47.530799@myrealbox.com...
>>>>>
>>>>>
>>>>>>This plugin provides code folding for the following:
>>>>>>
>>>>>>- code license (by use of a regular expression)
>>>>>>- for, while, if, and switch statements
>>>>>>
>>>>>>The source code has been posted also and you are free to
>>>>>>add code folding for other statements.
>>>>>>
>>>>>>This plugin is available at:
>>>>>>
>>>>>>http://www.intellij.org/twiki/bin/view/Main/CodeFolder
>>>>>>
>>>>>>DISCLAIMER: This plugin uses the Psi Api which is not supported
>>>>>>by Intellij
>>>>>>
>>>>>>I have not added this plugin to the PluginManager's
>>>>>>Xml registry yet. I will do so tomorrow.
>>>>>>
>>>>>>Enjoy!!
>>>>>>
>>>>>>Kelly Ray Jensen
>>>>>
>>>>>
>>>>>
O.K. Consider it done!
I should have a version 0.2 ready this weekend.
Kelly
Marius Scurtescu wrote:
>
>
>
>
>
Well, inner classes are folded by IDEA itself. The only thing I miss are
anonymous and local classes.
Eugene
"Kelly Ray Jensen" <kellyrayj@myrealbox.com> wrote in message
news:artva6$si$1@is.intellij.net...
>
>
>
>
only
signature
well,
>
Can we have an option to show the folding outline on these things, but have
them NOT folded by default? The same way that the main folding code does
it?
Aside from that, this looks really neat, thanks you.
Guy
"Kelly Ray Jensen" <kellyray@ida.net> wrote in message
news:arm3sc$at2$1@is.intellij.net...
>
>
>
>
>
> have them NOT folded by default?
That will be fixed in the next version (0.2 - which will be released by
this weekend).
I will look into the folding outline issue.
Kelly
Guy Gascoigne - Piggford wrote:
>
>