From 9846eef18b082b9610220514b08b4ff659b81a06 Thu, 12 Aug 2010 13:57:11 +0800 From: Jin Mingjian Date: Sat, 7 Aug 2010 19:58:45 +0800 Subject: [PATCH] correct some primary problems. diff --git a/org.scala-ide.sdt.core/src/scala/tools/eclipse/ScalaSourceViewerConfiguration.scala b/org.scala-ide.sdt.core/src/scala/tools/eclipse/ScalaSourceViewerConfiguration.scala index 3ec12bc..d3b989f 100644 --- a/org.scala-ide.sdt.core/src/scala/tools/eclipse/ScalaSourceViewerConfiguration.scala +++ b/org.scala-ide.sdt.core/src/scala/tools/eclipse/ScalaSourceViewerConfiguration.scala @@ -141,20 +141,22 @@ } override def getContentFormatter(sourceViewer: ISourceViewer) = { - val contentFormatter = new ContentFormatter + val contentFormatter = new ContentFormatter contentFormatter.enablePartitionAwareFormatting( false ); contentFormatter.setFormattingStrategy(new ScalaFormattingStrategy(sourceViewer), IDocument.DEFAULT_CONTENT_TYPE) - contentFormatter + contentFormatter } } object ScalaSourceViewerConfigurationUtils extends ReflectionUtils { val bestMatchHoverClazz = classOf[BestMatchHover] - val addTextHoverMethod = getDeclaredMethod(bestMatchHoverClazz, "addTextHover", classOf[ITextHover]) + //val addTextHoverMethod = getDeclaredMethod(bestMatchHoverClazz, "addTextHover", classOf[ITextHover]) + val bestMatchHoverField = getDeclaredField(bestMatchHoverClazz, "fBestHover") val hyperlinkDetectorDelegateClazz = Class.forName("org.eclipse.ui.texteditor.HyperlinkDetectorRegistry$HyperlinkDetectorDelegate") val hyperlinkDescriptorField = getDeclaredField(hyperlinkDetectorDelegateClazz, "fHyperlinkDescriptor") - def addTextHover(bmh : BestMatchHover, hover : ITextHover) = addTextHoverMethod.invoke(bmh, hover) + //def addTextHover(bmh : BestMatchHover, hover : ITextHover) = addTextHoverMethod.invoke(bmh, hover) + def addTextHover(bmh: BestMatchHover, hover: ITextHover) = bestMatchHoverField.set(bmh, hover) def getHyperlinkDescriptor(hdd : IHyperlinkDetector) = hyperlinkDescriptorField.get(hdd).asInstanceOf[HyperlinkDetectorDescriptor] -} +} \ No newline at end of file diff --git a/org.scala-ide.sdt.core/src/scala/tools/eclipse/ScalaToggleBreakpointAdapter.scala b/org.scala-ide.sdt.core/src/scala/tools/eclipse/ScalaToggleBreakpointAdapter.scala index 2edfc0f..002ce67 100644 --- a/org.scala-ide.sdt.core/src/scala/tools/eclipse/ScalaToggleBreakpointAdapter.scala +++ b/org.scala-ide.sdt.core/src/scala/tools/eclipse/ScalaToggleBreakpointAdapter.scala @@ -12,6 +12,7 @@ import org.eclipse.debug.core.DebugPlugin import org.eclipse.jdt.core.{ IJavaElement, IMember, IType } import org.eclipse.jdt.debug.core.JDIDebugModel +import org.eclipse.jdt.internal.debug.core.breakpoints.ValidBreakpointLocationLocator import org.eclipse.jdt.internal.debug.ui.{ BreakpointUtils, JDIDebugUIPlugin } import org.eclipse.jdt.internal.debug.ui.actions.{ ActionMessages, ToggleBreakpointAdapter } import org.eclipse.jface.viewers.IStructuredSelection @@ -24,7 +25,7 @@ class ScalaToggleBreakpointAdapter extends ToggleBreakpointAdapter { self => import ScalaToggleBreakpointAdapterUtils._ - override def toggleLineBreakpoints(part : IWorkbenchPart, selection : ISelection, bestMatch : Boolean) { + override def toggleLineBreakpoints(part : IWorkbenchPart, selection : ISelection, bestMatch : Boolean, locator: ValidBreakpointLocationLocator) { val job = new Job("Toggle Line Breakpoint") { override def run(monitor : IProgressMonitor) : IStatus = { val editor = self.getTextEditor(part) @@ -103,7 +104,7 @@ else if(member.getElementType == IJavaElement.TYPE) toggleClassBreakpoints(part, sel) else - toggleLineBreakpoints(part, selection, true) + toggleLineBreakpoints(part, selection, true, null) } } diff --git a/org.scala-ide.sdt.core/src/scala/tools/eclipse/javaelements/ScalaClassFile.scala b/org.scala-ide.sdt.core/src/scala/tools/eclipse/javaelements/ScalaClassFile.scala index 54afa90..6df7c1e 100644 --- a/org.scala-ide.sdt.core/src/scala/tools/eclipse/javaelements/ScalaClassFile.scala +++ b/org.scala-ide.sdt.core/src/scala/tools/eclipse/javaelements/ScalaClassFile.scala @@ -25,10 +25,9 @@ import scala.tools.nsc.io.{ AbstractFile, VirtualFile } import scala.tools.eclipse.ScalaImages -import scala.tools.eclipse.contribution.weaving.jdt.IScalaClassFile class ScalaClassFile(parent : PackageFragment, name : String, sourceFile : String) - extends ClassFile(parent, name) with ScalaCompilationUnit with IScalaClassFile { + extends ClassFile(parent, name) with ScalaCompilationUnit with scala.tools.eclipse.contribution.weaving.jdt.IScalaClassFile { override def getImageDescriptor = ScalaImages.SCALA_CLASS_FILE override def getElementAt(position : Int) : IJavaElement = { diff --git a/org.scala-ide.sdt.core/src/scala/tools/eclipse/javaelements/ScalaClassFileProvider.scala b/org.scala-ide.sdt.core/src/scala/tools/eclipse/javaelements/ScalaClassFileProvider.scala index 1e59a9e..384e5db 100644 --- a/org.scala-ide.sdt.core/src/scala/tools/eclipse/javaelements/ScalaClassFileProvider.scala +++ b/org.scala-ide.sdt.core/src/scala/tools/eclipse/javaelements/ScalaClassFileProvider.scala @@ -9,11 +9,9 @@ import org.eclipse.jdt.internal.core.{ ClassFile, PackageFragment } -import scala.tools.eclipse.contribution.weaving.jdt.cfprovider.IClassFileProvider - import scala.tools.eclipse.ScalaClassFileDescriber -class ScalaClassFileProvider extends IClassFileProvider { +class ScalaClassFileProvider extends scala.tools.eclipse.contribution.weaving.jdt.cfprovider.IClassFileProvider { override def create(contents : Array[Byte], parent : PackageFragment, name : String) : ClassFile = ScalaClassFileDescriber.isScala(new ByteArrayInputStream(contents)) match { case Some(sourceFile) => diff --git a/org.scala-ide.sdt.core/src/scala/tools/eclipse/javaelements/ScalaCompilationUnit.scala b/org.scala-ide.sdt.core/src/scala/tools/eclipse/javaelements/ScalaCompilationUnit.scala index 330d766..1f3037b 100644 --- a/org.scala-ide.sdt.core/src/scala/tools/eclipse/javaelements/ScalaCompilationUnit.scala +++ b/org.scala-ide.sdt.core/src/scala/tools/eclipse/javaelements/ScalaCompilationUnit.scala @@ -25,12 +25,10 @@ import scala.tools.nsc.io.AbstractFile import scala.tools.nsc.util.{ BatchSourceFile, SourceFile } -import scala.tools.eclipse.contribution.weaving.jdt.{ IScalaCompilationUnit, IScalaWordFinder } - import scala.tools.eclipse.{ ScalaImages, ScalaPlugin, ScalaPresentationCompiler, ScalaSourceIndexer, ScalaWordFinder } import scala.tools.eclipse.util.ReflectionUtils -trait ScalaCompilationUnit extends Openable with env.ICompilationUnit with ScalaElement with IScalaCompilationUnit with IBufferChangedListener { +trait ScalaCompilationUnit extends Openable with env.ICompilationUnit with ScalaElement with scala.tools.eclipse.contribution.weaving.jdt.IScalaCompilationUnit with IBufferChangedListener { val project = ScalaPlugin.plugin.getScalaProject(getJavaProject.getProject) def file : AbstractFile @@ -195,7 +193,7 @@ } } - override def getScalaWordFinder() : IScalaWordFinder = ScalaWordFinder + override def getScalaWordFinder() : scala.tools.eclipse.contribution.weaving.jdt.IScalaWordFinder = ScalaWordFinder } object OpenableUtils extends ReflectionUtils { diff --git a/org.scala-ide.sdt.core/src/scala/tools/eclipse/javaelements/ScalaCompletionProposal.scala b/org.scala-ide.sdt.core/src/scala/tools/eclipse/javaelements/ScalaCompletionProposal.scala index be52027..b090146 100644 --- a/org.scala-ide.sdt.core/src/scala/tools/eclipse/javaelements/ScalaCompletionProposal.scala +++ b/org.scala-ide.sdt.core/src/scala/tools/eclipse/javaelements/ScalaCompletionProposal.scala @@ -7,9 +7,8 @@ import org.eclipse.jdt.internal.codeassist.InternalCompletionProposal -import scala.tools.eclipse.contribution.weaving.jdt.IScalaCompletionProposal - class ScalaCompletionProposal(kind : Int, completionLocation : Int) - extends InternalCompletionProposal(kind, completionLocation) with IScalaCompletionProposal { + extends InternalCompletionProposal(kind, completionLocation) + with scala.tools.eclipse.contribution.weaving.jdt.IScalaCompletionProposal { var suppressArgList = false } diff --git a/org.scala-ide.sdt.core/src/scala/tools/eclipse/javaelements/ScalaElements.scala b/org.scala-ide.sdt.core/src/scala/tools/eclipse/javaelements/ScalaElements.scala index 2e099d2..e022796 100644 --- a/org.scala-ide.sdt.core/src/scala/tools/eclipse/javaelements/ScalaElements.scala +++ b/org.scala-ide.sdt.core/src/scala/tools/eclipse/javaelements/ScalaElements.scala @@ -20,11 +20,9 @@ import org.eclipse.swt.graphics.Image import scala.tools.eclipse.ScalaImages -import scala.tools.eclipse.contribution.weaving.jdt.IScalaElement -import scala.tools.eclipse.contribution.weaving.jdt.ui.IMethodOverrideInfo import scala.tools.eclipse.util.ReflectionUtils -trait ScalaElement extends JavaElement with IScalaElement { +trait ScalaElement extends JavaElement with scala.tools.eclipse.contribution.weaving.jdt.IScalaElement { def getElementInfo : AnyRef def getElementName : String def scalaName : String = getElementName @@ -101,7 +99,7 @@ } class ScalaDefElement(parent : JavaElement, name: String, paramTypes : Array[String], synthetic : Boolean, display : String) - extends SourceMethod(parent, name, paramTypes) with ScalaElement with IMethodOverrideInfo { + extends SourceMethod(parent, name, paramTypes) with ScalaElement with scala.tools.eclipse.contribution.weaving.jdt.ui.IMethodOverrideInfo { override def getLabelText(flags : Long) = display override def isVisible = !synthetic && !getElementInfo.isInstanceOf[ScalaSourceConstructorInfo] } diff --git a/org.scala-ide.sdt.core/src/scala/tools/eclipse/javaelements/ScalaOverrideIndicatorBuilder.scala b/org.scala-ide.sdt.core/src/scala/tools/eclipse/javaelements/ScalaOverrideIndicatorBuilder.scala index b98b8be..8cb3335 100644 --- a/org.scala-ide.sdt.core/src/scala/tools/eclipse/javaelements/ScalaOverrideIndicatorBuilder.scala +++ b/org.scala-ide.sdt.core/src/scala/tools/eclipse/javaelements/ScalaOverrideIndicatorBuilder.scala @@ -11,8 +11,6 @@ import org.eclipse.jface.text.{ Position => JFacePosition } import org.eclipse.jface.text.source.Annotation -import scala.tools.eclipse.contribution.weaving.jdt.IScalaOverrideIndicator - import scala.tools.eclipse.ScalaPresentationCompiler trait ScalaOverrideIndicatorBuilder { self : ScalaPresentationCompiler => @@ -71,7 +69,7 @@ methodTypeSignatures : List[String], text : String, isDeferred : Boolean - ) extends Annotation(ANNOTATION_TYPE, false, text) with IScalaOverrideIndicator { + ) extends Annotation(ANNOTATION_TYPE, false, text) with scala.tools.eclipse.contribution.weaving.jdt.IScalaOverrideIndicator { override def isOverwriteIndicator : Boolean = isDeferred diff --git a/org.scala-ide.sdt.core/src/scala/tools/eclipse/javaelements/ScalaSourceFile.scala b/org.scala-ide.sdt.core/src/scala/tools/eclipse/javaelements/ScalaSourceFile.scala index 8105ecb..da03f6a 100644 --- a/org.scala-ide.sdt.core/src/scala/tools/eclipse/javaelements/ScalaSourceFile.scala +++ b/org.scala-ide.sdt.core/src/scala/tools/eclipse/javaelements/ScalaSourceFile.scala @@ -19,8 +19,6 @@ import scala.tools.nsc.io.{ AbstractFile, VirtualFile } import scala.tools.nsc.util.BatchSourceFile -import scala.tools.eclipse.contribution.weaving.jdt.IScalaSourceFile - import scala.tools.eclipse.util.EclipseFile object ScalaSourceFile { @@ -38,7 +36,8 @@ } class ScalaSourceFile(fragment : PackageFragment, elementName: String, workingCopyOwner : WorkingCopyOwner) - extends JDTCompilationUnit(fragment, elementName, workingCopyOwner) with ScalaCompilationUnit with IScalaSourceFile { + extends JDTCompilationUnit(fragment, elementName, workingCopyOwner) with ScalaCompilationUnit + with scala.tools.eclipse.contribution.weaving.jdt.IScalaSourceFile { override def getMainTypeName : Array[Char] = getElementName.substring(0, getElementName.length - ".scala".length).toCharArray() -- Git Team Provider UI (Incubation) 0.8.4