debug: debounce launch.json decorations
This commit is contained in:
parent
ce74d20e00
commit
28011c3662
1 changed files with 6 additions and 1 deletions
|
@ -14,6 +14,8 @@ const decoration = vscode.window.createTextEditorDecorationType({
|
|||
color: '#b1b1b1'
|
||||
});
|
||||
|
||||
let pendingLaunchJsonDecoration: NodeJS.Timer;
|
||||
|
||||
export function activate(context): void {
|
||||
|
||||
//keybindings.json command-suggestions
|
||||
|
@ -26,7 +28,10 @@ export function activate(context): void {
|
|||
context.subscriptions.push(vscode.window.onDidChangeActiveTextEditor(editor => updateLaunchJsonDecorations(editor), null, context.subscriptions));
|
||||
context.subscriptions.push(vscode.workspace.onDidChangeTextDocument(event => {
|
||||
if (vscode.window.activeTextEditor && event.document === vscode.window.activeTextEditor.document) {
|
||||
updateLaunchJsonDecorations(vscode.window.activeTextEditor);
|
||||
if (pendingLaunchJsonDecoration) {
|
||||
clearTimeout(pendingLaunchJsonDecoration);
|
||||
}
|
||||
pendingLaunchJsonDecoration = setTimeout(() => updateLaunchJsonDecorations(vscode.window.activeTextEditor), 1000);
|
||||
}
|
||||
}, null, context.subscriptions));
|
||||
updateLaunchJsonDecorations(vscode.window.activeTextEditor);
|
||||
|
|
Loading…
Reference in a new issue