mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 21:55:38 +00:00
editors - some type 💄 around setInput
This commit is contained in:
parent
8f093359f0
commit
adf68a52d5
|
@ -94,11 +94,11 @@ export class SideBySideEditor extends EditorPane {
|
||||||
this.updateStyles();
|
this.updateStyles();
|
||||||
}
|
}
|
||||||
|
|
||||||
override async setInput(newInput: EditorInput, options: EditorOptions | undefined, context: IEditorOpenContext, token: CancellationToken): Promise<void> {
|
override async setInput(input: SideBySideEditorInput, options: EditorOptions | undefined, context: IEditorOpenContext, token: CancellationToken): Promise<void> {
|
||||||
const oldInput = this.input as SideBySideEditorInput;
|
const oldInput = this.input;
|
||||||
await super.setInput(newInput, options, context, token);
|
await super.setInput(input, options, context, token);
|
||||||
|
|
||||||
return this.updateInput(oldInput, (newInput as SideBySideEditorInput), options, context, token);
|
return this.updateInput(oldInput, input, options, context, token);
|
||||||
}
|
}
|
||||||
|
|
||||||
override setOptions(options: EditorOptions | undefined): void {
|
override setOptions(options: EditorOptions | undefined): void {
|
||||||
|
@ -162,7 +162,7 @@ export class SideBySideEditor extends EditorPane {
|
||||||
return this.secondaryEditorPane;
|
return this.secondaryEditorPane;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async updateInput(oldInput: SideBySideEditorInput, newInput: SideBySideEditorInput, options: EditorOptions | undefined, context: IEditorOpenContext, token: CancellationToken): Promise<void> {
|
private async updateInput(oldInput: EditorInput | undefined, newInput: SideBySideEditorInput, options: EditorOptions | undefined, context: IEditorOpenContext, token: CancellationToken): Promise<void> {
|
||||||
if (!newInput.matches(oldInput)) {
|
if (!newInput.matches(oldInput)) {
|
||||||
if (oldInput) {
|
if (oldInput) {
|
||||||
this.disposeEditors();
|
this.disposeEditors();
|
||||||
|
|
|
@ -12,7 +12,7 @@ import { IStorageService } from 'vs/platform/storage/common/storage';
|
||||||
import { ITextResourceConfigurationService } from 'vs/editor/common/services/textResourceConfigurationService';
|
import { ITextResourceConfigurationService } from 'vs/editor/common/services/textResourceConfigurationService';
|
||||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||||
import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey';
|
import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||||
import { EditorInput, EditorOptions, IEditorOpenContext } from 'vs/workbench/common/editor';
|
import { EditorOptions, IEditorOpenContext } from 'vs/workbench/common/editor';
|
||||||
import { AbstractTextResourceEditor } from 'vs/workbench/browser/parts/editor/textResourceEditor';
|
import { AbstractTextResourceEditor } from 'vs/workbench/browser/parts/editor/textResourceEditor';
|
||||||
import { OUTPUT_VIEW_ID, IOutputService, CONTEXT_IN_OUTPUT, IOutputChannel, CONTEXT_ACTIVE_LOG_OUTPUT, CONTEXT_OUTPUT_SCROLL_LOCK } from 'vs/workbench/contrib/output/common/output';
|
import { OUTPUT_VIEW_ID, IOutputService, CONTEXT_IN_OUTPUT, IOutputChannel, CONTEXT_ACTIVE_LOG_OUTPUT, CONTEXT_OUTPUT_SCROLL_LOCK } from 'vs/workbench/contrib/output/common/output';
|
||||||
import { IThemeService, registerThemingParticipant, IColorTheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService';
|
import { IThemeService, registerThemingParticipant, IColorTheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService';
|
||||||
|
@ -221,7 +221,7 @@ export class OutputEditor extends AbstractTextResourceEditor {
|
||||||
return channel ? nls.localize('outputViewWithInputAriaLabel', "{0}, Output panel", channel.label) : nls.localize('outputViewAriaLabel', "Output panel");
|
return channel ? nls.localize('outputViewWithInputAriaLabel', "{0}, Output panel", channel.label) : nls.localize('outputViewAriaLabel', "Output panel");
|
||||||
}
|
}
|
||||||
|
|
||||||
override async setInput(input: EditorInput, options: EditorOptions | undefined, context: IEditorOpenContext, token: CancellationToken): Promise<void> {
|
override async setInput(input: TextResourceEditorInput, options: EditorOptions | undefined, context: IEditorOpenContext, token: CancellationToken): Promise<void> {//
|
||||||
const focus = !(options && options.preserveFocus);
|
const focus = !(options && options.preserveFocus);
|
||||||
if (input.matches(this.input)) {
|
if (input.matches(this.input)) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -151,14 +151,14 @@ export class PreferencesEditor extends EditorPane {
|
||||||
this.preferencesRenderers.editFocusedPreference();
|
this.preferencesRenderers.editFocusedPreference();
|
||||||
}
|
}
|
||||||
|
|
||||||
override setInput(newInput: EditorInput, options: SettingsEditorOptions | undefined, context: IEditorOpenContext, token: CancellationToken): Promise<void> {
|
override setInput(input: PreferencesEditorInput, options: SettingsEditorOptions | undefined, context: IEditorOpenContext, token: CancellationToken): Promise<void> {//
|
||||||
this.defaultSettingsEditorContextKey.set(true);
|
this.defaultSettingsEditorContextKey.set(true);
|
||||||
this.defaultSettingsJSONEditorContextKey.set(true);
|
this.defaultSettingsJSONEditorContextKey.set(true);
|
||||||
if (options && options.query) {
|
if (options && options.query) {
|
||||||
this.focusSearch(options.query);
|
this.focusSearch(options.query);
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.setInput(newInput, options, context, token).then(() => this.updateInput(newInput as PreferencesEditorInput, options, context, token));
|
return super.setInput(input, options, context, token).then(() => this.updateInput(input, options, context, token));
|
||||||
}
|
}
|
||||||
|
|
||||||
layout(dimension: DOM.Dimension): void {
|
layout(dimension: DOM.Dimension): void {
|
||||||
|
@ -205,7 +205,7 @@ export class PreferencesEditor extends EditorPane {
|
||||||
}
|
}
|
||||||
|
|
||||||
private updateInput(newInput: PreferencesEditorInput, options: EditorOptions | undefined, context: IEditorOpenContext, token: CancellationToken): Promise<void> {
|
private updateInput(newInput: PreferencesEditorInput, options: EditorOptions | undefined, context: IEditorOpenContext, token: CancellationToken): Promise<void> {
|
||||||
return this.sideBySidePreferencesWidget.setInput(<DefaultPreferencesEditorInput>newInput.secondary, <EditorInput>newInput.primary, options, context, token).then(({ defaultPreferencesRenderer, editablePreferencesRenderer }) => {
|
return this.sideBySidePreferencesWidget.setInput(<DefaultPreferencesEditorInput>newInput.secondary, newInput.primary, options, context, token).then(({ defaultPreferencesRenderer, editablePreferencesRenderer }) => {
|
||||||
if (token.isCancellationRequested) {
|
if (token.isCancellationRequested) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue