Skip to content

Commit

Permalink
Reimplement ScalaCodeScanner with Scalariform lexer
Browse files Browse the repository at this point in the history
  • Loading branch information
mdr committed Mar 12, 2011
1 parent 015e895 commit ab0008b
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 413 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ import scala.tools.eclipse.formatter.ScalaFormattingStrategy
class ScalaSourceViewerConfiguration(store : IPreferenceStore, editor : ITextEditor)
extends JavaSourceViewerConfiguration(JavaPlugin.getDefault.getJavaTextTools.getColorManager, store, editor, IJavaPartitions.JAVA_PARTITIONING) {

private val codeScanner = new ScalaCodeScanner(getColorManager, store);
private val codeScanner = new ScalaCodeScanner(getColorManager, store)

override def getPresentationReconciler(sv : ISourceViewer) = {
val reconciler = super.getPresentationReconciler(sv).asInstanceOf[PresentationReconciler]

def handlePartition(partitionType: String, tokenScanner: ITokenScanner) {
val dr = new DefaultDamagerRepairer(tokenScanner)
reconciler.setDamager(dr, partitionType)
reconciler.setRepairer(dr, partitionType)
reconciler.setRepairer(dr, partitionType)
}

handlePartition(IDocument.DEFAULT_CONTENT_TYPE, codeScanner)
Expand Down
Loading

0 comments on commit ab0008b

Please sign in to comment.