fix: output the stdout when launching the program with debug (#2389)

* fix: output the stdout when launch program

* chore: remove useless code
This commit is contained in:
Dan 2023-03-10 16:22:58 +08:00 committed by GitHub
parent e92a8ac465
commit 75ac54e8fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 22 deletions

View File

@ -99,24 +99,6 @@ export class DebugConsoleService implements IHistoryNavigationWidget {
public static keySet = new Set([CONTEXT_IN_DEBUG_MODE_KEY]);
constructor() {
this.contextKeyService.onDidChangeContext((e) => {
if (e.payload.affectsSome(DebugConsoleService.keySet)) {
const inDebugMode = this.contextKeyService.match(CONTEXT_IN_DEBUG_MODE_KEY);
if (inDebugMode) {
this.updateReadOnly(false);
this.updateInputDecoration();
this.debugContextKey.contextInDdebugMode.set(true);
} else {
this.updateReadOnly(true);
if (this.debugContextKey) {
this.debugContextKey.contextInDdebugMode.set(false);
}
}
}
});
}
// FIXME: 需要实现新增的属性及事件
element: HTMLElement;
onDidFocus: Event<void>;
@ -167,6 +149,22 @@ export class DebugConsoleService implements IHistoryNavigationWidget {
(this.inputEditor.monacoEditor as any)._contextKeyService,
]);
this.contextKeyService.onDidChangeContext((e) => {
if (e.payload.affectsSome(DebugConsoleService.keySet)) {
const inDebugMode = this.contextKeyService.match(CONTEXT_IN_DEBUG_MODE_KEY);
if (inDebugMode) {
this.updateReadOnly(false);
this.updateInputDecoration();
this.debugContextKey.contextInDdebugMode.set(true);
} else {
this.updateReadOnly(true);
if (this.debugContextKey) {
this.debugContextKey.contextInDdebugMode.set(false);
}
}
}
});
this.registerDecorationType();
await this.createConsoleInput();
this.setMode();

View File

@ -1,5 +1,4 @@
import cls from 'classnames';
import debounce from 'lodash/debounce';
import { observer } from 'mobx-react-lite';
import React from 'react';
@ -12,7 +11,6 @@ import {
INodeRendererProps,
CompositeTreeNode,
TreeNode,
TreeNodeEvent,
} from '@opensumi/ide-components';
import { Loading } from '@opensumi/ide-components';
import { useInjectable, ViewState, getIcon } from '@opensumi/ide-core-browser';
@ -30,8 +28,6 @@ import { IDebugConsoleModel } from './debug-console-tree.model.service';
import styles from './debug-console.module.less';
import { DebugConsoleService } from './debug-console.service';
declare const ResizeObserver: any;
export const DebugConsoleView = observer(({ viewState }: { viewState: ViewState }) => {
const debugConsoleService = useInjectable<DebugConsoleService>(DebugConsoleService);
const debugConsoleFilterService = useInjectable<DebugConsoleFilterService>(DebugConsoleFilterService);