aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/frontend/src/xtext/OccurrencesService.ts
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2022-09-06 22:32:04 +0200
committerLibravatar Kristóf Marussy <kristof@marussy.com>2022-09-08 01:24:50 +0200
commit5f8f4e6484faff23821ca7c009e309382fba914d (patch)
tree6d399fb90b4aa3527c30c502ba474cd83b5c94b2 /subprojects/frontend/src/xtext/OccurrencesService.ts
parentfeat(frontend): handle page hide events (diff)
downloadrefinery-5f8f4e6484faff23821ca7c009e309382fba914d.tar.gz
refinery-5f8f4e6484faff23821ca7c009e309382fba914d.tar.zst
refinery-5f8f4e6484faff23821ca7c009e309382fba914d.zip
feat(frontend): check for updates periodically
Diffstat (limited to 'subprojects/frontend/src/xtext/OccurrencesService.ts')
-rw-r--r--subprojects/frontend/src/xtext/OccurrencesService.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/subprojects/frontend/src/xtext/OccurrencesService.ts b/subprojects/frontend/src/xtext/OccurrencesService.ts
index 9d738d76..248a9a87 100644
--- a/subprojects/frontend/src/xtext/OccurrencesService.ts
+++ b/subprojects/frontend/src/xtext/OccurrencesService.ts
@@ -1,5 +1,6 @@
1import { Transaction } from '@codemirror/state'; 1import { Transaction } from '@codemirror/state';
2import { debounce } from 'lodash-es'; 2import { debounce } from 'lodash-es';
3import ms from 'ms';
3 4
4import type EditorStore from '../editor/EditorStore'; 5import type EditorStore from '../editor/EditorStore';
5import { 6import {
@@ -11,7 +12,7 @@ import getLogger from '../utils/getLogger';
11import type UpdateService from './UpdateService'; 12import type UpdateService from './UpdateService';
12import type { TextRegion } from './xtextServiceResults'; 13import type { TextRegion } from './xtextServiceResults';
13 14
14const FIND_OCCURRENCES_TIMEOUT_MS = 1000; 15const FIND_OCCURRENCES_TIMEOUT = ms('1s');
15 16
16const log = getLogger('xtext.OccurrencesService'); 17const log = getLogger('xtext.OccurrencesService');
17 18
@@ -33,7 +34,7 @@ export default class OccurrencesService {
33 34
34 private readonly findOccurrencesLater = debounce( 35 private readonly findOccurrencesLater = debounce(
35 () => this.findOccurrences(), 36 () => this.findOccurrences(),
36 FIND_OCCURRENCES_TIMEOUT_MS, 37 FIND_OCCURRENCES_TIMEOUT,
37 ); 38 );
38 39
39 constructor( 40 constructor(