diff --git a/platform/lang-impl/testData/editor/braceHighlighter/afterLBrace.java b/platform/lang-impl/testData/editor/braceHighlighter/afterLBrace.java index 9d6d7d1362f2..f0c299c64593 100644 --- a/platform/lang-impl/testData/editor/braceHighlighter/afterLBrace.java +++ b/platform/lang-impl/testData/editor/braceHighlighter/afterLBrace.java @@ -1,3 +1,3 @@ -class Foo { +class Foo { int field; -} \ No newline at end of file +} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighter/afterLBrace.java.txt b/platform/lang-impl/testData/editor/braceHighlighter/afterLBrace.java.txt new file mode 100644 index 000000000000..eade3065c2a6 --- /dev/null +++ b/platform/lang-impl/testData/editor/braceHighlighter/afterLBrace.java.txt @@ -0,0 +1,3 @@ +class Foo { + int field; +} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighter/afterLBraceWithText.java b/platform/lang-impl/testData/editor/braceHighlighter/afterLBraceWithText.java index 0e48102325d3..1c98ad73dabf 100644 --- a/platform/lang-impl/testData/editor/braceHighlighter/afterLBraceWithText.java +++ b/platform/lang-impl/testData/editor/braceHighlighter/afterLBraceWithText.java @@ -1,2 +1,2 @@ -class Foo {int field; -} \ No newline at end of file +class Foo {int field; +} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighter/afterLBraceWithText.java.txt b/platform/lang-impl/testData/editor/braceHighlighter/afterLBraceWithText.java.txt new file mode 100644 index 000000000000..bc268438ce82 --- /dev/null +++ b/platform/lang-impl/testData/editor/braceHighlighter/afterLBraceWithText.java.txt @@ -0,0 +1,2 @@ +class Foo {int field; +} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighter/afterRBrace.java b/platform/lang-impl/testData/editor/braceHighlighter/afterRBrace.java index e7ae650c523f..4bb9a4d0a6c0 100644 --- a/platform/lang-impl/testData/editor/braceHighlighter/afterRBrace.java +++ b/platform/lang-impl/testData/editor/braceHighlighter/afterRBrace.java @@ -1,3 +1,3 @@ -class Foo { +class Foo { int field; -} \ No newline at end of file +} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighter/afterRBrace.java.txt b/platform/lang-impl/testData/editor/braceHighlighter/afterRBrace.java.txt new file mode 100644 index 000000000000..4d04c28ab0b1 --- /dev/null +++ b/platform/lang-impl/testData/editor/braceHighlighter/afterRBrace.java.txt @@ -0,0 +1,3 @@ +class Foo { + int field; +} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighter/beforeLBrace.java b/platform/lang-impl/testData/editor/braceHighlighter/beforeLBrace.java index f3b4a85d28a8..3d76252f320d 100644 --- a/platform/lang-impl/testData/editor/braceHighlighter/beforeLBrace.java +++ b/platform/lang-impl/testData/editor/braceHighlighter/beforeLBrace.java @@ -1,3 +1,3 @@ class Foo { int field; -} \ No newline at end of file +} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighter/beforeLBrace.java.txt b/platform/lang-impl/testData/editor/braceHighlighter/beforeLBrace.java.txt new file mode 100644 index 000000000000..5c69b61e537e --- /dev/null +++ b/platform/lang-impl/testData/editor/braceHighlighter/beforeLBrace.java.txt @@ -0,0 +1,3 @@ +class Foo { + int field; +} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighter/beforeRBrace.java b/platform/lang-impl/testData/editor/braceHighlighter/beforeRBrace.java index 9e5dd4731bac..60623492cba6 100644 --- a/platform/lang-impl/testData/editor/braceHighlighter/beforeRBrace.java +++ b/platform/lang-impl/testData/editor/braceHighlighter/beforeRBrace.java @@ -1,3 +1,3 @@ -class Foo { +class Foo { int field; } \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighter/beforeRBrace.java.txt b/platform/lang-impl/testData/editor/braceHighlighter/beforeRBrace.java.txt new file mode 100644 index 000000000000..2888f50a2871 --- /dev/null +++ b/platform/lang-impl/testData/editor/braceHighlighter/beforeRBrace.java.txt @@ -0,0 +1,3 @@ +class Foo { + int field; +} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighter/doubleAfterSecond.java b/platform/lang-impl/testData/editor/braceHighlighter/doubleAfterSecond.java index 58fc206522c4..946406554b83 100644 --- a/platform/lang-impl/testData/editor/braceHighlighter/doubleAfterSecond.java +++ b/platform/lang-impl/testData/editor/braceHighlighter/doubleAfterSecond.java @@ -1,5 +1,5 @@ class Foo { void foo() { - call({}); + call({}); } } \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighter/doubleAfterSecond.java.txt b/platform/lang-impl/testData/editor/braceHighlighter/doubleAfterSecond.java.txt new file mode 100644 index 000000000000..b5b242e5b587 --- /dev/null +++ b/platform/lang-impl/testData/editor/braceHighlighter/doubleAfterSecond.java.txt @@ -0,0 +1,5 @@ +class Foo { + void foo() { + call({}); + } +} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighter/doubleBeforeFirst.java b/platform/lang-impl/testData/editor/braceHighlighter/doubleBeforeFirst.java index ddb66abb8d3f..72ee587ed31d 100644 --- a/platform/lang-impl/testData/editor/braceHighlighter/doubleBeforeFirst.java +++ b/platform/lang-impl/testData/editor/braceHighlighter/doubleBeforeFirst.java @@ -1,5 +1,5 @@ class Foo { void foo() { - call({}); + call({}); } } \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighter/doubleBeforeFirst.java.txt b/platform/lang-impl/testData/editor/braceHighlighter/doubleBeforeFirst.java.txt new file mode 100644 index 000000000000..c94eb4e83a3b --- /dev/null +++ b/platform/lang-impl/testData/editor/braceHighlighter/doubleBeforeFirst.java.txt @@ -0,0 +1,5 @@ +class Foo { + void foo() { + call({}); + } +} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighter/doubleMiddle.java b/platform/lang-impl/testData/editor/braceHighlighter/doubleMiddle.java index c243586cf624..8b87b8b300d0 100644 --- a/platform/lang-impl/testData/editor/braceHighlighter/doubleMiddle.java +++ b/platform/lang-impl/testData/editor/braceHighlighter/doubleMiddle.java @@ -1,5 +1,5 @@ class Foo { void foo() { - call({}); + call({}); } } \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighter/doubleMiddle.java.txt b/platform/lang-impl/testData/editor/braceHighlighter/doubleMiddle.java.txt new file mode 100644 index 000000000000..f903cbbd1858 --- /dev/null +++ b/platform/lang-impl/testData/editor/braceHighlighter/doubleMiddle.java.txt @@ -0,0 +1,5 @@ +class Foo { + void foo() { + call({}); + } +} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighter/inTheMiddle.java.txt b/platform/lang-impl/testData/editor/braceHighlighter/inTheMiddle.java.txt new file mode 100644 index 000000000000..34099fd2a4d2 --- /dev/null +++ b/platform/lang-impl/testData/editor/braceHighlighter/inTheMiddle.java.txt @@ -0,0 +1,3 @@ +class Foo { + int field; +} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighter/inTheMiddleWhitespaces.java b/platform/lang-impl/testData/editor/braceHighlighter/inTheMiddleWhitespaces.java index 8c42893a9598..2ba661672675 100644 --- a/platform/lang-impl/testData/editor/braceHighlighter/inTheMiddleWhitespaces.java +++ b/platform/lang-impl/testData/editor/braceHighlighter/inTheMiddleWhitespaces.java @@ -1,2 +1,2 @@ -class Foo { -} \ No newline at end of file +class Foo { +} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighter/inTheMiddleWhitespaces.java.txt b/platform/lang-impl/testData/editor/braceHighlighter/inTheMiddleWhitespaces.java.txt new file mode 100644 index 000000000000..561d159269fe --- /dev/null +++ b/platform/lang-impl/testData/editor/braceHighlighter/inTheMiddleWhitespaces.java.txt @@ -0,0 +1,2 @@ +class Foo { +} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighter/nested1.json b/platform/lang-impl/testData/editor/braceHighlighter/nested1.json index 5b436685c6c3..023e9b17d792 100644 --- a/platform/lang-impl/testData/editor/braceHighlighter/nested1.json +++ b/platform/lang-impl/testData/editor/braceHighlighter/nested1.json @@ -1 +1 @@ -{{{{{{{{{}}}}}}}}} \ No newline at end of file +{{{{{{{{{}}}}}}}}} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighter/nested1.json.txt b/platform/lang-impl/testData/editor/braceHighlighter/nested1.json.txt new file mode 100644 index 000000000000..ffb096139490 --- /dev/null +++ b/platform/lang-impl/testData/editor/braceHighlighter/nested1.json.txt @@ -0,0 +1 @@ +{{{{{{{{{}}}}}}}}} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighter/nested1reverse.json b/platform/lang-impl/testData/editor/braceHighlighter/nested1reverse.json index 39bc5dc7d1b4..64b71fb6e0a8 100644 --- a/platform/lang-impl/testData/editor/braceHighlighter/nested1reverse.json +++ b/platform/lang-impl/testData/editor/braceHighlighter/nested1reverse.json @@ -1 +1 @@ -{{{{{{{{{}}}}}}}}} \ No newline at end of file +{{{{{{{{{}}}}}}}}} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighter/nested1reverse.json.txt b/platform/lang-impl/testData/editor/braceHighlighter/nested1reverse.json.txt new file mode 100644 index 000000000000..e253ddcafc31 --- /dev/null +++ b/platform/lang-impl/testData/editor/braceHighlighter/nested1reverse.json.txt @@ -0,0 +1 @@ +{{{{{{{{{}}}}}}}}} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighter/nested2.json b/platform/lang-impl/testData/editor/braceHighlighter/nested2.json index c52580d27845..4e460c1374cb 100644 --- a/platform/lang-impl/testData/editor/braceHighlighter/nested2.json +++ b/platform/lang-impl/testData/editor/braceHighlighter/nested2.json @@ -1 +1 @@ -{{{{{{{{{}}}}}}}}} \ No newline at end of file +{{{{{{{{{}}}}}}}}} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighter/nested2.json.txt b/platform/lang-impl/testData/editor/braceHighlighter/nested2.json.txt new file mode 100644 index 000000000000..dc4440dbcdd4 --- /dev/null +++ b/platform/lang-impl/testData/editor/braceHighlighter/nested2.json.txt @@ -0,0 +1 @@ +{{{{{{{{{}}}}}}}}} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighter/nested2reverse.json b/platform/lang-impl/testData/editor/braceHighlighter/nested2reverse.json index ea3eea694c68..802d755011ac 100644 --- a/platform/lang-impl/testData/editor/braceHighlighter/nested2reverse.json +++ b/platform/lang-impl/testData/editor/braceHighlighter/nested2reverse.json @@ -1 +1 @@ -{{{{{{{{{}}}}}}}}} \ No newline at end of file +{{{{{{{{{}}}}}}}}} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighter/nested2reverse.json.txt b/platform/lang-impl/testData/editor/braceHighlighter/nested2reverse.json.txt new file mode 100644 index 000000000000..5e217bc5099c --- /dev/null +++ b/platform/lang-impl/testData/editor/braceHighlighter/nested2reverse.json.txt @@ -0,0 +1 @@ +{{{{{{{{{}}}}}}}}} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighter/nested3.json b/platform/lang-impl/testData/editor/braceHighlighter/nested3.json index 1d5d14891112..8222a08f35ec 100644 --- a/platform/lang-impl/testData/editor/braceHighlighter/nested3.json +++ b/platform/lang-impl/testData/editor/braceHighlighter/nested3.json @@ -1 +1 @@ -{{{{{{{{{}}}}}}}}} \ No newline at end of file +{{{{{{{{{}}}}}}}}} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighter/nested3.json.txt b/platform/lang-impl/testData/editor/braceHighlighter/nested3.json.txt new file mode 100644 index 000000000000..4f8390b4ada8 --- /dev/null +++ b/platform/lang-impl/testData/editor/braceHighlighter/nested3.json.txt @@ -0,0 +1 @@ +{{{{{{{{{}}}}}}}}} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighter/nested3reverse.json b/platform/lang-impl/testData/editor/braceHighlighter/nested3reverse.json index 926a42ed16a3..fbf07cfae9ea 100644 --- a/platform/lang-impl/testData/editor/braceHighlighter/nested3reverse.json +++ b/platform/lang-impl/testData/editor/braceHighlighter/nested3reverse.json @@ -1 +1 @@ -{{{{{{{{{}}}}}}}}} \ No newline at end of file +{{{{{{{{{}}}}}}}}} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighter/nested3reverse.json.txt b/platform/lang-impl/testData/editor/braceHighlighter/nested3reverse.json.txt new file mode 100644 index 000000000000..c8360146f8bd --- /dev/null +++ b/platform/lang-impl/testData/editor/braceHighlighter/nested3reverse.json.txt @@ -0,0 +1 @@ +{{{{{{{{{}}}}}}}}} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighterBlock/afterLBrace.java b/platform/lang-impl/testData/editor/braceHighlighterBlock/afterLBrace.java index 9d6d7d1362f2..f0c299c64593 100644 --- a/platform/lang-impl/testData/editor/braceHighlighterBlock/afterLBrace.java +++ b/platform/lang-impl/testData/editor/braceHighlighterBlock/afterLBrace.java @@ -1,3 +1,3 @@ -class Foo { +class Foo { int field; -} \ No newline at end of file +} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighterBlock/afterLBrace.java.txt b/platform/lang-impl/testData/editor/braceHighlighterBlock/afterLBrace.java.txt new file mode 100644 index 000000000000..eade3065c2a6 --- /dev/null +++ b/platform/lang-impl/testData/editor/braceHighlighterBlock/afterLBrace.java.txt @@ -0,0 +1,3 @@ +class Foo { + int field; +} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighterBlock/afterLBraceWithText.java b/platform/lang-impl/testData/editor/braceHighlighterBlock/afterLBraceWithText.java index 0e48102325d3..1c98ad73dabf 100644 --- a/platform/lang-impl/testData/editor/braceHighlighterBlock/afterLBraceWithText.java +++ b/platform/lang-impl/testData/editor/braceHighlighterBlock/afterLBraceWithText.java @@ -1,2 +1,2 @@ -class Foo {int field; -} \ No newline at end of file +class Foo {int field; +} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighterBlock/afterLBraceWithText.java.txt b/platform/lang-impl/testData/editor/braceHighlighterBlock/afterLBraceWithText.java.txt new file mode 100644 index 000000000000..bc268438ce82 --- /dev/null +++ b/platform/lang-impl/testData/editor/braceHighlighterBlock/afterLBraceWithText.java.txt @@ -0,0 +1,2 @@ +class Foo {int field; +} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighterBlock/afterRBrace.java b/platform/lang-impl/testData/editor/braceHighlighterBlock/afterRBrace.java index e7ae650c523f..4bb9a4d0a6c0 100644 --- a/platform/lang-impl/testData/editor/braceHighlighterBlock/afterRBrace.java +++ b/platform/lang-impl/testData/editor/braceHighlighterBlock/afterRBrace.java @@ -1,3 +1,3 @@ -class Foo { +class Foo { int field; -} \ No newline at end of file +} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighterBlock/afterRBrace.java.txt b/platform/lang-impl/testData/editor/braceHighlighterBlock/afterRBrace.java.txt new file mode 100644 index 000000000000..4d04c28ab0b1 --- /dev/null +++ b/platform/lang-impl/testData/editor/braceHighlighterBlock/afterRBrace.java.txt @@ -0,0 +1,3 @@ +class Foo { + int field; +} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighterBlock/beforeLBrace.java b/platform/lang-impl/testData/editor/braceHighlighterBlock/beforeLBrace.java index f3b4a85d28a8..3d76252f320d 100644 --- a/platform/lang-impl/testData/editor/braceHighlighterBlock/beforeLBrace.java +++ b/platform/lang-impl/testData/editor/braceHighlighterBlock/beforeLBrace.java @@ -1,3 +1,3 @@ class Foo { int field; -} \ No newline at end of file +} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighterBlock/beforeLBrace.java.txt b/platform/lang-impl/testData/editor/braceHighlighterBlock/beforeLBrace.java.txt new file mode 100644 index 000000000000..5c69b61e537e --- /dev/null +++ b/platform/lang-impl/testData/editor/braceHighlighterBlock/beforeLBrace.java.txt @@ -0,0 +1,3 @@ +class Foo { + int field; +} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighterBlock/beforeRBrace.java b/platform/lang-impl/testData/editor/braceHighlighterBlock/beforeRBrace.java index 9e5dd4731bac..60623492cba6 100644 --- a/platform/lang-impl/testData/editor/braceHighlighterBlock/beforeRBrace.java +++ b/platform/lang-impl/testData/editor/braceHighlighterBlock/beforeRBrace.java @@ -1,3 +1,3 @@ -class Foo { +class Foo { int field; } \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighterBlock/beforeRBrace.java.txt b/platform/lang-impl/testData/editor/braceHighlighterBlock/beforeRBrace.java.txt new file mode 100644 index 000000000000..2888f50a2871 --- /dev/null +++ b/platform/lang-impl/testData/editor/braceHighlighterBlock/beforeRBrace.java.txt @@ -0,0 +1,3 @@ +class Foo { + int field; +} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighterBlock/doubleAfterSecond.java b/platform/lang-impl/testData/editor/braceHighlighterBlock/doubleAfterSecond.java index 58fc206522c4..946406554b83 100644 --- a/platform/lang-impl/testData/editor/braceHighlighterBlock/doubleAfterSecond.java +++ b/platform/lang-impl/testData/editor/braceHighlighterBlock/doubleAfterSecond.java @@ -1,5 +1,5 @@ class Foo { void foo() { - call({}); + call({}); } } \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighterBlock/doubleAfterSecond.java.txt b/platform/lang-impl/testData/editor/braceHighlighterBlock/doubleAfterSecond.java.txt new file mode 100644 index 000000000000..b5b242e5b587 --- /dev/null +++ b/platform/lang-impl/testData/editor/braceHighlighterBlock/doubleAfterSecond.java.txt @@ -0,0 +1,5 @@ +class Foo { + void foo() { + call({}); + } +} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighterBlock/doubleBeforeFirst.java b/platform/lang-impl/testData/editor/braceHighlighterBlock/doubleBeforeFirst.java index ddb66abb8d3f..72ee587ed31d 100644 --- a/platform/lang-impl/testData/editor/braceHighlighterBlock/doubleBeforeFirst.java +++ b/platform/lang-impl/testData/editor/braceHighlighterBlock/doubleBeforeFirst.java @@ -1,5 +1,5 @@ class Foo { void foo() { - call({}); + call({}); } } \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighterBlock/doubleBeforeFirst.java.txt b/platform/lang-impl/testData/editor/braceHighlighterBlock/doubleBeforeFirst.java.txt new file mode 100644 index 000000000000..c94eb4e83a3b --- /dev/null +++ b/platform/lang-impl/testData/editor/braceHighlighterBlock/doubleBeforeFirst.java.txt @@ -0,0 +1,5 @@ +class Foo { + void foo() { + call({}); + } +} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighterBlock/doubleMiddle.java b/platform/lang-impl/testData/editor/braceHighlighterBlock/doubleMiddle.java index c243586cf624..8b87b8b300d0 100644 --- a/platform/lang-impl/testData/editor/braceHighlighterBlock/doubleMiddle.java +++ b/platform/lang-impl/testData/editor/braceHighlighterBlock/doubleMiddle.java @@ -1,5 +1,5 @@ class Foo { void foo() { - call({}); + call({}); } } \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighterBlock/doubleMiddle.java.txt b/platform/lang-impl/testData/editor/braceHighlighterBlock/doubleMiddle.java.txt new file mode 100644 index 000000000000..f903cbbd1858 --- /dev/null +++ b/platform/lang-impl/testData/editor/braceHighlighterBlock/doubleMiddle.java.txt @@ -0,0 +1,5 @@ +class Foo { + void foo() { + call({}); + } +} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighterBlock/inTheMiddle.java.txt b/platform/lang-impl/testData/editor/braceHighlighterBlock/inTheMiddle.java.txt new file mode 100644 index 000000000000..34099fd2a4d2 --- /dev/null +++ b/platform/lang-impl/testData/editor/braceHighlighterBlock/inTheMiddle.java.txt @@ -0,0 +1,3 @@ +class Foo { + int field; +} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighterBlock/inTheMiddleWhitespaces.java b/platform/lang-impl/testData/editor/braceHighlighterBlock/inTheMiddleWhitespaces.java index 8c42893a9598..2ba661672675 100644 --- a/platform/lang-impl/testData/editor/braceHighlighterBlock/inTheMiddleWhitespaces.java +++ b/platform/lang-impl/testData/editor/braceHighlighterBlock/inTheMiddleWhitespaces.java @@ -1,2 +1,2 @@ -class Foo { -} \ No newline at end of file +class Foo { +} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighterBlock/inTheMiddleWhitespaces.java.txt b/platform/lang-impl/testData/editor/braceHighlighterBlock/inTheMiddleWhitespaces.java.txt new file mode 100644 index 000000000000..561d159269fe --- /dev/null +++ b/platform/lang-impl/testData/editor/braceHighlighterBlock/inTheMiddleWhitespaces.java.txt @@ -0,0 +1,2 @@ +class Foo { +} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighterBlock/nested1.json b/platform/lang-impl/testData/editor/braceHighlighterBlock/nested1.json index 5b436685c6c3..023e9b17d792 100644 --- a/platform/lang-impl/testData/editor/braceHighlighterBlock/nested1.json +++ b/platform/lang-impl/testData/editor/braceHighlighterBlock/nested1.json @@ -1 +1 @@ -{{{{{{{{{}}}}}}}}} \ No newline at end of file +{{{{{{{{{}}}}}}}}} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighterBlock/nested1.json.txt b/platform/lang-impl/testData/editor/braceHighlighterBlock/nested1.json.txt new file mode 100644 index 000000000000..ffb096139490 --- /dev/null +++ b/platform/lang-impl/testData/editor/braceHighlighterBlock/nested1.json.txt @@ -0,0 +1 @@ +{{{{{{{{{}}}}}}}}} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighterBlock/nested1reverse.json b/platform/lang-impl/testData/editor/braceHighlighterBlock/nested1reverse.json index 39bc5dc7d1b4..64b71fb6e0a8 100644 --- a/platform/lang-impl/testData/editor/braceHighlighterBlock/nested1reverse.json +++ b/platform/lang-impl/testData/editor/braceHighlighterBlock/nested1reverse.json @@ -1 +1 @@ -{{{{{{{{{}}}}}}}}} \ No newline at end of file +{{{{{{{{{}}}}}}}}} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighterBlock/nested1reverse.json.txt b/platform/lang-impl/testData/editor/braceHighlighterBlock/nested1reverse.json.txt new file mode 100644 index 000000000000..e253ddcafc31 --- /dev/null +++ b/platform/lang-impl/testData/editor/braceHighlighterBlock/nested1reverse.json.txt @@ -0,0 +1 @@ +{{{{{{{{{}}}}}}}}} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighterBlock/nested2.json b/platform/lang-impl/testData/editor/braceHighlighterBlock/nested2.json index d340043357c4..4e460c1374cb 100644 --- a/platform/lang-impl/testData/editor/braceHighlighterBlock/nested2.json +++ b/platform/lang-impl/testData/editor/braceHighlighterBlock/nested2.json @@ -1 +1 @@ -{{{{{{{{{}}}}}}}}} \ No newline at end of file +{{{{{{{{{}}}}}}}}} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighterBlock/nested2.json.txt b/platform/lang-impl/testData/editor/braceHighlighterBlock/nested2.json.txt new file mode 100644 index 000000000000..e77ad8d0c815 --- /dev/null +++ b/platform/lang-impl/testData/editor/braceHighlighterBlock/nested2.json.txt @@ -0,0 +1 @@ +{{{{{{{{{}}}}}}}}} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighterBlock/nested2reverse.json b/platform/lang-impl/testData/editor/braceHighlighterBlock/nested2reverse.json index 1ecc206910c9..2e2d4f21e64d 100644 --- a/platform/lang-impl/testData/editor/braceHighlighterBlock/nested2reverse.json +++ b/platform/lang-impl/testData/editor/braceHighlighterBlock/nested2reverse.json @@ -5,5 +5,5 @@ } } } -} +} } \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighterBlock/nested2reverse.json.txt b/platform/lang-impl/testData/editor/braceHighlighterBlock/nested2reverse.json.txt new file mode 100644 index 000000000000..9ba5d4db5611 --- /dev/null +++ b/platform/lang-impl/testData/editor/braceHighlighterBlock/nested2reverse.json.txt @@ -0,0 +1,9 @@ +{ + {{{{{{{{}} +} +} +} +} +} +} +} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighterBlock/nested3.json b/platform/lang-impl/testData/editor/braceHighlighterBlock/nested3.json index 46be459df050..29b48bc2c4ca 100644 --- a/platform/lang-impl/testData/editor/braceHighlighterBlock/nested3.json +++ b/platform/lang-impl/testData/editor/braceHighlighterBlock/nested3.json @@ -1,6 +1,6 @@ {{{{{{{{ { -}} +}} } } } diff --git a/platform/lang-impl/testData/editor/braceHighlighterBlock/nested3.json.txt b/platform/lang-impl/testData/editor/braceHighlighterBlock/nested3.json.txt new file mode 100644 index 000000000000..4b6ae43f540d --- /dev/null +++ b/platform/lang-impl/testData/editor/braceHighlighterBlock/nested3.json.txt @@ -0,0 +1,10 @@ +{{{{{{{{ + { +}} +} +} +} +} +} +} +} \ No newline at end of file diff --git a/platform/lang-impl/testData/editor/braceHighlighterBlock/nested3reverse.json b/platform/lang-impl/testData/editor/braceHighlighterBlock/nested3reverse.json index 04574a0f1f48..1f6ec9248fcc 100644 --- a/platform/lang-impl/testData/editor/braceHighlighterBlock/nested3reverse.json +++ b/platform/lang-impl/testData/editor/braceHighlighterBlock/nested3reverse.json @@ -1,5 +1,5 @@ {{{{{{{{ - { + { }} } } diff --git a/platform/lang-impl/testData/editor/braceHighlighterBlock/nested3reverse.json.txt b/platform/lang-impl/testData/editor/braceHighlighterBlock/nested3reverse.json.txt new file mode 100644 index 000000000000..f0cfb0d3207d --- /dev/null +++ b/platform/lang-impl/testData/editor/braceHighlighterBlock/nested3reverse.json.txt @@ -0,0 +1,10 @@ +{{{{{{{{ + { +}} +} +} +} +} +} +} +} \ No newline at end of file diff --git a/platform/lang-impl/testSources/com/intellij/codeInsight/highlighting/BraceHighlightingHandlerBlockCaretTest.java b/platform/lang-impl/testSources/com/intellij/codeInsight/highlighting/BraceHighlightingHandlerBlockCaretTest.java index 7d9614ea50af..b07928e45d31 100644 --- a/platform/lang-impl/testSources/com/intellij/codeInsight/highlighting/BraceHighlightingHandlerBlockCaretTest.java +++ b/platform/lang-impl/testSources/com/intellij/codeInsight/highlighting/BraceHighlightingHandlerBlockCaretTest.java @@ -1,10 +1,13 @@ -// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.codeInsight.highlighting; import com.intellij.openapi.editor.Editor; +import com.intellij.openapi.util.text.StringUtil; import com.intellij.testFramework.FileBasedTestCaseHelper; import com.intellij.testFramework.LightPlatformCodeInsightTestCase; import com.intellij.testFramework.TestDataPath; +import com.intellij.testFramework.UsefulTestCase; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.junit.Test; import org.junit.runner.RunWith; @@ -20,13 +23,19 @@ public class BraceHighlightingHandlerBlockCaretTest extends LightPlatformCodeIns configureByFile(myFileSuffix); Editor editor = getEditor(); editor.getSettings().setBlockCursor(true); - BraceHighlightingHandlerTest.doTest(getProject(), getFile(), editor); + String result = BraceHighlightingHandlerTest.getTextEditorWithHighlightedBraces(getEditor(), getFile()); + UsefulTestCase.assertSameLinesWithFile(getAnswerFilePath(), result); }); } @Nullable @Override public String getFileSuffix(String fileName) { - return fileName; + return StringUtil.endsWith(fileName, ".txt") ? null : fileName; + } + + @Override + public @Nullable String getBaseName(@NotNull String fileAfterSuffix) { + return StringUtil.endsWith(fileAfterSuffix, ".txt") ? fileAfterSuffix.substring(0, fileAfterSuffix.length() - 4) : null; } } \ No newline at end of file diff --git a/platform/lang-impl/testSources/com/intellij/codeInsight/highlighting/BraceHighlightingHandlerTest.java b/platform/lang-impl/testSources/com/intellij/codeInsight/highlighting/BraceHighlightingHandlerTest.java index 041d9ca04d02..e3e5e8b09b76 100644 --- a/platform/lang-impl/testSources/com/intellij/codeInsight/highlighting/BraceHighlightingHandlerTest.java +++ b/platform/lang-impl/testSources/com/intellij/codeInsight/highlighting/BraceHighlightingHandlerTest.java @@ -1,24 +1,28 @@ -// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.codeInsight.highlighting; import com.intellij.injected.editor.EditorWindow; -import com.intellij.openapi.command.WriteCommandAction; -import com.intellij.openapi.editor.Document; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.editor.ex.EditorEx; import com.intellij.openapi.editor.markup.RangeHighlighter; -import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Disposer; +import com.intellij.openapi.util.Pair; +import com.intellij.openapi.util.text.StringUtil; import com.intellij.psi.PsiFile; import com.intellij.testFramework.FileBasedTestCaseHelper; import com.intellij.testFramework.LightPlatformCodeInsightTestCase; import com.intellij.testFramework.TestDataPath; +import com.intellij.testFramework.UsefulTestCase; import com.intellij.util.Alarm; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.junit.Test; import org.junit.runner.RunWith; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; + import static com.intellij.testFramework.EdtTestUtil.runInEdtAndWait; @RunWith(com.intellij.testFramework.Parameterized.class) @@ -30,47 +34,49 @@ public class BraceHighlightingHandlerTest extends LightPlatformCodeInsightTestCa public void testAction() { runInEdtAndWait(() -> { configureByFile(myFileSuffix); - doTest(getProject(), getFile(), getEditor()); + String result = getTextEditorWithHighlightedBraces(getEditor(), getFile()); + UsefulTestCase.assertSameLinesWithFile(getAnswerFilePath(), result); }); } - public static void doTest(@NotNull Project project, @NotNull PsiFile psiFile, @NotNull Editor editor) { - Editor hostEditor = editor instanceof EditorWindow ? ((EditorWindow)editor).getDelegate() : editor; - final Document document = hostEditor.getDocument(); - int first = document.getText().indexOf(PAIR_MARKER); - if (first >= 0) { - WriteCommandAction.runWriteCommandAction(null, () -> document.replaceString(first, first + PAIR_MARKER.length(), "")); - } - int second; - int secondCandidate = document.getText().indexOf(PAIR_MARKER); - if (secondCandidate >= 0) { - WriteCommandAction.runWriteCommandAction(null, () -> document.replaceString(secondCandidate, secondCandidate + PAIR_MARKER.length(), "")); - second = secondCandidate; - } else { - second = hostEditor.getCaretModel().getOffset(); - } - - Alarm alarm = new Alarm(); - try { - new BraceHighlightingHandler(project, (EditorEx)editor, alarm, psiFile).updateBraces(); - RangeHighlighter[] highlighters = editor.getMarkupModel().getAllHighlighters(); - int braceHighlighters = 0; - for (RangeHighlighter highlighter : highlighters) { - if (highlighter.getLayer() == BraceHighlightingHandler.LAYER) { - braceHighlighters++; - assertTrue("Expected offsets: " + first + " or " + second + ", got: " + highlighter.getStartOffset(), - first == highlighter.getStartOffset() || second == highlighter.getStartOffset()); - } - } - assertEquals(first >= 0 ? 2 : 0, braceHighlighters); - } finally { - Disposer.dispose(alarm); - } - } - @Nullable @Override public String getFileSuffix(String fileName) { - return fileName; + return StringUtil.endsWith(fileName, ".txt") ? null : fileName; } -} \ No newline at end of file + + @Override + public @Nullable String getBaseName(@NotNull String fileAfterSuffix) { + return StringUtil.endsWith(fileAfterSuffix, ".txt") ? fileAfterSuffix.substring(0, fileAfterSuffix.length() - 4) : null; + } + + /** + * @return a text from passed editor with highlighted braces wrapped in {@code } tags. And {@link } marker + */ + public static String getTextEditorWithHighlightedBraces(@NotNull Editor editor, @NotNull PsiFile psiFile) { + Editor hostEditor = editor instanceof EditorWindow ? ((EditorWindow)editor).getDelegate() : editor; + List> markers = new ArrayList<>(); + Alarm alarm = new Alarm(); + try { + new BraceHighlightingHandler(psiFile.getProject(), (EditorEx)editor, alarm, psiFile).updateBraces(); + RangeHighlighter[] highlighters = editor.getMarkupModel().getAllHighlighters(); + for (RangeHighlighter highlighter : highlighters) { + if (highlighter.getLayer() == BraceHighlightingHandler.LAYER) { + markers.add(Pair.create(highlighter.getStartOffset(), "")); + markers.add(Pair.create(highlighter.getEndOffset(), "")); + } + } + } + finally { + Disposer.dispose(alarm); + } + + hostEditor.getCaretModel().getAllCarets().forEach(it -> markers.add(Pair.create(it.getOffset(), ""))); + + StringBuilder result = new StringBuilder(hostEditor.getDocument().getCharsSequence()); + markers.stream() + .sorted(Comparator.comparingInt(it -> -it.first)) + .forEach(it -> result.insert(it.first, it.second)); + return result.toString(); + } +} diff --git a/platform/testFramework/src/com/intellij/testFramework/LightPlatformCodeInsightTestCase.java b/platform/testFramework/src/com/intellij/testFramework/LightPlatformCodeInsightTestCase.java index 242d4cb9dab4..4db1ead1e09d 100644 --- a/platform/testFramework/src/com/intellij/testFramework/LightPlatformCodeInsightTestCase.java +++ b/platform/testFramework/src/com/intellij/testFramework/LightPlatformCodeInsightTestCase.java @@ -1,4 +1,4 @@ -// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.testFramework; import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer; @@ -108,6 +108,11 @@ public abstract class LightPlatformCodeInsightTestCase extends LightPlatformTest } } + @NotNull + protected String getAnswerFilePath() { + return getTestDataPath() + myFileSuffix + ".txt"; + } + private static void checkCaseSensitiveFS(@NotNull String fullOrRelativePath, @NotNull File ioFile) throws IOException { fullOrRelativePath = FileUtil.toSystemDependentName(FileUtil.toCanonicalPath(fullOrRelativePath)); if (!ioFile.getCanonicalPath().endsWith(fullOrRelativePath)) {