Skip to content

Commit

Permalink
Split the SemanticHighlightReconciler class into smaller classes which
Browse files Browse the repository at this point in the history
can be unit tested.
  • Loading branch information
rubenporras committed Dec 13, 2022
1 parent eba8534 commit 0f3a050
Show file tree
Hide file tree
Showing 6 changed files with 545 additions and 251 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2022 Avaloq Evolution AG.
* Copyright (c) 2022 Avaloq Group AG.
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
Expand All @@ -12,25 +12,27 @@
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.reconciler.MonoReconciler;


public class SemanticHighlightReconciler extends MonoReconciler {

public SemanticHighlightReconciler() {
super(new SemanticHighlightReconcilerStrategy(), false);
}
public SemanticHighlightReconciler() {
super(new SemanticHighlightReconcilerStrategy(), false);
}

@Override
public void install(final ITextViewer textViewer) {
super.install(textViewer);
// no need to do that if https://bugs.eclipse.org/bugs/show_bug.cgi?id=521326 is accepted
((SemanticHighlightReconcilerStrategy) getReconcilingStrategy(IDocument.DEFAULT_CONTENT_TYPE)).install(textViewer);
}
@Override
public void install(final ITextViewer textViewer) {
super.install(textViewer);
// no need to do that if https://bugs.eclipse.org/bugs/show_bug.cgi?id=521326 is
// accepted
((SemanticHighlightReconcilerStrategy) getReconcilingStrategy(IDocument.DEFAULT_CONTENT_TYPE))
.install(textViewer);
}

@Override
public void uninstall() {
super.uninstall();
// no need to do that if https://bugs.eclipse.org/bugs/show_bug.cgi?id=521326 is accepted
((SemanticHighlightReconcilerStrategy) getReconcilingStrategy(IDocument.DEFAULT_CONTENT_TYPE)).uninstall();
}
@Override
public void uninstall() {
super.uninstall();
// no need to do that if https://bugs.eclipse.org/bugs/show_bug.cgi?id=521326 is
// accepted
((SemanticHighlightReconcilerStrategy) getReconcilingStrategy(IDocument.DEFAULT_CONTENT_TYPE)).uninstall();
}

}
Loading

0 comments on commit 0f3a050

Please sign in to comment.