diff options
author | Kristóf Marussy <kristof@marussy.com> | 2021-11-16 16:47:58 +0100 |
---|---|---|
committer | Kristóf Marussy <kristof@marussy.com> | 2021-11-16 16:47:58 +0100 |
commit | 11cbae607b5a6f59f5a019b7eb525da689d2bb30 (patch) | |
tree | c40e4af57988becdcf7d363a2fb7107f668b8ba0 /language-web/src/main/js/xtext/xtextServiceResults.ts | |
parent | chore(web): json validation with zod (diff) | |
download | refinery-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.ts | 7 |
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 | ||
105 | export type OccurrencesResult = z.infer<typeof occurrencesResult>; | 105 | export type OccurrencesResult = z.infer<typeof occurrencesResult>; |
106 | |||
107 | export const formattingResult = documentStateResult.extend({ | ||
108 | formattedText: z.string(), | ||
109 | replaceRegion: textRegion, | ||
110 | }); | ||
111 | |||
112 | export type FormattingResult = z.infer<typeof formattingResult>; | ||