mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-16 08:48:55 +00:00
[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:
parent
f02008ed14
commit
f318b5e6a3
1 changed files with 15 additions and 0 deletions
|
@ -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()) {
|
||||
|
|
Loading…
Reference in a new issue