aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/frontend/src/editor/EditorStore.ts
diff options
context:
space:
mode:
Diffstat (limited to 'subprojects/frontend/src/editor/EditorStore.ts')
-rw-r--r--subprojects/frontend/src/editor/EditorStore.ts13
1 files changed, 10 insertions, 3 deletions
diff --git a/subprojects/frontend/src/editor/EditorStore.ts b/subprojects/frontend/src/editor/EditorStore.ts
index 87c4040e..5e7d05e1 100644
--- a/subprojects/frontend/src/editor/EditorStore.ts
+++ b/subprojects/frontend/src/editor/EditorStore.ts
@@ -1,5 +1,5 @@
1/* 1/*
2 * SPDX-FileCopyrightText: 2021-2023 The Refinery Authors <https://refinery.tools/> 2 * SPDX-FileCopyrightText: 2021-2024 The Refinery Authors <https://refinery.tools/>
3 * 3 *
4 * SPDX-License-Identifier: EPL-2.0 4 * SPDX-License-Identifier: EPL-2.0
5 */ 5 */
@@ -62,6 +62,8 @@ export default class EditorStore {
62 62
63 showLineNumbers = false; 63 showLineNumbers = false;
64 64
65 colorIdentifiers = true;
66
65 disposed = false; 67 disposed = false;
66 68
67 analyzing = false; 69 analyzing = false;
@@ -96,7 +98,7 @@ export default class EditorStore {
96 })().catch((error) => { 98 })().catch((error) => {
97 log.error('Failed to load XtextClient', error); 99 log.error('Failed to load XtextClient', error);
98 }); 100 });
99 this.graph = new GraphStore(); 101 this.graph = new GraphStore(this);
100 makeAutoObservable<EditorStore, 'client'>(this, { 102 makeAutoObservable<EditorStore, 'client'>(this, {
101 id: false, 103 id: false,
102 state: observable.ref, 104 state: observable.ref,
@@ -279,6 +281,11 @@ export default class EditorStore {
279 log.debug('Show line numbers', this.showLineNumbers); 281 log.debug('Show line numbers', this.showLineNumbers);
280 } 282 }
281 283
284 toggleColorIdentifiers(): void {
285 this.colorIdentifiers = !this.colorIdentifiers;
286 log.debug('Color identifiers', this.colorIdentifiers);
287 }
288
282 get hasSelection(): boolean { 289 get hasSelection(): boolean {
283 return this.state.selection.ranges.some(({ from, to }) => from !== to); 290 return this.state.selection.ranges.some(({ from, to }) => from !== to);
284 } 291 }
@@ -324,7 +331,7 @@ export default class EditorStore {
324 } 331 }
325 332
326 addGeneratedModel(uuid: string, randomSeed: number): void { 333 addGeneratedModel(uuid: string, randomSeed: number): void {
327 this.generatedModels.set(uuid, new GeneratedModelStore(randomSeed)); 334 this.generatedModels.set(uuid, new GeneratedModelStore(randomSeed, this));
328 this.selectGeneratedModel(uuid); 335 this.selectGeneratedModel(uuid);
329 } 336 }
330 337