aboutsummaryrefslogtreecommitdiffstats
path: root/language
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2021-11-16 16:47:58 +0100
committerLibravatar Kristóf Marussy <kristof@marussy.com>2021-11-16 16:47:58 +0100
commit11cbae607b5a6f59f5a019b7eb525da689d2bb30 (patch)
treec40e4af57988becdcf7d363a2fb7107f668b8ba0 /language
parentchore(web): json validation with zod (diff)
downloadrefinery-11cbae607b5a6f59f5a019b7eb525da689d2bb30.tar.gz
refinery-11cbae607b5a6f59f5a019b7eb525da689d2bb30.tar.zst
refinery-11cbae607b5a6f59f5a019b7eb525da689d2bb30.zip
feat(web): xtext formatter client
Uses the xtext formatted on the server to format the document. Also adds the capability to take (delta) changes from the server and apply them before any pending local changes, then replay the changes. This means that the server-side formatter is effectively acting as a second user who is editing the document.
Diffstat (limited to 'language')
-rw-r--r--language/src/test/java/tools/refinery/language/tests/formatting2/ProblemFormatterTest.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/language/src/test/java/tools/refinery/language/tests/formatting2/ProblemFormatterTest.java b/language/src/test/java/tools/refinery/language/tests/formatting2/ProblemFormatterTest.java
index 854c3da1..41ad2d31 100644
--- a/language/src/test/java/tools/refinery/language/tests/formatting2/ProblemFormatterTest.java
+++ b/language/src/test/java/tools/refinery/language/tests/formatting2/ProblemFormatterTest.java
@@ -105,19 +105,19 @@ class ProblemFormatterTest {
105 void classWithoutBodyTest() { 105 void classWithoutBodyTest() {
106 testFormatter(" class Foo . ", "class Foo.\n"); 106 testFormatter(" class Foo . ", "class Foo.\n");
107 } 107 }
108 108
109 @Test 109 @Test
110 void abstractClassWithoutBodyTest() { 110 void abstractClassWithoutBodyTest() {
111 testFormatter(" abstract class Foo . ", "abstract class Foo.\n"); 111 testFormatter(" abstract class Foo . ", "abstract class Foo.\n");
112 } 112 }
113 113
114 @Test 114 @Test
115 void classExtendsWithoutBodyTest() { 115 void classExtendsWithoutBodyTest() {
116 testFormatter(" class Foo. class Bar . class Quux extends Foo , Bar . ", """ 116 testFormatter(" class Foo. class Bar . class Quux extends Foo , Bar . ", """
117 class Foo. 117 class Foo.
118 118
119 class Bar. 119 class Bar.
120 120
121 class Quux extends Foo, Bar. 121 class Quux extends Foo, Bar.
122 """); 122 """);
123 } 123 }
@@ -134,9 +134,9 @@ class ProblemFormatterTest {
134 void classExtendsWithBodyTest() { 134 void classExtendsWithBodyTest() {
135 testFormatter(" class Foo. class Bar . class Quux extends Foo , Bar { } ", """ 135 testFormatter(" class Foo. class Bar . class Quux extends Foo , Bar { } ", """
136 class Foo. 136 class Foo.
137 137
138 class Bar. 138 class Bar.
139 139
140 class Quux extends Foo, Bar { 140 class Quux extends Foo, Bar {
141 } 141 }
142 """); 142 """);
@@ -200,7 +200,7 @@ class ProblemFormatterTest {
200 problem test. 200 problem test.
201 201
202 pred foo(node a). 202 pred foo(node a).
203 203
204 class Foo. 204 class Foo.
205 205
206 foo(n1, n2). 206 foo(n1, n2).