[idea][performance] Only relink a model on the modification counter

change, reparsing should be triggered by changing a corresponding xtext
file

Change-Id: I716eefbbe1166569179564c50335d4e2d61808e3
Signed-off-by: akosyakov <anton.kosyakov@itemis.de>
This commit is contained in:
akosyakov 2015-04-14 15:47:46 +02:00 committed by Sebastian Zarnekow
parent f02008ed14
commit f318b5e6a3

View file

@ -226,6 +226,21 @@ public class XtextResource extends ResourceImpl {
super.doUnload();
parseResult = null;
}
/**
* @since 2.9
*/
public void relink() {
if (!isLoaded()) {
throw new IllegalStateException("You can't update an unloaded resource.");
}
try {
isUpdating = true;
updateInternalState(parseResult, parseResult);
} finally {
isUpdating = false;
}
}
public void update(int offset, int replacedTextLength, String newText) {
if (!isLoaded()) {