diff options
author | 2021-11-16 16:47:58 +0100 | |
---|---|---|
committer | 2021-11-16 16:47:58 +0100 | |
commit | 11cbae607b5a6f59f5a019b7eb525da689d2bb30 (patch) | |
tree | c40e4af57988becdcf7d363a2fb7107f668b8ba0 /language-web/src/main/js/xtext/XtextClient.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/XtextClient.ts')
-rw-r--r-- | language-web/src/main/js/xtext/XtextClient.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/language-web/src/main/js/xtext/XtextClient.ts b/language-web/src/main/js/xtext/XtextClient.ts index 3922b230..0898e725 100644 --- a/language-web/src/main/js/xtext/XtextClient.ts +++ b/language-web/src/main/js/xtext/XtextClient.ts | |||
@@ -77,4 +77,10 @@ export class XtextClient { | |||
77 | contentAssist(context: CompletionContext): Promise<CompletionResult> { | 77 | contentAssist(context: CompletionContext): Promise<CompletionResult> { |
78 | return this.contentAssistService.contentAssist(context); | 78 | return this.contentAssistService.contentAssist(context); |
79 | } | 79 | } |
80 | |||
81 | formatText(): void { | ||
82 | this.updateService.formatText().catch((e) => { | ||
83 | log.error('Error while formatting text', e); | ||
84 | }); | ||
85 | } | ||
80 | } | 86 | } |