mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-09-05 06:33:23 +02:00
Bug 579758 - Codan marker resolution doesn't work with CEditor embedded
in a multi page editor Adapt editorPart to ITextEditor to support more use cases Change-Id: I21e367e793bc17da263775b22ed13e82742be10f Signed-off-by: Dominic Scharfe <dominic.scharfe@coseda-tech.com>
This commit is contained in:
parent
290136af02
commit
491333aaa4
1 changed files with 3 additions and 6 deletions
|
@ -35,6 +35,7 @@ import org.eclipse.core.resources.IMarker;
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
import org.eclipse.core.resources.IResource;
|
import org.eclipse.core.resources.IResource;
|
||||||
import org.eclipse.core.resources.ResourcesPlugin;
|
import org.eclipse.core.resources.ResourcesPlugin;
|
||||||
|
import org.eclipse.core.runtime.Adapters;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IPath;
|
import org.eclipse.core.runtime.IPath;
|
||||||
import org.eclipse.jface.text.BadLocationException;
|
import org.eclipse.jface.text.BadLocationException;
|
||||||
|
@ -177,12 +178,8 @@ public abstract class AbstractCodanCMarkerResolution implements ICodanMarkerReso
|
||||||
* @return the document of that part
|
* @return the document of that part
|
||||||
*/
|
*/
|
||||||
protected IDocument openDocument(IEditorPart editorPart) {
|
protected IDocument openDocument(IEditorPart editorPart) {
|
||||||
if (editorPart instanceof ITextEditor) {
|
ITextEditor textEditor = Adapters.adapt(editorPart, ITextEditor.class);
|
||||||
ITextEditor editor = (ITextEditor) editorPart;
|
return textEditor == null ? null : textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
|
||||||
IDocument doc = editor.getDocumentProvider().getDocument(editor.getEditorInput());
|
|
||||||
return doc;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue