try {
final IStructuredDocument structuredDocument = modelForEdit
.getStructuredDocument();
// create the partitioner
final PHPStructuredTextPartitioner structuredTextPartitioner = new PHPStructuredTextPartitioner();
structuredTextPartitioner.connect(structuredDocument);
// go over the file, one line at a time, and search for the markers
String curLine = reader.readLine();
while (curLine != null) {
for (int i = 0; i < markers.length; i++) {
int lineOffset = curLine.indexOf(markers[i]);
// if marker was found in current line, get partition type
if (lineOffset != -1) {
ITypedRegion partition = structuredTextPartitioner
.getPartition(offset + lineOffset);
results.add(partition.getType());
}
}
// update global offset