views:

387

answers:

4

How do I modify the java language definition bundle foldingStartMarker and foldingStopMarker entries to allow for folding of these types of comment blocks?

This is the comment style:

/**
 * This is a comment...
 * Yet another comment...
 */

I've tried this:

foldingStartMarker = '(\{\s*(//.*)?$|^\s*// \{\{\{|^\s*\/\*\*)';
foldingStopMarker = '^\s*(\}|// \}\}\}$|\*\/)';

I get the first match for '/**' characters, but I can't get it to find the StopMarker '*/'.

Thanks!

A: 

It's not ideal but I found that if you end your comment with **/ instead of */ in a C++ source file, it recognizes them for folding.

A: 

Same problem here (custom language, but same comment block style). It seems that the foldingStopMarker never works on lines starting with a whitespace.

I tried many combinations and whenever the line does start with a whitespace, I was unable to build a foldingStopMarker regex that would match it, independent of the other characters in that line.

Seems like a bug.

Alexander Klimetschek
+1  A: 

This works for me (in Javascript language):

foldingStartMarker = '^\s*\/\*';
foldingStopMarker = '\s*\*\/$';
Petr Vostrel
A: 

My project

qw