mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-16 00:38:56 +00:00
bug 239456: [Outline] Preserve expansion state of outline.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=239456
This commit is contained in:
parent
46aae376ae
commit
f1dcab3614
1 changed files with 8 additions and 1 deletions
|
@ -58,12 +58,19 @@ public class XtextResource extends ResourceImpl {
|
|||
int length = change.length();
|
||||
int documentGrowth = length - rootNode.length();
|
||||
int originalLength = length - documentGrowth;
|
||||
|
||||
// unloading is required to ensure that any EObjects hanging around (e.g. in the outline) get a proxied URI
|
||||
// and thus still can be compared by their URI
|
||||
unload();
|
||||
|
||||
parseResult = parser.reparse(rootNode, offset, originalLength, change);
|
||||
getContents().clear();
|
||||
getContents().add(parseResult.getRootASTElement());
|
||||
if (parseResult != null && parseResult.getRootNode() != rootNode) {
|
||||
addNodeContentAdapter();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void addNodeContentAdapter() {
|
||||
parseResult.getRootNode().eAdapters().add(new NodeContentAdapter());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue