Skip to content

Commit e3f5b5d

Browse files
committed
TextBlocks are also converted to TextBlockReferences.
1 parent ea62a9c commit e3f5b5d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

bundles/jamopp.parser.jdt.singlefile/src/jamopp/parser/jdt/singlefile/ReferenceConverterUtility.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import org.eclipse.jdt.core.dom.SuperConstructorInvocation;
3838
import org.eclipse.jdt.core.dom.SuperFieldAccess;
3939
import org.eclipse.jdt.core.dom.SuperMethodInvocation;
40+
import org.eclipse.jdt.core.dom.TextBlock;
4041
import org.eclipse.jdt.core.dom.ThisExpression;
4142
import org.eclipse.jdt.core.dom.Type;
4243
import org.eclipse.jdt.core.dom.TypeLiteral;
@@ -241,6 +242,13 @@ private static org.emftext.language.java.references.Reference internalConvertToR
241242
parent.setNext(result);
242243
LayoutInformationConverter.convertToMinimalLayoutInformation(result, arr);
243244
return result;
245+
} else if (expr.getNodeType() == ASTNode.TEXT_BLOCK) {
246+
TextBlock textBlock = (TextBlock) expr;
247+
org.emftext.language.java.references.TextBlockReference result = org.emftext.language
248+
.java.references.ReferencesFactory.eINSTANCE.createTextBlockReference();
249+
result.setValue(textBlock.getEscapedValue());
250+
LayoutInformationConverter.convertToMinimalLayoutInformation(result, textBlock);
251+
return result;
244252
}
245253
return null;
246254
}

0 commit comments

Comments
 (0)