Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output in horizontal panel #2146

Merged
merged 25 commits into from
Jan 21, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
f42cc2e
BaseEditor is a Panel
isidorn Jan 20, 2016
89795f0
debug: use const
isidorn Jan 20, 2016
7074eb4
output: remove logEditorInput
isidorn Jan 20, 2016
7784f6f
output: register output panel
isidorn Jan 20, 2016
cbe6b68
output: showOutput use panel
isidorn Jan 20, 2016
9f30c7d
output: outputService.getActiveChannel
isidorn Jan 20, 2016
e7f9837
output: output actions do not use editor service
isidorn Jan 20, 2016
541e754
output: remove unnecessery create and layout.
isidorn Jan 21, 2016
8888fdd
output: reveal last line on output recieved
isidorn Jan 21, 2016
a7ab896
output: actions in panel
isidorn Jan 21, 2016
7e038dc
output: simpllify output actions
isidorn Jan 21, 2016
f5d6fb1
output: include output.contribution.css
isidorn Jan 21, 2016
8faae6d
output: remove unused css and icons
isidorn Jan 21, 2016
5fa32af
vscode.d.ts make column argument deprecated
isidorn Jan 21, 2016
321c493
output: OutputPanel override getId() instead of messing with StringEd…
isidorn Jan 21, 2016
072f8b0
output: channel is mandatory
isidorn Jan 21, 2016
20b8e9b
panels do not need an order
isidorn Jan 21, 2016
ccce7f6
stringEditor: remove defaultWrappingColumn and defaultLineNumbers
isidorn Jan 21, 2016
ba63390
output: outputPanel will be dipsoed by compositePart
isidorn Jan 21, 2016
8899080
output: bundle outputPanel
isidorn Jan 21, 2016
2c1a82c
output: remove outputPanel reference in output service
isidorn Jan 21, 2016
d17c8e6
output: use storage service to store active channel
isidorn Jan 21, 2016
b6d15c6
output: panel set input to active channel upon creation
isidorn Jan 21, 2016
fec6200
Merge master
isidorn Jan 21, 2016
d45a84a
output: do not pop() from registry channels
isidorn Jan 21, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/vs/vscode.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2443,8 +2443,7 @@ declare namespace vscode {

/**
* Reveal this channel in the UI.
*
* @param column The column in which to show the channel, default in [one](#ViewColumn.One).
* @param column @deprecated **This argument is deprecated.** The column in which to show the channel, default in [one](#ViewColumn.One).
* @param preserveFocus When `true` the channel will not take focus.
*/
show(column?: ViewColumn, preserveFocus?: boolean): void;
Expand Down
6 changes: 3 additions & 3 deletions src/vs/workbench/api/node/extHostOutputService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class ExtHostOutputChannel implements vscode.OutputChannel {
}

show(column?: vscode.ViewColumn, preserveFocus?: boolean): void {
this._proxy.reveal(this._name, TypeConverters.fromViewColumn(column), preserveFocus);
this._proxy.reveal(this._name, preserveFocus);
}

hide(): void {
Expand Down Expand Up @@ -95,8 +95,8 @@ export class MainThreadOutputService {
return undefined;
}

public reveal(channel: string, position: Position, preserveFocus: boolean): TPromise<void> {
this._outputService.showOutput(channel, position, preserveFocus);
public reveal(channel: string, preserveFocus: boolean): TPromise<void> {
this._outputService.showOutput(channel, preserveFocus);
return undefined;
}

Expand Down
6 changes: 5 additions & 1 deletion src/vs/workbench/browser/panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ export abstract class Panel extends Composite implements IPanel { }
/**
* A panel descriptor is a leightweight descriptor of a panel in the monaco workbench.
*/
export class PanelDescriptor extends CompositeDescriptor<Panel> { }
export class PanelDescriptor extends CompositeDescriptor<Panel> {
constructor(moduleId: string, ctorName: string, id: string, name: string, cssClass?: string) {
super(moduleId, ctorName, id, name, cssClass);
}
}

export class PanelRegistry extends CompositeRegistry<Panel> {
private defaultPanelId: string;
Expand Down
4 changes: 2 additions & 2 deletions src/vs/workbench/browser/parts/editor/baseEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import types = require('vs/base/common/types');
import {Builder} from 'vs/base/browser/builder';
import {EventType, EditorEvent} from 'vs/workbench/common/events';
import {Registry} from 'vs/platform/platform';
import {Viewlet} from 'vs/workbench/browser/viewlet';
import {Panel} from 'vs/workbench/browser/panel';
import {EditorInput, IFileEditorInput, EditorOptions} from 'vs/workbench/common/editor';
import {IEditor, Position, POSITIONS} from 'vs/platform/editor/common/editor';
import {IInstantiationService, IConstructorSignature0} from 'vs/platform/instantiation/common/instantiation';
Expand All @@ -30,7 +30,7 @@ import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry';
*
* This class is only intended to be subclassed and not instantiated.
*/
export abstract class BaseEditor extends Viewlet implements IEditor {
export abstract class BaseEditor extends Panel implements IEditor {
private _input: EditorInput;
private _options: EditorOptions;
private _position: Position;
Expand Down
42 changes: 0 additions & 42 deletions src/vs/workbench/browser/parts/editor/stringEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {DefaultConfig} from 'vs/editor/common/config/defaultConfig';
import {EditorConfiguration} from 'vs/editor/common/config/commonEditorConfig';
import {TextEditorOptions, EditorModel, EditorInput, EditorOptions} from 'vs/workbench/common/editor';
import {BaseTextEditorModel} from 'vs/workbench/common/editor/textEditorModel';
import {LogEditorInput} from 'vs/workbench/common/editor/logEditorInput';
import {UntitledEditorInput} from 'vs/workbench/common/editor/untitledEditorInput';
import {BaseTextEditor} from 'vs/workbench/browser/parts/editor/textEditor';
import {UntitledEditorEvent, EventType} from 'vs/workbench/common/events';
Expand All @@ -35,8 +34,6 @@ export class StringEditor extends BaseTextEditor {

public static ID = 'workbench.editors.stringEditor';

private defaultWrappingColumn: number;
private defaultLineNumbers: boolean;
private mapResourceToEditorViewState: { [resource: string]: IEditorViewState; };

constructor(
Expand All @@ -50,12 +47,8 @@ export class StringEditor extends BaseTextEditor {
@IWorkbenchEditorService editorService: IWorkbenchEditorService,
@IModeService modeService: IModeService
) {

super(StringEditor.ID, telemetryService, instantiationService, contextService, storageService, messageService, configurationService, eventService, editorService, modeService);

this.defaultWrappingColumn = DefaultConfig.editor.wrappingColumn;
this.defaultLineNumbers = DefaultConfig.editor.lineNumbers;

this.mapResourceToEditorViewState = Object.create(null);

this.toUnbind.push(this.eventService.addListener(EventType.UNTITLED_FILE_DELETED, (e: UntitledEditorEvent) => this.onUntitledDeletedEvent(e)));
Expand Down Expand Up @@ -132,43 +125,17 @@ export class StringEditor extends BaseTextEditor {

// Apply options again because input has changed
textEditor.updateOptions(this.getCodeEditorOptions());

// Auto reveal last line for log editors
if (input instanceof LogEditorInput) {
this.revealLastLine();
}
});
}

protected applyConfiguration(configuration: any): void {

// Remember some settings that we overwrite from #getCodeEditorOptions()
let editorConfig = configuration && configuration[EditorConfiguration.EDITOR_SECTION];
if (editorConfig) {
this.defaultWrappingColumn = editorConfig.wrappingColumn;
this.defaultLineNumbers = editorConfig.lineNumbers;
}

super.applyConfiguration(configuration);
}

protected getCodeEditorOptions(): IEditorOptions {
let options = super.getCodeEditorOptions();

let input = this.getInput();
let isLog = input instanceof LogEditorInput;
let isUntitled = input instanceof UntitledEditorInput;

options.readOnly = !isUntitled; // all string editors are readonly except for the untitled one

if (isLog) {
options.wrappingColumn = 0; // all log editors wrap
options.lineNumbers = false; // all log editors hide line numbers
} else {
options.wrappingColumn = this.defaultWrappingColumn; // otherwise make sure to restore the defaults
options.lineNumbers = this.defaultLineNumbers; // otherwise make sure to restore the defaults
}

return options;
}

Expand All @@ -188,15 +155,6 @@ export class StringEditor extends BaseTextEditor {
return true;
}

public focus(): void {
super.focus();

// Auto reveal last line for log editors
if (this.getInput() instanceof LogEditorInput) {
this.revealLastLine();
}
}

public clearInput(): void {

// Keep editor view state in settings to restore when coming back
Expand Down
1 change: 1 addition & 0 deletions src/vs/workbench/buildfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ exports.collectModules= function(excludes) {

createModuleDescription('vs/workbench/parts/output/common/outputMode', languageMainExcludes),
createModuleDescription('vs/workbench/parts/output/common/outputWorker', languageWorkerExcludes),
createModuleDescription('vs/workbench/parts/output/browser/outputPanel', excludes),

createModuleDescription('vs/workbench/parts/debug/browser/debugViewlet', excludes),
createModuleDescription('vs/workbench/parts/debug/browser/repl', excludes),
Expand Down
79 changes: 0 additions & 79 deletions src/vs/workbench/common/editor/logEditorInput.ts

This file was deleted.

8 changes: 4 additions & 4 deletions src/vs/workbench/parts/debug/common/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import editor = require('vs/editor/common/editorCommon');
import editorbrowser = require('vs/editor/browser/editorBrowser');
import { Source } from 'vs/workbench/parts/debug/common/debugSource';

export var VIEWLET_ID = 'workbench.view.debug';
export var REPL_ID = 'workbench.panel.repl';
export var DEBUG_SERVICE_ID = 'debugService';
export var CONTEXT_IN_DEBUG_MODE = 'inDebugMode';
export const VIEWLET_ID = 'workbench.view.debug';
export const REPL_ID = 'workbench.panel.repl';
export const DEBUG_SERVICE_ID = 'debugService';
export const CONTEXT_IN_DEBUG_MODE = 'inDebugMode';

// raw

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ const openViewletKb: IKeybindings = {
'Repl',
debug.REPL_ID,
nls.localize('debugConsole', "Debug Console"),
'repl',
40
'repl'
));
(<panel.PanelRegistry>platform.Registry.as(panel.Extensions.Panels)).setDefaultPanelId(debug.REPL_ID);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
}

// no task running, execute the preLaunchTask.
this.outputService.showOutput('Tasks', true, true);
this.outputService.showOutput('Tasks', true);

const taskPromise = this.taskService.run(filteredTasks[0].id).then(result => {
this.lastTaskEvent = null;
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

.monaco-workbench .output-action.clear-output {
background: url('clear_output.svg') center center no-repeat;
}

.monaco-workbench.vs-dark .output-action.clear-output {
background: url('clear_output_inverse.svg') center center no-repeat;
}

/* High Contrast Theming */

.monaco-workbench.hc-black .output-action.clear-output {
background: none;
}

.monaco-workbench.hc-black .output-action.clear-output:before {
content: url('clear_output_inverse.svg');
position: absolute;
top: 12px;
left: 8px;
height: 16px;
width: 16px;
}
Loading