Merge from vscode 011858832762aaff245b2336fb1c38166e7a10fb (#4663)

This commit is contained in:
Anthony Dresser
2019-03-22 13:07:54 -07:00
committed by GitHub
parent f5c9174c2f
commit 4a87a24235
296 changed files with 2531 additions and 2472 deletions

View File

@@ -6,7 +6,7 @@
import { Registry } from 'vs/platform/registry/common/platform';
import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
import { ICommandHandler, CommandsRegistry } from 'vs/platform/commands/common/commands';
import { SyncActionDescriptor, MenuRegistry, MenuId } from 'vs/platform/actions/common/actions';
import { SyncActionDescriptor, MenuRegistry, MenuId, ICommandAction } from 'vs/platform/actions/common/actions';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IDisposable, combinedDisposable } from 'vs/base/common/lifecycle';
import { ILifecycleService, LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
@@ -58,16 +58,16 @@ Registry.add(Extensions.WorkbenchActions, new class implements IWorkbenchActionR
if (descriptor.label) {
let idx = alias.indexOf(': ');
let categoryOriginal;
let categoryOriginal = '';
if (idx > 0) {
categoryOriginal = alias.substr(0, idx);
alias = alias.substr(idx + 2);
}
const command = {
const command: ICommandAction = {
id: descriptor.id,
title: { value: descriptor.label, original: alias },
category: category && { value: category, original: categoryOriginal }
category: category ? { value: category, original: categoryOriginal } : undefined
};
MenuRegistry.addCommand(command);

View File

@@ -35,7 +35,7 @@ export interface IComposite {
/**
* Returns the action item for a specific action.
*/
getActionItem(action: IAction): IActionItem | null;
getActionItem(action: IAction): IActionItem | undefined;
/**
* Returns the underlying control of this composite.

View File

@@ -187,13 +187,13 @@ export interface IEditorInputFactory {
* Returns a string representation of the provided editor input that contains enough information
* to deserialize back to the original editor input from the deserialize() method.
*/
serialize(editorInput: EditorInput): string | null;
serialize(editorInput: EditorInput): string | undefined;
/**
* Returns an editor input from the provided serialized form of the editor input. This form matches
* the value returned from the serialize() method.
*/
deserialize(instantiationService: IInstantiationService, serializedEditorInput: string): EditorInput | null;
deserialize(instantiationService: IInstantiationService, serializedEditorInput: string): EditorInput | undefined;
}
export interface IUntitledResourceInput extends IBaseResourceInput {

View File

@@ -76,7 +76,7 @@ export class BinaryEditorModel extends EditorModel {
// Make sure to resolve up to date stat for file resources
if (this.fileService.canHandleResource(this.resource)) {
return this.fileService.resolveFile(this.resource).then(stat => {
return this.fileService.resolveFile(this.resource, { resolveMetadata: true }).then(stat => {
this.etag = stat.etag;
if (typeof stat.size === 'number') {
this.size = stat.size;

View File

@@ -8,6 +8,7 @@ import { URI } from 'vs/base/common/uri';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { BinaryEditorModel } from 'vs/workbench/common/editor/binaryEditorModel';
import { DataUri } from 'vs/base/common/resources';
import { withUndefinedAsNull } from 'vs/base/common/types';
/**
* An editor input to present data URIs in a binary editor. Data URIs have the form of:
@@ -51,11 +52,11 @@ export class DataUriEditorInput extends EditorInput {
}
getName(): string | null {
return this.name || null;
return withUndefinedAsNull(this.name);
}
getDescription(): string | null {
return this.description || null;
return withUndefinedAsNull(this.description);
}
resolve(): Promise<BinaryEditorModel> {

View File

@@ -646,7 +646,7 @@ export class EditorGroup extends Disposable {
let serializedEditors: ISerializedEditorInput[] = [];
let serializablePreviewIndex: number | undefined;
// {{SQL CARBON EDIT}}
let editors = this.editors.map(e => {
const editors = this.editors.map(e => {
if (e instanceof QueryInput) {
return e.sql;
} else if (e instanceof NotebookInput) {
@@ -655,7 +655,7 @@ export class EditorGroup extends Disposable {
return e;
});
editors.forEach(e => {
let factory = registry.getEditorInputFactory(e.getTypeId());
const factory = registry.getEditorInputFactory(e.getTypeId());
if (factory) {
// {{SQL CARBON EDIT}}
// don't serialize unmodified unitited files
@@ -665,7 +665,7 @@ export class EditorGroup extends Disposable {
}
// {{SQL CARBON EDIT}} - End
let value = factory.serialize(e);
const value = factory.serialize(e);
if (typeof value === 'string') {
serializedEditors.push({ id: e.getTypeId(), value });
serializableEditors.push(e);

View File

@@ -287,15 +287,15 @@ export const STATUS_BAR_ITEM_HOVER_BACKGROUND = registerColor('statusBarItem.hov
}, nls.localize('statusBarItemHoverBackground', "Status bar item background color when hovering. The status bar is shown in the bottom of the window."));
export const STATUS_BAR_PROMINENT_ITEM_BACKGROUND = registerColor('statusBarItem.prominentBackground', {
dark: '#388A34',
light: '#388A34',
hc: '#3883A4'
dark: Color.black.transparent(0.5),
light: Color.black.transparent(0.5),
hc: Color.black.transparent(0.5),
}, nls.localize('statusBarProminentItemBackground', "Status bar prominent items background color. Prominent items stand out from other status bar entries to indicate importance. Change mode `Toggle Tab Key Moves Focus` from command palette to see an example. The status bar is shown in the bottom of the window."));
export const STATUS_BAR_PROMINENT_ITEM_HOVER_BACKGROUND = registerColor('statusBarItem.prominentHoverBackground', {
dark: '#369432',
light: '#369432',
hc: '#369432'
dark: Color.black.transparent(0.3),
light: Color.black.transparent(0.3),
hc: Color.black.transparent(0.3),
}, nls.localize('statusBarProminentItemHoverBackground', "Status bar prominent items background color when hovering. Prominent items stand out from other status bar entries to indicate importance. Change mode `Toggle Tab Key Moves Focus` from command palette to see an example. The status bar is shown in the bottom of the window."));
export const STATUS_BAR_HOST_NAME_BACKGROUND = registerColor('statusBarItem.hostBackground', {