[xtext] Minor: Code cleanup in MultilineCommentDocumentationProvider

This commit is contained in:
Sebastian Zarnekow 2012-03-15 15:59:45 +01:00
parent d83d4f8365
commit 3ce0d96106

View file

@ -82,14 +82,14 @@ public class MultiLineCommentDocumentationProvider implements IEObjectDocumentat
List<INode> result = Collections.emptyList();
if (node != null) {
// get the last multi line comment before a non hidden leaf node
for (INode abstractNode : node.getLeafNodes()) {
if (abstractNode instanceof ILeafNode && !((ILeafNode) abstractNode).isHidden())
for (ILeafNode leafNode : node.getLeafNodes()) {
if (!leafNode.isHidden())
break;
if (abstractNode instanceof ILeafNode && abstractNode.getGrammarElement() instanceof TerminalRule
&& ruleName.equalsIgnoreCase(((TerminalRule) abstractNode.getGrammarElement()).getName())) {
String comment = ((ILeafNode) abstractNode).getText();
if (leafNode.getGrammarElement() instanceof TerminalRule
&& ruleName.equalsIgnoreCase(((TerminalRule) leafNode.getGrammarElement()).getName())) {
String comment = leafNode.getText();
if (comment.matches("(?s)" + startTag + ".*")) {
result = Collections.singletonList(abstractNode);
result = Collections.<INode>singletonList(leafNode);
}
}
}