Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Unified Diff: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/WorkingCopyManager.java

Issue 11299114: fix for open editor and model change sync up (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/WorkingCopyManager.java
===================================================================
--- editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/WorkingCopyManager.java (revision 15170)
+++ editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/WorkingCopyManager.java (working copy)
@@ -13,6 +13,8 @@
*/
package com.google.dart.tools.ui.internal.text.editor;
+import com.google.dart.tools.core.DartCore;
+import com.google.dart.tools.core.internal.model.CompilationUnitImpl;
import com.google.dart.tools.core.model.CompilationUnit;
import com.google.dart.tools.ui.IWorkingCopyManager;
import com.google.dart.tools.ui.IWorkingCopyManagerExtension;
@@ -21,6 +23,7 @@
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.part.FileEditorInput;
import java.util.HashMap;
import java.util.Map;
@@ -78,9 +81,14 @@
if (unit == null) {
unit = fDocumentProvider.getWorkingCopy(input);
}
- if (unit != null && (!primaryOnly || DartModelUtil.isPrimary(unit))) {
- return unit;
+ if (unit != null) {
+ if (unit instanceof CompilationUnitImpl && input instanceof FileEditorInput) {
+ return (CompilationUnit) DartCore.create(((FileEditorInput) input).getFile());
+ } else if (!primaryOnly || DartModelUtil.isPrimary(unit)) {
+ return unit;
+ }
}
+
return null;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698