mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-16 16:58:56 +00:00
ASSIGNED - bug 251868: [Outline] Outline View shows only subgraph of the AST after partial parse
https://bugs.eclipse.org/bugs/show_bug.cgi?id=251868
This commit is contained in:
parent
c05a906e0f
commit
c8f9edc9ba
1 changed files with 9 additions and 9 deletions
|
@ -73,15 +73,8 @@ public class PartialParsingUtil {
|
|||
// on error fully reparse
|
||||
return fullyReparse(parser, rootNode, offset, replacedTextLength, newText);
|
||||
}
|
||||
if (replaceNode != rootNode) {
|
||||
CompositeNode replaceNodeParent = replaceNode.getParent();
|
||||
EList<AbstractNode> replaceNodeSiblings = replaceNodeParent.getChildren();
|
||||
int nodeChildIndex = replaceNodeSiblings.indexOf(replaceNode);
|
||||
replaceNodeSiblings.set(nodeChildIndex, parseResult.getRootNode());
|
||||
parseResult.setRootNode(rootNode);
|
||||
}
|
||||
EObject replaceAstElement = parsingPointers.findASTReplaceElement(replaceNode);
|
||||
EObject astParentElement = parsingPointers.findASTParentElement(replaceNode);
|
||||
EObject replaceAstElement = parsingPointers.findASTReplaceElement(replaceNode);
|
||||
if (astParentElement != null) {
|
||||
String featureName = parsingPointers.findASTContainmentFeatureName(replaceNode);
|
||||
EClass astParentEClass = astParentElement.eClass();
|
||||
|
@ -94,7 +87,14 @@ public class PartialParsingUtil {
|
|||
else {
|
||||
astParentElement.eSet(feature, parseResult.getRootASTElement());
|
||||
}
|
||||
parseResult.setRootASTElement(NodeUtil.getASTElementForRootNode(parseResult.getRootNode()));
|
||||
parseResult.setRootASTElement(NodeUtil.getASTElementForRootNode(rootNode));
|
||||
}
|
||||
if (replaceNode != rootNode) {
|
||||
CompositeNode replaceNodeParent = replaceNode.getParent();
|
||||
EList<AbstractNode> replaceNodeSiblings = replaceNodeParent.getChildren();
|
||||
int nodeChildIndex = replaceNodeSiblings.indexOf(replaceNode);
|
||||
replaceNodeSiblings.set(nodeChildIndex, parseResult.getRootNode());
|
||||
parseResult.setRootNode(rootNode);
|
||||
}
|
||||
return parseResult;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue