diff options
Diffstat (limited to 'language-web/src/main/js/editor/EditorStore.ts')
-rw-r--r-- | language-web/src/main/js/editor/EditorStore.ts | 13 |
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 { | |||
8 | import type { IXtextOptions, IXtextServices } from 'xtext/xtext-codemirror'; | 8 | import type { IXtextOptions, IXtextServices } from 'xtext/xtext-codemirror'; |
9 | 9 | ||
10 | import type { IEditorChunk } from './editor'; | 10 | import type { IEditorChunk } from './editor'; |
11 | import { getLogger } from '../logging'; | ||
11 | import type { ThemeStore } from '../theme/ThemeStore'; | 12 | import type { ThemeStore } from '../theme/ThemeStore'; |
12 | 13 | ||
14 | const log = getLogger('EditorStore'); | ||
15 | |||
13 | const xtextLang = 'problem'; | 16 | const xtextLang = 'problem'; |
14 | 17 | ||
15 | const xtextOptions: IXtextOptions = { | 18 | const 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 | ||