aboutsummaryrefslogtreecommitdiffstats
path: root/language-web/src/main/js/xtext/xtextServiceResults.ts
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-web/src/main/js/xtext/xtextServiceResults.ts
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-web/src/main/js/xtext/xtextServiceResults.ts')
-rw-r--r--language-web/src/main/js/xtext/xtextServiceResults.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/language-web/src/main/js/xtext/xtextServiceResults.ts b/language-web/src/main/js/xtext/xtextServiceResults.ts
index b6867e2f..f79b059c 100644
--- a/language-web/src/main/js/xtext/xtextServiceResults.ts
+++ b/language-web/src/main/js/xtext/xtextServiceResults.ts
@@ -103,3 +103,10 @@ export const occurrencesResult = documentStateResult.extend({
103}); 103});
104 104
105export type OccurrencesResult = z.infer<typeof occurrencesResult>; 105export type OccurrencesResult = z.infer<typeof occurrencesResult>;
106
107export const formattingResult = documentStateResult.extend({
108 formattedText: z.string(),
109 replaceRegion: textRegion,
110});
111
112export type FormattingResult = z.infer<typeof formattingResult>;