This commit is contained in:
Alexey Kudravtsev
2016-08-04 15:21:39 +03:00
parent a448b89b68
commit 8bbe5d55d7
3 changed files with 6 additions and 11 deletions
@@ -23,7 +23,6 @@ import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.editor.markup.GutterIconRenderer;
import com.intellij.testFramework.TestActionEvent;
import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase;
import com.intellij.util.Function;
import com.intellij.util.containers.ContainerUtil;
import java.util.List;
@@ -32,9 +31,7 @@ import java.util.Set;
/**
* @author Dmitry Avdeev
*/
@SuppressWarnings("ConstantConditions")
public class RunLineMarkerTest extends LightCodeInsightFixtureTestCase {
public void testRunLineMarker() throws Exception {
myFixture.configureByText("MainTest.java", "public class MainTest {\n" +
" public static void <caret>foo(String[] args) {\n" +
@@ -43,7 +40,8 @@ public class RunLineMarkerTest extends LightCodeInsightFixtureTestCase {
" }\n" +
"}");
assertEquals(0, myFixture.findGuttersAtCaret().size());
assertEquals(2, myFixture.findAllGutters().size());
List<GutterMark> gutters = myFixture.findAllGutters();
assertEquals(2, gutters.size());
}
public void testTestClassWithMain() throws Exception {
@@ -77,7 +75,7 @@ public class RunLineMarkerTest extends LightCodeInsightFixtureTestCase {
GutterIconsConfigurable configurable = new GutterIconsConfigurable();
configurable.createComponent();
List<GutterIconDescriptor> descriptors = configurable.getDescriptors();
Set<String> strings = ContainerUtil.map2Set(descriptors, descriptor -> descriptor.getId());
Set<String> strings = ContainerUtil.map2Set(descriptors, GutterIconDescriptor::getId);
assertEquals(descriptors.size(), strings.size());
}
}
@@ -24,12 +24,9 @@ import com.intellij.openapi.editor.Editor;
* @author max
* @see RangeHighlighter#setEditorFilter(MarkupEditorFilter)
*/
@FunctionalInterface
public interface MarkupEditorFilter {
MarkupEditorFilter EMPTY = new MarkupEditorFilter() {
public boolean avaliableIn(Editor editor) {
return true;
}
};
MarkupEditorFilter EMPTY = editor -> true;
/**
* Checks if the highlighter is active in the specified editor.
@@ -64,7 +64,7 @@ public class CharArrayCharSequence implements CharSequenceBackedByArray, CharSeq
public char[] getChars() {
if (myStart == 0) return myChars;
char[] chars = new char[length()];
System.arraycopy(myChars, myStart, chars, 0, length());
getChars(chars, 0);
return chars;
}