Skip to content

Commit 575eeec

Browse files
author
Akos Kitta
committed
Debounced the problem markers update with 500ms.
Signed-off-by: Akos Kitta <[email protected]>
1 parent 95b1b4d commit 575eeec

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

Diff for: arduino-ide-extension/src/browser/theia/markers/problem-manager.ts

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
import { inject, injectable, postConstruct } from '@theia/core/shared/inversify';
1+
import {
2+
inject,
3+
injectable,
4+
postConstruct,
5+
} from '@theia/core/shared/inversify';
26
import { Diagnostic } from 'vscode-languageserver-types';
37
import URI from '@theia/core/lib/common/uri';
48
import { ILogger } from '@theia/core';
59
import { Marker } from '@theia/markers/lib/common/marker';
610
import { ProblemManager as TheiaProblemManager } from '@theia/markers/lib/browser/problem/problem-manager';
711
import { ConfigService } from '../../../common/protocol/config-service';
12+
import debounce = require('lodash.debounce');
813

914
@injectable()
1015
export class ProblemManager extends TheiaProblemManager {
@@ -37,4 +42,12 @@ export class ProblemManager extends TheiaProblemManager {
3742
}
3843
return super.setMarkers(uri, owner, data);
3944
}
45+
46+
private readonly debouncedFireOnDidChangeMakers = debounce(
47+
(uri: URI) => this.onDidChangeMarkersEmitter.fire(uri),
48+
500
49+
);
50+
protected override fireOnDidChangeMarkers(uri: URI): void {
51+
this.debouncedFireOnDidChangeMakers(uri);
52+
}
4053
}

0 commit comments

Comments
 (0)