Merge VS Code 1.31.1 (#4283)

This commit is contained in:
Matt Irvine
2019-03-15 13:09:45 -07:00
committed by GitHub
parent 7d31575149
commit 86bac90001
1716 changed files with 53308 additions and 48375 deletions

View File

@@ -25,7 +25,7 @@ export namespace PeekContext {
export const notInPeekEditor: ContextKeyExpr = inPeekEditor.toNegated();
}
export function getOuterEditor(accessor: ServicesAccessor): ICodeEditor {
export function getOuterEditor(accessor: ServicesAccessor): ICodeEditor | null {
let editor = accessor.get(ICodeEditorService).getFocusedCodeEditor();
if (editor instanceof EmbeddedCodeEditorWidget) {
return editor.getParentEditor();
@@ -34,13 +34,12 @@ export function getOuterEditor(accessor: ServicesAccessor): ICodeEditor {
}
export interface IPeekViewStyles extends IStyles {
headerBackgroundColor?: Color;
primaryHeadingColor?: Color;
secondaryHeadingColor?: Color;
headerBackgroundColor?: Color | null;
primaryHeadingColor?: Color | null;
secondaryHeadingColor?: Color | null;
}
export interface IPeekViewOptions extends IOptions, IPeekViewStyles {
}
export type IPeekViewOptions = IOptions & IPeekViewStyles;
const defaultOptions: IPeekViewOptions = {
headerBackgroundColor: Color.white,
@@ -92,16 +91,16 @@ export abstract class PeekViewWidget extends ZoneWidget {
protected _applyStyles(): void {
super._applyStyles();
let options = <IPeekViewOptions>this.options;
if (this._headElement) {
if (this._headElement && options.headerBackgroundColor) {
this._headElement.style.backgroundColor = options.headerBackgroundColor.toString();
}
if (this._primaryHeading) {
if (this._primaryHeading && options.primaryHeadingColor) {
this._primaryHeading.style.color = options.primaryHeadingColor.toString();
}
if (this._secondaryHeading) {
if (this._secondaryHeading && options.secondaryHeadingColor) {
this._secondaryHeading.style.color = options.secondaryHeadingColor.toString();
}
if (this._bodyElement) {
if (this._bodyElement && options.frameColor) {
this._bodyElement.style.borderColor = options.frameColor.toString();
}
}
@@ -138,7 +137,7 @@ export abstract class PeekViewWidget extends ZoneWidget {
this._actionbarWidget.push(new Action('peekview.close', nls.localize('label.close', "Close"), 'close-peekview-action', true, () => {
this.dispose();
return null;
return Promise.resolve();
}), { label: false, icon: true });
}
@@ -186,11 +185,11 @@ export abstract class PeekViewWidget extends ZoneWidget {
}
protected _doLayoutHead(heightInPixel: number, widthInPixel: number): void {
this._headElement.style.height = strings.format('{0}px', heightInPixel);
this._headElement.style.height = `${heightInPixel}px`;
this._headElement.style.lineHeight = this._headElement.style.height;
}
protected _doLayoutBody(heightInPixel: number, widthInPixel: number): void {
this._bodyElement.style.height = strings.format('{0}px', heightInPixel);
this._bodyElement.style.height = `${heightInPixel}px`;
}
}