aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/frontend/src/xtext
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2022-07-27 16:34:14 +0200
committerLibravatar Kristóf Marussy <kristof@marussy.com>2022-07-27 16:34:14 +0200
commitdeaa0580d952b77cf9e6df024d1f71ed29f53fc0 (patch)
tree95a4e538b21c13674de99a6645bae1424714721a /subprojects/frontend/src/xtext
parentdocs: Add note about proxy settings (diff)
downloadrefinery-deaa0580d952b77cf9e6df024d1f71ed29f53fc0.tar.gz
refinery-deaa0580d952b77cf9e6df024d1f71ed29f53fc0.tar.zst
refinery-deaa0580d952b77cf9e6df024d1f71ed29f53fc0.zip
chore: bump dependencies
Diffstat (limited to 'subprojects/frontend/src/xtext')
-rw-r--r--subprojects/frontend/src/xtext/ContentAssistService.ts8
-rw-r--r--subprojects/frontend/src/xtext/xtextMessages.ts10
-rw-r--r--subprojects/frontend/src/xtext/xtextServiceResults.ts16
3 files changed, 17 insertions, 17 deletions
diff --git a/subprojects/frontend/src/xtext/ContentAssistService.ts b/subprojects/frontend/src/xtext/ContentAssistService.ts
index 8b872e06..cf0fb49f 100644
--- a/subprojects/frontend/src/xtext/ContentAssistService.ts
+++ b/subprojects/frontend/src/xtext/ContentAssistService.ts
@@ -169,7 +169,7 @@ export class ContentAssistService {
169 this.lastCompletion = { 169 this.lastCompletion = {
170 ...range, 170 ...range,
171 options, 171 options,
172 span: computeSpan(prefix, entries.length), 172 validFor: computeSpan(prefix, entries.length),
173 }; 173 };
174 return this.lastCompletion; 174 return this.lastCompletion;
175 } 175 }
@@ -181,15 +181,15 @@ export class ContentAssistService {
181 return false; 181 return false;
182 } 182 }
183 const { from, to, text } = token; 183 const { from, to, text } = token;
184 const { from: lastFrom, to: lastTo, span } = this.lastCompletion; 184 const { from: lastFrom, to: lastTo, validFor } = this.lastCompletion;
185 if (!lastTo) { 185 if (!lastTo) {
186 return true; 186 return true;
187 } 187 }
188 const [transformedFrom, transformedTo] = this.mapRangeInclusive(lastFrom, lastTo); 188 const [transformedFrom, transformedTo] = this.mapRangeInclusive(lastFrom, lastTo);
189 return from >= transformedFrom 189 return from >= transformedFrom
190 && to <= transformedTo 190 && to <= transformedTo
191 && typeof span !== 'undefined' 191 && validFor instanceof RegExp
192 && span.exec(text) !== null; 192 && validFor.exec(text) !== null;
193 } 193 }
194 194
195 private shouldInvalidateCachedCompletion(transaction: Transaction): boolean { 195 private shouldInvalidateCachedCompletion(transaction: Transaction): boolean {
diff --git a/subprojects/frontend/src/xtext/xtextMessages.ts b/subprojects/frontend/src/xtext/xtextMessages.ts
index c4305fcf..4bf49c17 100644
--- a/subprojects/frontend/src/xtext/xtextMessages.ts
+++ b/subprojects/frontend/src/xtext/xtextMessages.ts
@@ -1,14 +1,14 @@
1import { z } from 'zod'; 1import { z } from 'zod';
2 2
3export const xtextWebRequest = z.object({ 3export const xtextWebRequest = z.object({
4 id: z.string().nonempty(), 4 id: z.string().min(1),
5 request: z.unknown(), 5 request: z.unknown(),
6}); 6});
7 7
8export type XtextWebRequest = z.infer<typeof xtextWebRequest>; 8export type XtextWebRequest = z.infer<typeof xtextWebRequest>;
9 9
10export const xtextWebOkResponse = z.object({ 10export const xtextWebOkResponse = z.object({
11 id: z.string().nonempty(), 11 id: z.string().min(1),
12 response: z.unknown(), 12 response: z.unknown(),
13}); 13});
14 14
@@ -19,7 +19,7 @@ export const xtextWebErrorKind = z.enum(['request', 'server']);
19export type XtextWebErrorKind = z.infer<typeof xtextWebErrorKind>; 19export type XtextWebErrorKind = z.infer<typeof xtextWebErrorKind>;
20 20
21export const xtextWebErrorResponse = z.object({ 21export const xtextWebErrorResponse = z.object({
22 id: z.string().nonempty(), 22 id: z.string().min(1),
23 error: xtextWebErrorKind, 23 error: xtextWebErrorKind,
24 message: z.string(), 24 message: z.string(),
25}); 25});
@@ -31,8 +31,8 @@ export const xtextWebPushService = z.enum(['highlight', 'validate']);
31export type XtextWebPushService = z.infer<typeof xtextWebPushService>; 31export type XtextWebPushService = z.infer<typeof xtextWebPushService>;
32 32
33export const xtextWebPushMessage = z.object({ 33export const xtextWebPushMessage = z.object({
34 resource: z.string().nonempty(), 34 resource: z.string().min(1),
35 stateId: z.string().nonempty(), 35 stateId: z.string().min(1),
36 service: xtextWebPushService, 36 service: xtextWebPushService,
37 push: z.unknown(), 37 push: z.unknown(),
38}); 38});
diff --git a/subprojects/frontend/src/xtext/xtextServiceResults.ts b/subprojects/frontend/src/xtext/xtextServiceResults.ts
index f79b059c..8b0dbbfb 100644
--- a/subprojects/frontend/src/xtext/xtextServiceResults.ts
+++ b/subprojects/frontend/src/xtext/xtextServiceResults.ts
@@ -1,13 +1,13 @@
1import { z } from 'zod'; 1import { z } from 'zod';
2 2
3export const pongResult = z.object({ 3export const pongResult = z.object({
4 pong: z.string().nonempty(), 4 pong: z.string().min(1),
5}); 5});
6 6
7export type PongResult = z.infer<typeof pongResult>; 7export type PongResult = z.infer<typeof pongResult>;
8 8
9export const documentStateResult = z.object({ 9export const documentStateResult = z.object({
10 stateId: z.string().nonempty(), 10 stateId: z.string().min(1),
11}); 11});
12 12
13export type DocumentStateResult = z.infer<typeof documentStateResult>; 13export type DocumentStateResult = z.infer<typeof documentStateResult>;
@@ -32,7 +32,7 @@ export const severity = z.enum(['error', 'warning', 'info', 'ignore']);
32export type Severity = z.infer<typeof severity>; 32export type Severity = z.infer<typeof severity>;
33 33
34export const issue = z.object({ 34export const issue = z.object({
35 description: z.string().nonempty(), 35 description: z.string().min(1),
36 severity, 36 severity,
37 line: z.number().int(), 37 line: z.number().int(),
38 column: z.number().int().nonnegative(), 38 column: z.number().int().nonnegative(),
@@ -65,14 +65,14 @@ export type TextRegion = z.infer<typeof textRegion>;
65 65
66export const contentAssistEntry = z.object({ 66export const contentAssistEntry = z.object({
67 prefix: z.string(), 67 prefix: z.string(),
68 proposal: z.string().nonempty(), 68 proposal: z.string().min(1),
69 label: z.string().optional(), 69 label: z.string().optional(),
70 description: z.string().nonempty().optional(), 70 description: z.string().min(1).optional(),
71 documentation: z.string().nonempty().optional(), 71 documentation: z.string().min(1).optional(),
72 escapePosition: z.number().int().nonnegative().optional(), 72 escapePosition: z.number().int().nonnegative().optional(),
73 textReplacements: replaceRegion.array(), 73 textReplacements: replaceRegion.array(),
74 editPositions: textRegion.array(), 74 editPositions: textRegion.array(),
75 kind: z.string().nonempty(), 75 kind: z.string().min(1),
76}); 76});
77 77
78export type ContentAssistEntry = z.infer<typeof contentAssistEntry>; 78export type ContentAssistEntry = z.infer<typeof contentAssistEntry>;
@@ -86,7 +86,7 @@ export type ContentAssistResult = z.infer<typeof contentAssistResult>;
86export const highlightingRegion = z.object({ 86export const highlightingRegion = z.object({
87 offset: z.number().int().nonnegative(), 87 offset: z.number().int().nonnegative(),
88 length: z.number().int().nonnegative(), 88 length: z.number().int().nonnegative(),
89 styleClasses: z.string().nonempty().array(), 89 styleClasses: z.string().min(1).array(),
90}); 90});
91 91
92export type HighlightingRegion = z.infer<typeof highlightingRegion>; 92export type HighlightingRegion = z.infer<typeof highlightingRegion>;