Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
focus(): void {
if (!this.doFocus()) {
this.onRender.push(Disposable.create(() => this.doFocus()));
this.update();
}
}
protected doFocus(): boolean {
protected handleDragOverEvent(node: TreeNode | undefined, event: React.DragEvent): void {
event.preventDefault();
event.stopPropagation();
if (!this.toCancelNodeExpansion.disposed) {
return;
}
const timer = setTimeout(() => {
const containing = DirNode.getContainingDir(node);
if (!!containing && !containing.expanded) {
this.model.expandNode(containing);
}
}, 500);
this.toCancelNodeExpansion.push(Disposable.create(() => clearTimeout(timer)));
}
async watchGitChanges(repository: Repository): Promise {
const watcher = await this.server.watchGitChanges(repository);
const toDispose = new DisposableCollection();
toDispose.push(Disposable.create(() => this.server.unwatchGitChanges(watcher)));
return toDispose;
}
constructor(
readonly id: string,
readonly options: DebugSessionOptions,
protected readonly connection: DebugSessionConnection,
protected readonly terminalServer: TerminalService,
protected readonly editorManager: EditorManager,
protected readonly breakpoints: BreakpointManager,
protected readonly labelProvider: LabelProvider,
protected readonly messages: MessageClient,
protected readonly fileSystem: FileSystem) {
this.connection.onRequest('runInTerminal', (request: DebugProtocol.RunInTerminalRequest) => this.runInTerminal(request));
this.toDispose.pushAll([
this.onDidChangeEmitter,
this.onDidChangeBreakpointsEmitter,
Disposable.create(() => {
this.clearBreakpoints();
this.doUpdateThreads([]);
}),
this.connection,
this.on('initialized', () => this.configure()),
this.on('breakpoint', ({ body }) => this.updateBreakpoint(body)),
this.on('continued', ({ body: { allThreadsContinued, threadId } }) => {
if (allThreadsContinued !== false) {
this.clearThreads();
} else {
this.clearThread(threadId);
}
}),
this.on('stopped', async ({ body }) => {
await this.updateThreads(body);
await this.updateFrames();
if (!previewWidget || !editorWidget || !uri) {
return;
}
if (this.synchronizedUris.has(uri)) {
return;
}
const syncDisposables = new DisposableCollection();
previewWidget.disposed.connect(() => syncDisposables.dispose());
editorWidget.disposed.connect(() => syncDisposables.dispose());
const editor = editorWidget.editor;
syncDisposables.push(editor.onCursorPositionChanged(debounce(position => this.revealSourceLineInPreview(previewWidget!, position)), 100));
syncDisposables.push(this.synchronizeScrollToEditor(previewWidget, editor));
this.synchronizedUris.add(uri);
syncDisposables.push(Disposable.create(() => this.synchronizedUris.delete(uri)));
}
protected increaseZIndex(element: HTMLElement, z: string, toDisposeOnBlur: DisposableCollection) {
const parent = element.parentElement;
if (parent && !element.classList.contains('p-DockPanel')) {
const oldIndex = element.style.zIndex;
toDisposeOnBlur.push(Disposable.create(() =>
element.style.zIndex = oldIndex
));
element.style.zIndex = z;
this.increaseZIndex(parent, z, toDisposeOnBlur);
}
}
protected setStatusBarEntry(id: string, entry: StatusBarEntry): void {
this.statusBar.setElement(id, entry);
this.statusBarDisposable.push(Disposable.create(() => this.statusBar.removeElement(id)));
}
protected scheduleAutoSave() {
if (this.shouldAutoSave) {
this.autoSaveJobs.dispose();
const autoSaveJob = window.setTimeout(() => this.doAutoSave(), this.autoSaveDelay);
const disposableAutoSaveJob = Disposable.create(() => window.clearTimeout(autoSaveJob));
this.autoSaveJobs.push(disposableAutoSaveJob);
}
}