diff options
author | Kristóf Marussy <kristof@marussy.com> | 2023-08-20 19:41:32 +0200 |
---|---|---|
committer | Kristóf Marussy <kristof@marussy.com> | 2023-08-20 20:29:02 +0200 |
commit | a3f1e6872f4f768d14899a1e70bbdc14f32e478d (patch) | |
tree | b2daf0c81724f31ee190f5d63eb42988086dabf2 /subprojects/frontend/src/xtext/XtextClient.ts | |
parent | fix: nullary model initialization (diff) | |
download | refinery-a3f1e6872f4f768d14899a1e70bbdc14f32e478d.tar.gz refinery-a3f1e6872f4f768d14899a1e70bbdc14f32e478d.tar.zst refinery-a3f1e6872f4f768d14899a1e70bbdc14f32e478d.zip |
feat: improve semantics error reporting
Also makes model seeds cancellable to reduce server load during semantic
analysis.
Diffstat (limited to 'subprojects/frontend/src/xtext/XtextClient.ts')
-rw-r--r-- | subprojects/frontend/src/xtext/XtextClient.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/subprojects/frontend/src/xtext/XtextClient.ts b/subprojects/frontend/src/xtext/XtextClient.ts index d145cd30..87778084 100644 --- a/subprojects/frontend/src/xtext/XtextClient.ts +++ b/subprojects/frontend/src/xtext/XtextClient.ts | |||
@@ -17,6 +17,7 @@ import getLogger from '../utils/getLogger'; | |||
17 | import ContentAssistService from './ContentAssistService'; | 17 | import ContentAssistService from './ContentAssistService'; |
18 | import HighlightingService from './HighlightingService'; | 18 | import HighlightingService from './HighlightingService'; |
19 | import OccurrencesService from './OccurrencesService'; | 19 | import OccurrencesService from './OccurrencesService'; |
20 | import SemanticsService from './SemanticsService'; | ||
20 | import UpdateService from './UpdateService'; | 21 | import UpdateService from './UpdateService'; |
21 | import ValidationService from './ValidationService'; | 22 | import ValidationService from './ValidationService'; |
22 | import XtextWebSocketClient from './XtextWebSocketClient'; | 23 | import XtextWebSocketClient from './XtextWebSocketClient'; |
@@ -37,6 +38,8 @@ export default class XtextClient { | |||
37 | 38 | ||
38 | private readonly occurrencesService: OccurrencesService; | 39 | private readonly occurrencesService: OccurrencesService; |
39 | 40 | ||
41 | private readonly semanticsService: SemanticsService; | ||
42 | |||
40 | constructor( | 43 | constructor( |
41 | private readonly store: EditorStore, | 44 | private readonly store: EditorStore, |
42 | private readonly pwaStore: PWAStore, | 45 | private readonly pwaStore: PWAStore, |
@@ -54,6 +57,7 @@ export default class XtextClient { | |||
54 | ); | 57 | ); |
55 | this.validationService = new ValidationService(store, this.updateService); | 58 | this.validationService = new ValidationService(store, this.updateService); |
56 | this.occurrencesService = new OccurrencesService(store, this.updateService); | 59 | this.occurrencesService = new OccurrencesService(store, this.updateService); |
60 | this.semanticsService = new SemanticsService(store, this.validationService); | ||
57 | } | 61 | } |
58 | 62 | ||
59 | start(): void { | 63 | start(): void { |
@@ -67,6 +71,7 @@ export default class XtextClient { | |||
67 | } | 71 | } |
68 | 72 | ||
69 | private onDisconnect(): void { | 73 | private onDisconnect(): void { |
74 | this.store.analysisCompleted(true); | ||
70 | this.highlightingService.onDisconnect(); | 75 | this.highlightingService.onDisconnect(); |
71 | this.validationService.onDisconnect(); | 76 | this.validationService.onDisconnect(); |
72 | this.occurrencesService.onDisconnect(); | 77 | this.occurrencesService.onDisconnect(); |
@@ -115,7 +120,7 @@ export default class XtextClient { | |||
115 | this.validationService.onPush(push); | 120 | this.validationService.onPush(push); |
116 | return; | 121 | return; |
117 | case 'semantics': | 122 | case 'semantics': |
118 | this.store.setSemantics(push); | 123 | this.semanticsService.onPush(push); |
119 | return; | 124 | return; |
120 | default: | 125 | default: |
121 | throw new Error('Unknown service'); | 126 | throw new Error('Unknown service'); |