Skip to content

Commit

Permalink
Remove last calls to JavaUI.getDocumentProvider
Browse files Browse the repository at this point in the history
With the introduction of `ScalaDocumentProvider`, this method no longer
returns the correct document provider.
  • Loading branch information
kiritsuku committed Oct 11, 2014
1 parent 7b622ed commit b1f6ab3
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -25,6 +25,7 @@ import org.eclipse.ui.PlatformUI
import org.eclipse.ui.part.FileEditorInput
import org.eclipse.ui.texteditor.ITextEditor
import org.scalaide.core.compiler.InteractiveCompilationUnit
import org.scalaide.core.internal.ScalaPlugin
import org.scalaide.core.internal.jdt.model.ScalaSourceFile
import org.scalaide.ui.editor.ISourceViewerEditor
import org.scalaide.ui.editor.InteractiveCompilationUnitEditor
Expand Down Expand Up @@ -59,7 +60,8 @@ object EditorUtils {
*/
def getAnnotationsAtOffset(part: org.eclipse.ui.IEditorPart, offset: Int): Iterator[(Annotation, Position)] = {
import scala.collection.JavaConverters._
val model = JavaUI.getDocumentProvider.getAnnotationModel(part.getEditorInput)

val model = ScalaPlugin().documentProvider.getAnnotationModel(part.getEditorInput)

val annotations = model match {
case null => Iterator.empty
Expand Down Expand Up @@ -247,7 +249,7 @@ object EditorUtils {
val page = window.getActivePage()
val part = Option(page.findEditor(new FileEditorInput(file))).getOrElse(EditorUtility.openInEditor(file, true))
page.bringToTop(part)
JavaUI.getDocumentProvider().getDocument(part.getEditorInput());
ScalaPlugin().documentProvider.getDocument(part.getEditorInput)
}
}
}

0 comments on commit b1f6ab3

Please sign in to comment.