@theia/console 1.45.1 → 1.46.0-next.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -30
- package/lib/browser/ansi-console-item.d.ts +12 -12
- package/lib/browser/ansi-console-item.js +38 -38
- package/lib/browser/console-content-widget.d.ts +17 -17
- package/lib/browser/console-content-widget.js +93 -93
- package/lib/browser/console-contribution.d.ts +33 -33
- package/lib/browser/console-contribution.js +143 -143
- package/lib/browser/console-frontend-module.d.ts +4 -4
- package/lib/browser/console-frontend-module.js +31 -31
- package/lib/browser/console-history.d.ts +19 -19
- package/lib/browser/console-history.js +74 -74
- package/lib/browser/console-manager.d.ts +7 -7
- package/lib/browser/console-manager.js +48 -48
- package/lib/browser/console-session-manager.d.ts +31 -31
- package/lib/browser/console-session-manager.js +116 -116
- package/lib/browser/console-session.d.ts +27 -27
- package/lib/browser/console-session.js +56 -56
- package/lib/browser/console-widget.d.ts +67 -67
- package/lib/browser/console-widget.d.ts.map +1 -1
- package/lib/browser/console-widget.js +270 -271
- package/lib/browser/console-widget.js.map +1 -1
- package/lib/package.spec.js +25 -25
- package/package.json +6 -6
- package/src/browser/ansi-console-item.tsx +48 -48
- package/src/browser/console-content-widget.tsx +91 -91
- package/src/browser/console-contribution.ts +143 -143
- package/src/browser/console-frontend-module.ts +32 -32
- package/src/browser/console-history.ts +76 -76
- package/src/browser/console-manager.ts +37 -37
- package/src/browser/console-session-manager.ts +121 -121
- package/src/browser/console-session.ts +61 -61
- package/src/browser/console-widget.ts +298 -299
- package/src/browser/style/index.css +49 -49
- package/src/package.spec.ts +28 -28
package/README.md
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
<div align='center'>
|
|
2
|
-
|
|
3
|
-
<br />
|
|
4
|
-
|
|
5
|
-
<img src='https://raw.githubusercontent.com/eclipse-theia/theia/master/logo/theia.svg?sanitize=true' alt='theia-ext-logo' width='100px' />
|
|
6
|
-
|
|
7
|
-
<h2>ECLIPSE THEIA - CONSOLE EXTENSION</h2>
|
|
8
|
-
|
|
9
|
-
<hr />
|
|
10
|
-
|
|
11
|
-
</div>
|
|
12
|
-
|
|
13
|
-
## Description
|
|
14
|
-
|
|
15
|
-
The `@theia/console` extension contributes a `console` widget which is used to evaluate expressions (in the form of REPL [(Read-Eval-Print-Loop)](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop)) when debugging.
|
|
16
|
-
|
|
17
|
-
## Additional Information
|
|
18
|
-
|
|
19
|
-
- [API documentation for `@theia/console`](https://eclipse-theia.github.io/theia/docs/next/modules/console.html)
|
|
20
|
-
- [Theia - GitHub](https://github.com/eclipse-theia/theia)
|
|
21
|
-
- [Theia - Website](https://theia-ide.org/)
|
|
22
|
-
|
|
23
|
-
## License
|
|
24
|
-
|
|
25
|
-
- [Eclipse Public License 2.0](http://www.eclipse.org/legal/epl-2.0/)
|
|
26
|
-
- [一 (Secondary) GNU General Public License, version 2 with the GNU Classpath Exception](https://projects.eclipse.org/license/secondary-gpl-2.0-cp)
|
|
27
|
-
|
|
28
|
-
## Trademark
|
|
29
|
-
"Theia" is a trademark of the Eclipse Foundation
|
|
30
|
-
https://www.eclipse.org/theia
|
|
1
|
+
<div align='center'>
|
|
2
|
+
|
|
3
|
+
<br />
|
|
4
|
+
|
|
5
|
+
<img src='https://raw.githubusercontent.com/eclipse-theia/theia/master/logo/theia.svg?sanitize=true' alt='theia-ext-logo' width='100px' />
|
|
6
|
+
|
|
7
|
+
<h2>ECLIPSE THEIA - CONSOLE EXTENSION</h2>
|
|
8
|
+
|
|
9
|
+
<hr />
|
|
10
|
+
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
## Description
|
|
14
|
+
|
|
15
|
+
The `@theia/console` extension contributes a `console` widget which is used to evaluate expressions (in the form of REPL [(Read-Eval-Print-Loop)](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop)) when debugging.
|
|
16
|
+
|
|
17
|
+
## Additional Information
|
|
18
|
+
|
|
19
|
+
- [API documentation for `@theia/console`](https://eclipse-theia.github.io/theia/docs/next/modules/console.html)
|
|
20
|
+
- [Theia - GitHub](https://github.com/eclipse-theia/theia)
|
|
21
|
+
- [Theia - Website](https://theia-ide.org/)
|
|
22
|
+
|
|
23
|
+
## License
|
|
24
|
+
|
|
25
|
+
- [Eclipse Public License 2.0](http://www.eclipse.org/legal/epl-2.0/)
|
|
26
|
+
- [一 (Secondary) GNU General Public License, version 2 with the GNU Classpath Exception](https://projects.eclipse.org/license/secondary-gpl-2.0-cp)
|
|
27
|
+
|
|
28
|
+
## Trademark
|
|
29
|
+
"Theia" is a trademark of the Eclipse Foundation
|
|
30
|
+
https://www.eclipse.org/theia
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import * as React from '@theia/core/shared/react';
|
|
3
|
-
import { ConsoleItem } from './console-session';
|
|
4
|
-
import { Severity } from '@theia/core/lib/common/severity';
|
|
5
|
-
export declare class AnsiConsoleItem implements ConsoleItem {
|
|
6
|
-
readonly content: string;
|
|
7
|
-
readonly severity?: Severity | undefined;
|
|
8
|
-
protected readonly htmlContent: string;
|
|
9
|
-
constructor(content: string, severity?: Severity | undefined);
|
|
10
|
-
get visible(): boolean;
|
|
11
|
-
render(): React.ReactNode;
|
|
12
|
-
}
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import * as React from '@theia/core/shared/react';
|
|
3
|
+
import { ConsoleItem } from './console-session';
|
|
4
|
+
import { Severity } from '@theia/core/lib/common/severity';
|
|
5
|
+
export declare class AnsiConsoleItem implements ConsoleItem {
|
|
6
|
+
readonly content: string;
|
|
7
|
+
readonly severity?: Severity | undefined;
|
|
8
|
+
protected readonly htmlContent: string;
|
|
9
|
+
constructor(content: string, severity?: Severity | undefined);
|
|
10
|
+
get visible(): boolean;
|
|
11
|
+
render(): React.ReactNode;
|
|
12
|
+
}
|
|
13
13
|
//# sourceMappingURL=ansi-console-item.d.ts.map
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2018 TypeFox and others.
|
|
4
|
-
//
|
|
5
|
-
// This program and the accompanying materials are made available under the
|
|
6
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
-
//
|
|
9
|
-
// This Source Code may also be made available under the following Secondary
|
|
10
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
-
// with the GNU Classpath Exception which is available at
|
|
13
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
-
//
|
|
15
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.AnsiConsoleItem = void 0;
|
|
19
|
-
const React = require("@theia/core/shared/react");
|
|
20
|
-
const DOMPurify = require("@theia/core/shared/dompurify");
|
|
21
|
-
const Anser = require("anser");
|
|
22
|
-
class AnsiConsoleItem {
|
|
23
|
-
constructor(content, severity) {
|
|
24
|
-
this.content = content;
|
|
25
|
-
this.severity = severity;
|
|
26
|
-
this.htmlContent = new Anser().ansiToHtml(this.content, {
|
|
27
|
-
use_classes: true,
|
|
28
|
-
remove_empty: true
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
get visible() {
|
|
32
|
-
return !!this.htmlContent;
|
|
33
|
-
}
|
|
34
|
-
render() {
|
|
35
|
-
return React.createElement("div", { className: 'theia-console-ansi-console-item', dangerouslySetInnerHTML: { __html: DOMPurify.sanitize(this.htmlContent) } });
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
exports.AnsiConsoleItem = AnsiConsoleItem;
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2018 TypeFox and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.AnsiConsoleItem = void 0;
|
|
19
|
+
const React = require("@theia/core/shared/react");
|
|
20
|
+
const DOMPurify = require("@theia/core/shared/dompurify");
|
|
21
|
+
const Anser = require("anser");
|
|
22
|
+
class AnsiConsoleItem {
|
|
23
|
+
constructor(content, severity) {
|
|
24
|
+
this.content = content;
|
|
25
|
+
this.severity = severity;
|
|
26
|
+
this.htmlContent = new Anser().ansiToHtml(this.content, {
|
|
27
|
+
use_classes: true,
|
|
28
|
+
remove_empty: true
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
get visible() {
|
|
32
|
+
return !!this.htmlContent;
|
|
33
|
+
}
|
|
34
|
+
render() {
|
|
35
|
+
return React.createElement("div", { className: 'theia-console-ansi-console-item', dangerouslySetInnerHTML: { __html: DOMPurify.sanitize(this.htmlContent) } });
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.AnsiConsoleItem = AnsiConsoleItem;
|
|
39
39
|
//# sourceMappingURL=ansi-console-item.js.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { Message } from '@theia/core/shared/@phosphor/messaging';
|
|
2
|
-
import { interfaces, Container } from '@theia/core/shared/inversify';
|
|
3
|
-
import { MenuPath } from '@theia/core';
|
|
4
|
-
import { TreeProps } from '@theia/core/lib/browser/tree';
|
|
5
|
-
import { SourceTreeWidget, TreeElementNode } from '@theia/core/lib/browser/source-tree';
|
|
6
|
-
import { ConsoleItem } from './console-session';
|
|
7
|
-
export declare class ConsoleContentWidget extends SourceTreeWidget {
|
|
8
|
-
static CONTEXT_MENU: MenuPath;
|
|
9
|
-
protected _shouldScrollToEnd: boolean;
|
|
10
|
-
protected set shouldScrollToEnd(shouldScrollToEnd: boolean);
|
|
11
|
-
protected get shouldScrollToEnd(): boolean;
|
|
12
|
-
static createContainer(parent: interfaces.Container, props?: Partial<TreeProps>): Container;
|
|
13
|
-
protected onAfterAttach(msg: Message): void;
|
|
14
|
-
protected revealLastOutputIfNeeded(): void;
|
|
15
|
-
protected createTreeElementNodeClassNames(node: TreeElementNode): string[];
|
|
16
|
-
protected toClassName(item: ConsoleItem): string | undefined;
|
|
17
|
-
}
|
|
1
|
+
import { Message } from '@theia/core/shared/@phosphor/messaging';
|
|
2
|
+
import { interfaces, Container } from '@theia/core/shared/inversify';
|
|
3
|
+
import { MenuPath } from '@theia/core';
|
|
4
|
+
import { TreeProps } from '@theia/core/lib/browser/tree';
|
|
5
|
+
import { SourceTreeWidget, TreeElementNode } from '@theia/core/lib/browser/source-tree';
|
|
6
|
+
import { ConsoleItem } from './console-session';
|
|
7
|
+
export declare class ConsoleContentWidget extends SourceTreeWidget {
|
|
8
|
+
static CONTEXT_MENU: MenuPath;
|
|
9
|
+
protected _shouldScrollToEnd: boolean;
|
|
10
|
+
protected set shouldScrollToEnd(shouldScrollToEnd: boolean);
|
|
11
|
+
protected get shouldScrollToEnd(): boolean;
|
|
12
|
+
static createContainer(parent: interfaces.Container, props?: Partial<TreeProps>): Container;
|
|
13
|
+
protected onAfterAttach(msg: Message): void;
|
|
14
|
+
protected revealLastOutputIfNeeded(): void;
|
|
15
|
+
protected createTreeElementNodeClassNames(node: TreeElementNode): string[];
|
|
16
|
+
protected toClassName(item: ConsoleItem): string | undefined;
|
|
17
|
+
}
|
|
18
18
|
//# sourceMappingURL=console-content-widget.d.ts.map
|
|
@@ -1,94 +1,94 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2018 TypeFox and others.
|
|
4
|
-
//
|
|
5
|
-
// This program and the accompanying materials are made available under the
|
|
6
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
-
//
|
|
9
|
-
// This Source Code may also be made available under the following Secondary
|
|
10
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
-
// with the GNU Classpath Exception which is available at
|
|
13
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
-
//
|
|
15
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
-
};
|
|
23
|
-
var ConsoleContentWidget_1;
|
|
24
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.ConsoleContentWidget = void 0;
|
|
26
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
27
|
-
const source_tree_1 = require("@theia/core/lib/browser/source-tree");
|
|
28
|
-
const console_session_1 = require("./console-session");
|
|
29
|
-
const severity_1 = require("@theia/core/lib/common/severity");
|
|
30
|
-
let ConsoleContentWidget = ConsoleContentWidget_1 = class ConsoleContentWidget extends source_tree_1.SourceTreeWidget {
|
|
31
|
-
constructor() {
|
|
32
|
-
super(...arguments);
|
|
33
|
-
this._shouldScrollToEnd = true;
|
|
34
|
-
}
|
|
35
|
-
set shouldScrollToEnd(shouldScrollToEnd) {
|
|
36
|
-
this._shouldScrollToEnd = shouldScrollToEnd;
|
|
37
|
-
this.shouldScrollToRow = this._shouldScrollToEnd;
|
|
38
|
-
}
|
|
39
|
-
get shouldScrollToEnd() {
|
|
40
|
-
return this._shouldScrollToEnd;
|
|
41
|
-
}
|
|
42
|
-
static createContainer(parent, props) {
|
|
43
|
-
const child = source_tree_1.SourceTreeWidget.createContainer(parent, {
|
|
44
|
-
contextMenuPath: ConsoleContentWidget_1.CONTEXT_MENU,
|
|
45
|
-
...props
|
|
46
|
-
});
|
|
47
|
-
child.unbind(source_tree_1.SourceTreeWidget);
|
|
48
|
-
child.bind(ConsoleContentWidget_1).toSelf();
|
|
49
|
-
return child;
|
|
50
|
-
}
|
|
51
|
-
onAfterAttach(msg) {
|
|
52
|
-
super.onAfterAttach(msg);
|
|
53
|
-
this.toDisposeOnDetach.push(this.onScrollUp(() => this.shouldScrollToEnd = false));
|
|
54
|
-
this.toDisposeOnDetach.push(this.onScrollYReachEnd(() => this.shouldScrollToEnd = true));
|
|
55
|
-
this.toDisposeOnDetach.push(this.model.onChanged(() => this.revealLastOutputIfNeeded()));
|
|
56
|
-
}
|
|
57
|
-
revealLastOutputIfNeeded() {
|
|
58
|
-
const { root } = this.model;
|
|
59
|
-
if (this.shouldScrollToEnd && source_tree_1.TreeSourceNode.is(root)) {
|
|
60
|
-
this.model.selectNode(root.children[root.children.length - 1]);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
createTreeElementNodeClassNames(node) {
|
|
64
|
-
const classNames = super.createTreeElementNodeClassNames(node);
|
|
65
|
-
if (node.element) {
|
|
66
|
-
const className = this.toClassName(node.element);
|
|
67
|
-
if (className) {
|
|
68
|
-
classNames.push(className);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return classNames;
|
|
72
|
-
}
|
|
73
|
-
toClassName(item) {
|
|
74
|
-
if (item.severity === severity_1.Severity.Error) {
|
|
75
|
-
return console_session_1.ConsoleItem.errorClassName;
|
|
76
|
-
}
|
|
77
|
-
if (item.severity === severity_1.Severity.Warning) {
|
|
78
|
-
return console_session_1.ConsoleItem.warningClassName;
|
|
79
|
-
}
|
|
80
|
-
if (item.severity === severity_1.Severity.Info) {
|
|
81
|
-
return console_session_1.ConsoleItem.infoClassName;
|
|
82
|
-
}
|
|
83
|
-
if (item.severity === severity_1.Severity.Log) {
|
|
84
|
-
return console_session_1.ConsoleItem.logClassName;
|
|
85
|
-
}
|
|
86
|
-
return undefined;
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
ConsoleContentWidget.CONTEXT_MENU = ['console-context-menu'];
|
|
90
|
-
ConsoleContentWidget = ConsoleContentWidget_1 = __decorate([
|
|
91
|
-
(0, inversify_1.injectable)()
|
|
92
|
-
], ConsoleContentWidget);
|
|
93
|
-
exports.ConsoleContentWidget = ConsoleContentWidget;
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2018 TypeFox and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
var ConsoleContentWidget_1;
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.ConsoleContentWidget = void 0;
|
|
26
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
27
|
+
const source_tree_1 = require("@theia/core/lib/browser/source-tree");
|
|
28
|
+
const console_session_1 = require("./console-session");
|
|
29
|
+
const severity_1 = require("@theia/core/lib/common/severity");
|
|
30
|
+
let ConsoleContentWidget = ConsoleContentWidget_1 = class ConsoleContentWidget extends source_tree_1.SourceTreeWidget {
|
|
31
|
+
constructor() {
|
|
32
|
+
super(...arguments);
|
|
33
|
+
this._shouldScrollToEnd = true;
|
|
34
|
+
}
|
|
35
|
+
set shouldScrollToEnd(shouldScrollToEnd) {
|
|
36
|
+
this._shouldScrollToEnd = shouldScrollToEnd;
|
|
37
|
+
this.shouldScrollToRow = this._shouldScrollToEnd;
|
|
38
|
+
}
|
|
39
|
+
get shouldScrollToEnd() {
|
|
40
|
+
return this._shouldScrollToEnd;
|
|
41
|
+
}
|
|
42
|
+
static createContainer(parent, props) {
|
|
43
|
+
const child = source_tree_1.SourceTreeWidget.createContainer(parent, {
|
|
44
|
+
contextMenuPath: ConsoleContentWidget_1.CONTEXT_MENU,
|
|
45
|
+
...props
|
|
46
|
+
});
|
|
47
|
+
child.unbind(source_tree_1.SourceTreeWidget);
|
|
48
|
+
child.bind(ConsoleContentWidget_1).toSelf();
|
|
49
|
+
return child;
|
|
50
|
+
}
|
|
51
|
+
onAfterAttach(msg) {
|
|
52
|
+
super.onAfterAttach(msg);
|
|
53
|
+
this.toDisposeOnDetach.push(this.onScrollUp(() => this.shouldScrollToEnd = false));
|
|
54
|
+
this.toDisposeOnDetach.push(this.onScrollYReachEnd(() => this.shouldScrollToEnd = true));
|
|
55
|
+
this.toDisposeOnDetach.push(this.model.onChanged(() => this.revealLastOutputIfNeeded()));
|
|
56
|
+
}
|
|
57
|
+
revealLastOutputIfNeeded() {
|
|
58
|
+
const { root } = this.model;
|
|
59
|
+
if (this.shouldScrollToEnd && source_tree_1.TreeSourceNode.is(root)) {
|
|
60
|
+
this.model.selectNode(root.children[root.children.length - 1]);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
createTreeElementNodeClassNames(node) {
|
|
64
|
+
const classNames = super.createTreeElementNodeClassNames(node);
|
|
65
|
+
if (node.element) {
|
|
66
|
+
const className = this.toClassName(node.element);
|
|
67
|
+
if (className) {
|
|
68
|
+
classNames.push(className);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return classNames;
|
|
72
|
+
}
|
|
73
|
+
toClassName(item) {
|
|
74
|
+
if (item.severity === severity_1.Severity.Error) {
|
|
75
|
+
return console_session_1.ConsoleItem.errorClassName;
|
|
76
|
+
}
|
|
77
|
+
if (item.severity === severity_1.Severity.Warning) {
|
|
78
|
+
return console_session_1.ConsoleItem.warningClassName;
|
|
79
|
+
}
|
|
80
|
+
if (item.severity === severity_1.Severity.Info) {
|
|
81
|
+
return console_session_1.ConsoleItem.infoClassName;
|
|
82
|
+
}
|
|
83
|
+
if (item.severity === severity_1.Severity.Log) {
|
|
84
|
+
return console_session_1.ConsoleItem.logClassName;
|
|
85
|
+
}
|
|
86
|
+
return undefined;
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
ConsoleContentWidget.CONTEXT_MENU = ['console-context-menu'];
|
|
90
|
+
ConsoleContentWidget = ConsoleContentWidget_1 = __decorate([
|
|
91
|
+
(0, inversify_1.injectable)()
|
|
92
|
+
], ConsoleContentWidget);
|
|
93
|
+
exports.ConsoleContentWidget = ConsoleContentWidget;
|
|
94
94
|
//# sourceMappingURL=console-content-widget.js.map
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { Command, CommandContribution, CommandRegistry, MenuContribution, MenuModelRegistry, CommandHandler } from '@theia/core';
|
|
2
|
-
import { FrontendApplicationContribution, KeybindingContribution, KeybindingRegistry } from '@theia/core/lib/browser';
|
|
3
|
-
import { ConsoleManager } from './console-manager';
|
|
4
|
-
import { ConsoleWidget } from './console-widget';
|
|
5
|
-
export declare namespace ConsoleCommands {
|
|
6
|
-
const SELECT_ALL: Command;
|
|
7
|
-
const COLLAPSE_ALL: Command;
|
|
8
|
-
const CLEAR: Command;
|
|
9
|
-
const EXECUTE: Command;
|
|
10
|
-
const NAVIGATE_BACK: Command;
|
|
11
|
-
const NAVIGATE_FORWARD: Command;
|
|
12
|
-
}
|
|
13
|
-
export declare namespace ConsoleContextMenu {
|
|
14
|
-
const CLIPBOARD: string[];
|
|
15
|
-
const CLEAR: string[];
|
|
16
|
-
}
|
|
17
|
-
export declare class ConsoleContribution implements FrontendApplicationContribution, CommandContribution, KeybindingContribution, MenuContribution {
|
|
18
|
-
protected readonly manager: ConsoleManager;
|
|
19
|
-
initialize(): void;
|
|
20
|
-
registerCommands(commands: CommandRegistry): void;
|
|
21
|
-
registerKeybindings(keybindings: KeybindingRegistry): void;
|
|
22
|
-
registerMenus(menus: MenuModelRegistry): void;
|
|
23
|
-
protected newCommandHandler(execute: ConsoleExecuteFunction): ConsoleCommandHandler;
|
|
24
|
-
}
|
|
25
|
-
export declare type ConsoleExecuteFunction = (console: ConsoleWidget, ...args: any[]) => any;
|
|
26
|
-
export declare class ConsoleCommandHandler implements CommandHandler {
|
|
27
|
-
protected readonly manager: ConsoleManager;
|
|
28
|
-
protected readonly doExecute: ConsoleExecuteFunction;
|
|
29
|
-
constructor(manager: ConsoleManager, doExecute: ConsoleExecuteFunction);
|
|
30
|
-
isEnabled(): boolean;
|
|
31
|
-
isVisible(): boolean;
|
|
32
|
-
execute(...args: any[]): any;
|
|
33
|
-
}
|
|
1
|
+
import { Command, CommandContribution, CommandRegistry, MenuContribution, MenuModelRegistry, CommandHandler } from '@theia/core';
|
|
2
|
+
import { FrontendApplicationContribution, KeybindingContribution, KeybindingRegistry } from '@theia/core/lib/browser';
|
|
3
|
+
import { ConsoleManager } from './console-manager';
|
|
4
|
+
import { ConsoleWidget } from './console-widget';
|
|
5
|
+
export declare namespace ConsoleCommands {
|
|
6
|
+
const SELECT_ALL: Command;
|
|
7
|
+
const COLLAPSE_ALL: Command;
|
|
8
|
+
const CLEAR: Command;
|
|
9
|
+
const EXECUTE: Command;
|
|
10
|
+
const NAVIGATE_BACK: Command;
|
|
11
|
+
const NAVIGATE_FORWARD: Command;
|
|
12
|
+
}
|
|
13
|
+
export declare namespace ConsoleContextMenu {
|
|
14
|
+
const CLIPBOARD: string[];
|
|
15
|
+
const CLEAR: string[];
|
|
16
|
+
}
|
|
17
|
+
export declare class ConsoleContribution implements FrontendApplicationContribution, CommandContribution, KeybindingContribution, MenuContribution {
|
|
18
|
+
protected readonly manager: ConsoleManager;
|
|
19
|
+
initialize(): void;
|
|
20
|
+
registerCommands(commands: CommandRegistry): void;
|
|
21
|
+
registerKeybindings(keybindings: KeybindingRegistry): void;
|
|
22
|
+
registerMenus(menus: MenuModelRegistry): void;
|
|
23
|
+
protected newCommandHandler(execute: ConsoleExecuteFunction): ConsoleCommandHandler;
|
|
24
|
+
}
|
|
25
|
+
export declare type ConsoleExecuteFunction = (console: ConsoleWidget, ...args: any[]) => any;
|
|
26
|
+
export declare class ConsoleCommandHandler implements CommandHandler {
|
|
27
|
+
protected readonly manager: ConsoleManager;
|
|
28
|
+
protected readonly doExecute: ConsoleExecuteFunction;
|
|
29
|
+
constructor(manager: ConsoleManager, doExecute: ConsoleExecuteFunction);
|
|
30
|
+
isEnabled(): boolean;
|
|
31
|
+
isVisible(): boolean;
|
|
32
|
+
execute(...args: any[]): any;
|
|
33
|
+
}
|
|
34
34
|
//# sourceMappingURL=console-contribution.d.ts.map
|