mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
test fix
This commit is contained in:
@@ -247,6 +247,18 @@ public class HighlightInfo {
|
||||
Comparing.strEqual(info.description, description);
|
||||
}
|
||||
|
||||
public boolean equalsByActualOffset(HighlightInfo info) {
|
||||
if (info == this) return true;
|
||||
|
||||
return info.getSeverity() == getSeverity() &&
|
||||
info.getActualStartOffset() == getActualStartOffset() &&
|
||||
info.getActualEndOffset() == getActualEndOffset() &&
|
||||
Comparing.equal(info.type, type) &&
|
||||
Comparing.equal(info.gutterIconRenderer, gutterIconRenderer) &&
|
||||
Comparing.equal(info.forcedTextAttributes, forcedTextAttributes) &&
|
||||
Comparing.strEqual(info.description, description);
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return startOffset;
|
||||
}
|
||||
|
||||
+4
-6
@@ -250,14 +250,12 @@ public class UpdateHighlightersUtil {
|
||||
highlighter.setAfterEndOfLine(info.isAfterEndOfLine);
|
||||
|
||||
Color color = info.getErrorStripeMarkColor(psiFile);
|
||||
if (!Comparing.equal(color, highlighter.getErrorStripeMarkColor())) {
|
||||
highlighter.setErrorStripeMarkColor(color);
|
||||
highlighter.setErrorStripeMarkColor(color);
|
||||
if (!(highlighter.getErrorStripeTooltip() instanceof HighlightInfo) || !info.equalsByActualOffset((HighlightInfo)highlighter.getErrorStripeTooltip())) {
|
||||
highlighter.setErrorStripeTooltip(info);
|
||||
}
|
||||
highlighter.setErrorStripeTooltip(info);
|
||||
GutterIconRenderer renderer = info.getGutterIconRenderer();
|
||||
if (!Comparing.equal(renderer, highlighter.getGutterIconRenderer())) {
|
||||
highlighter.setGutterIconRenderer(renderer);
|
||||
}
|
||||
highlighter.setGutterIconRenderer(renderer);
|
||||
|
||||
ranges2markersCache.put(new TextRange(infoStartOffset, infoEndOffset), info.highlighter);
|
||||
if (info.quickFixActionRanges != null) {
|
||||
|
||||
+36
-10
@@ -20,8 +20,10 @@ import com.intellij.openapi.editor.ex.DocumentEx;
|
||||
import com.intellij.openapi.editor.ex.RangeHighlighterEx;
|
||||
import com.intellij.openapi.editor.ex.RangeMarkerEx;
|
||||
import com.intellij.openapi.editor.markup.*;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
@@ -68,9 +70,12 @@ public class RangeHighlighterImpl implements RangeHighlighterEx {
|
||||
return myTextAttributes;
|
||||
}
|
||||
|
||||
public void setTextAttributes(final TextAttributes textAttributes) {
|
||||
public void setTextAttributes(TextAttributes textAttributes) {
|
||||
TextAttributes old = myTextAttributes;
|
||||
myTextAttributes = textAttributes;
|
||||
fireChanged();
|
||||
if (!Comparing.equal(old, textAttributes)) {
|
||||
fireChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public int getLayer() {
|
||||
@@ -110,8 +115,11 @@ public class RangeHighlighterImpl implements RangeHighlighterEx {
|
||||
}
|
||||
|
||||
public void setGutterIconRenderer(GutterIconRenderer renderer) {
|
||||
GutterIconRenderer old = myGutterIconRenderer;
|
||||
myGutterIconRenderer = renderer;
|
||||
fireChanged();
|
||||
if (!Comparing.equal(old, renderer)) {
|
||||
fireChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public Color getErrorStripeMarkColor() {
|
||||
@@ -119,8 +127,11 @@ public class RangeHighlighterImpl implements RangeHighlighterEx {
|
||||
}
|
||||
|
||||
public void setErrorStripeMarkColor(Color color) {
|
||||
Color old = myErrorStripeColor;
|
||||
myErrorStripeColor = color;
|
||||
fireChanged();
|
||||
if (!Comparing.equal(old, color)) {
|
||||
fireChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public Object getErrorStripeTooltip() {
|
||||
@@ -128,8 +139,11 @@ public class RangeHighlighterImpl implements RangeHighlighterEx {
|
||||
}
|
||||
|
||||
public void setErrorStripeTooltip(Object tooltipObject) {
|
||||
Object old = myErrorStripeTooltip;
|
||||
myErrorStripeTooltip = tooltipObject;
|
||||
fireChanged();
|
||||
if (!Comparing.equal(old, tooltipObject)) {
|
||||
fireChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isThinErrorStripeMark() {
|
||||
@@ -137,8 +151,11 @@ public class RangeHighlighterImpl implements RangeHighlighterEx {
|
||||
}
|
||||
|
||||
public void setThinErrorStripeMark(boolean value) {
|
||||
boolean old = myErrorStripeMarkIsThin;
|
||||
myErrorStripeMarkIsThin = value;
|
||||
fireChanged();
|
||||
if (old != value) {
|
||||
fireChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public Color getLineSeparatorColor() {
|
||||
@@ -146,17 +163,23 @@ public class RangeHighlighterImpl implements RangeHighlighterEx {
|
||||
}
|
||||
|
||||
public void setLineSeparatorColor(Color color) {
|
||||
Color old = myLineSeparatorColor;
|
||||
myLineSeparatorColor = color;
|
||||
fireChanged();
|
||||
if (!Comparing.equal(old, color)) {
|
||||
fireChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public SeparatorPlacement getLineSeparatorPlacement() {
|
||||
return mySeparatorPlacement;
|
||||
}
|
||||
|
||||
public void setLineSeparatorPlacement(SeparatorPlacement placement) {
|
||||
public void setLineSeparatorPlacement(@Nullable SeparatorPlacement placement) {
|
||||
SeparatorPlacement old = mySeparatorPlacement;
|
||||
mySeparatorPlacement = placement;
|
||||
fireChanged();
|
||||
if (!Comparing.equal(old, placement)) {
|
||||
fireChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public void setEditorFilter(@NotNull MarkupEditorFilter filter) {
|
||||
@@ -174,8 +197,11 @@ public class RangeHighlighterImpl implements RangeHighlighterEx {
|
||||
}
|
||||
|
||||
public void setAfterEndOfLine(boolean afterEndOfLine) {
|
||||
boolean old = isAfterEndOfLine;
|
||||
isAfterEndOfLine = afterEndOfLine;
|
||||
fireChanged();
|
||||
if (old != afterEndOfLine) {
|
||||
fireChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private void fireChanged() {
|
||||
|
||||
Reference in New Issue
Block a user