Skip to content

Commit

Permalink
Test GH7549
Browse files Browse the repository at this point in the history
  • Loading branch information
amiramw committed Apr 17, 2020
1 parent 2ce5e63 commit d26c403
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/output/src/browser/output-frontend-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,18 @@

import { ContainerModule } from 'inversify';
import { OutputWidget, OUTPUT_WIDGET_KIND } from './output-widget';
import { WidgetFactory, bindViewContribution, KeybindingContext } from '@theia/core/lib/browser';
import {
WidgetFactory,
bindViewContribution,
KeybindingContext,
FrontendApplicationContribution
} from '@theia/core/lib/browser';
import { OutputContribution, OutputWidgetIsActiveContext } from './output-contribution';
import { OutputToolbarContribution } from './output-toolbar-contribution';
import { OutputChannelManager } from '../common/output-channel';
import { bindOutputPreferences } from '../common/output-preferences';
import { TabBarToolbarContribution } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
import { TestApp } from './test-app';

export default new ContainerModule((bind, unbind, isBound, rebind) => {
bindOutputPreferences(bind);
Expand All @@ -38,4 +44,8 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
bind(KeybindingContext).toService(OutputWidgetIsActiveContext);
bind(OutputToolbarContribution).toSelf().inSingletonScope();
bind(TabBarToolbarContribution).toService(OutputToolbarContribution);

bind(FrontendApplicationContribution)
.to(TestApp)
.inSingletonScope();
});
34 changes: 34 additions & 0 deletions packages/output/src/browser/test-app.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/********************************************************************************
* Copyright (C) 2018 SAP and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* This Source Code may also be made available under the following Secondary
* Licenses when the conditions for such availability set forth in the Eclipse
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
* with the GNU Classpath Exception which is available at
* https://www.gnu.org/software/classpath/license.html.
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
import { FrontendApplicationContribution } from '@theia/core/lib/browser';
import { inject, injectable } from 'inversify';
import { OutputChannelManager, OutputChannelSeverity } from '../common/output-channel';

@injectable()
export class TestApp
implements FrontendApplicationContribution {
@inject(OutputChannelManager)
protected readonly outputChannelManager: OutputChannelManager;
public onStart(): void {
const channel = this.outputChannelManager.getChannel('my test channel');
channel.appendLine('hello info1');
channel.appendLine('hello info2', OutputChannelSeverity.info);
channel.appendLine('hello error', OutputChannelSeverity.Error);
channel.appendLine('hello warning', OutputChannelSeverity.Warning);
channel.append('append info1 ');
channel.append('append info2');
}
}

0 comments on commit d26c403

Please sign in to comment.