Skip to content

Commit 525357c

Browse files
committed
fix: review
1 parent f303d38 commit 525357c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/utils/monaco/highlightErrors.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import {parseYqlQueryWithoutCursor} from '@gravity-ui/websql-autocomplete/yql';
2+
import {debounce} from 'lodash';
23
import {MarkerSeverity, editor} from 'monaco-editor';
34

45
import i18n from './i18n';
56

67
const owner = 'ydb';
78

8-
let errorsHighlightingTimeoutId: ReturnType<typeof setTimeout>;
9+
const debouncedHighlightErrors = debounce(highlightErrors, 500);
910

1011
export function updateErrorsHighlighting() {
1112
unHighlightErrors();
1213

13-
clearTimeout(errorsHighlightingTimeoutId);
14-
errorsHighlightingTimeoutId = setTimeout(() => highlightErrors(), 500);
14+
debouncedHighlightErrors();
1515
}
1616

1717
function highlightErrors() {

0 commit comments

Comments
 (0)