.getStart());
}
if (tRegion != null
&& tRegion instanceof IPhpScriptRegion) {
IPhpScriptRegion scriptRegion = (IPhpScriptRegion) tRegion;
// update region offset for in order to get
// phpdoc region later
regionOffset -= scriptRegion.getStart();
ITextRegion commentRegion = scriptRegion
.getPhpToken(regionOffset);
String tokenType = commentRegion.getType();
if (document.getLength() == offset
&& (tokenType
.equals(PHPRegionTypes.PHPDOC_COMMENT_END) || tokenType
.equals(PHPRegionTypes.PHP_COMMENT_END))
&& document.get(offset - 2, 2).equals(
"*/")) { //$NON-NLS-1$
ITextRegion region = commentRegion;
// go up in document and search for the
// first line containing
// PHPDOC_COMMENT_START/PHP_COMMENT_START
// tag
do {
if (region.getType() == PHPRegionTypes.PHPDOC_COMMENT_START
|| region.getType() == PHPRegionTypes.PHP_COMMENT_START
|| region.getStart() <= scriptRegion
.getStart()) {
break;
}
// get previous region
region = scriptRegion
.getPhpToken(region.getStart()
- lineDelimiters[index]
.length());
} while (true);