aboutsummaryrefslogtreecommitdiffstats
path: root/language-web/src/main/js/editor/EditorStore.ts
diff options
context:
space:
mode:
Diffstat (limited to 'language-web/src/main/js/editor/EditorStore.ts')
-rw-r--r--language-web/src/main/js/editor/EditorStore.ts13
1 files changed, 12 insertions, 1 deletions
diff --git a/language-web/src/main/js/editor/EditorStore.ts b/language-web/src/main/js/editor/EditorStore.ts
index 1ac2e79f..8b9432dd 100644
--- a/language-web/src/main/js/editor/EditorStore.ts
+++ b/language-web/src/main/js/editor/EditorStore.ts
@@ -8,8 +8,11 @@ import {
8import type { IXtextOptions, IXtextServices } from 'xtext/xtext-codemirror'; 8import type { IXtextOptions, IXtextServices } from 'xtext/xtext-codemirror';
9 9
10import type { IEditorChunk } from './editor'; 10import type { IEditorChunk } from './editor';
11import { getLogger } from '../logging';
11import type { ThemeStore } from '../theme/ThemeStore'; 12import type { ThemeStore } from '../theme/ThemeStore';
12 13
14const log = getLogger('EditorStore');
15
13const xtextLang = 'problem'; 16const xtextLang = 'problem';
14 17
15const xtextOptions: IXtextOptions = { 18const xtextOptions: IXtextOptions = {
@@ -52,12 +55,20 @@ export class EditorStore {
52 xtextServices: observable.ref, 55 xtextServices: observable.ref,
53 initialSelection: false, 56 initialSelection: false,
54 }); 57 });
58 this.loadChunk();
59 }
60
61 private loadChunk(): void {
62 const loadingStartMillis = Date.now();
63 log.info('Requesting editor chunk');
55 import('./editor').then(({ editorChunk }) => { 64 import('./editor').then(({ editorChunk }) => {
56 runInAction(() => { 65 runInAction(() => {
57 this.chunk = editorChunk; 66 this.chunk = editorChunk;
58 }); 67 });
68 const loadingDurationMillis = Date.now() - loadingStartMillis;
69 log.info('Loaded editor chunk in', loadingDurationMillis, 'ms');
59 }).catch((error) => { 70 }).catch((error) => {
60 console.warn('Error while loading editor', error); 71 log.error('Error while loading editor', error);
61 }); 72 });
62 } 73 }
63 74