1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-21 21:52:10 +02:00

Support IEditorAssociationOverride (#341)

This commit is contained in:
Gesa HENTSCHKE 2023-03-28 08:03:54 +02:00 committed by Jonah Graham
parent 6cf3e03c35
commit d2a5a57d01

View file

@ -75,6 +75,7 @@ import org.eclipse.core.runtime.IPath;
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;
@ -617,6 +618,11 @@ public class EditorUtility {
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);