diff options
author | 2021-10-30 02:26:43 +0200 | |
---|---|---|
committer | 2021-10-31 19:26:13 +0100 | |
commit | cc6cc0336091f838d27d66267004675ee96e1a40 (patch) | |
tree | 00e634c0b7519416392cc558ca9ca3e8d7a43f66 /language-web/src/main/js/editor/xtextMessages.ts | |
parent | chore(web): refactor PendingTask (diff) | |
download | refinery-cc6cc0336091f838d27d66267004675ee96e1a40.tar.gz refinery-cc6cc0336091f838d27d66267004675ee96e1a40.tar.zst refinery-cc6cc0336091f838d27d66267004675ee96e1a40.zip |
feat(web): add xtext content assist
Diffstat (limited to 'language-web/src/main/js/editor/xtextMessages.ts')
-rw-r--r-- | language-web/src/main/js/editor/xtextMessages.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/language-web/src/main/js/editor/xtextMessages.ts b/language-web/src/main/js/editor/xtextMessages.ts index be3125e6..68737958 100644 --- a/language-web/src/main/js/editor/xtextMessages.ts +++ b/language-web/src/main/js/editor/xtextMessages.ts | |||
@@ -21,6 +21,11 @@ export const VALID_XTEXT_WEB_ERROR_KINDS = ['request', 'server'] as const; | |||
21 | 21 | ||
22 | export type XtextWebErrorKind = typeof VALID_XTEXT_WEB_ERROR_KINDS[number]; | 22 | export type XtextWebErrorKind = typeof VALID_XTEXT_WEB_ERROR_KINDS[number]; |
23 | 23 | ||
24 | export function isXtextWebErrorKind(value: unknown): value is XtextWebErrorKind { | ||
25 | return typeof value === 'string' | ||
26 | && VALID_XTEXT_WEB_ERROR_KINDS.includes(value as XtextWebErrorKind); | ||
27 | } | ||
28 | |||
24 | export interface IXtextWebErrorResponse { | 29 | export interface IXtextWebErrorResponse { |
25 | id: string; | 30 | id: string; |
26 | 31 | ||
@@ -33,8 +38,7 @@ export function isErrorResponse(response: unknown): response is IXtextWebErrorRe | |||
33 | const errorResponse = response as IXtextWebErrorResponse; | 38 | const errorResponse = response as IXtextWebErrorResponse; |
34 | return typeof errorResponse === 'object' | 39 | return typeof errorResponse === 'object' |
35 | && typeof errorResponse.id === 'string' | 40 | && typeof errorResponse.id === 'string' |
36 | && typeof errorResponse.error === 'string' | 41 | && isXtextWebErrorKind(errorResponse.error) |
37 | && VALID_XTEXT_WEB_ERROR_KINDS.includes(errorResponse.error) | ||
38 | && typeof errorResponse.message === 'string'; | 42 | && typeof errorResponse.message === 'string'; |
39 | } | 43 | } |
40 | 44 | ||