Skip to content

Commit

Permalink
Support IEditorAssociationOverride (#341)
Browse files Browse the repository at this point in the history
  • Loading branch information
ghentschke authored and jonahgraham committed Apr 4, 2023
1 parent 47275c3 commit 69c46ff
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.SafeRunner;
Expand Down Expand Up @@ -617,6 +618,11 @@ public static String getEditorID(IEditorInput input, Object inputObject) {
if (input instanceof IFileEditorInput) {
IFileEditorInput editorInput = (IFileEditorInput) input;
IFile file = editorInput.getFile();
try {
return IDE.getEditorDescriptor(file, true, false).getId();
} catch (PartInitException | OperationCanceledException e) {
// do nothing
}
// Try file specific editor.
try {
String editorID = file.getPersistentProperty(IDE.EDITOR_KEY);
Expand Down

0 comments on commit 69c46ff

Please sign in to comment.