Skip to content

Commit

Permalink
Merge from vscode de81ccf (microsoft#4738)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anthony Dresser authored Mar 28, 2019
1 parent cc29512 commit e6785ff
Show file tree
Hide file tree
Showing 77 changed files with 561 additions and 834 deletions.
2 changes: 1 addition & 1 deletion extensions/git/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class CreateBranchItem implements QuickPickItem {

constructor(private cc: CommandCenter) { }

get label(): string { return localize('create branch', '$(plus) Create new branch'); }
get label(): string { return localize('create branch', '$(plus) Create new branch...'); }
get description(): string { return ''; }

get alwaysShow(): boolean { return true; }
Expand Down
13 changes: 7 additions & 6 deletions extensions/json-language-features/extension.webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,18 @@ const withDefaults = require('../shared.webpack.config');
const path = require('path');
var webpack = require('webpack');

module.exports = withDefaults({
const config = withDefaults({
context: path.join(__dirname, 'client'),
entry: {
extension: './src/jsonMain.ts',
},
output: {
filename: 'jsonMain.js',
path: path.join(__dirname, 'client', 'dist')
},
plugins: [
new webpack.IgnorePlugin(/vertx/) // request-light dependendeny
]

}
});

// add plugin, don't replace inherited
config.plugins.push(new webpack.IgnorePlugin(/vertx/)); // request-light dependency

module.exports = config;
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,18 @@ const withDefaults = require('../../shared.webpack.config');
const path = require('path');
var webpack = require('webpack');

module.exports = withDefaults({
const config = withDefaults({
context: path.join(__dirname),
entry: {
extension: './src/jsonServerMain.ts',
},
output: {
filename: 'jsonServerMain.js',
path: path.join(__dirname, 'dist')
},
plugins: [
new webpack.IgnorePlugin(/vertx/) // request-light dependendeny
]
}
});

// add plugin, don't replace inherited
config.plugins.push(new webpack.IgnorePlugin(/vertx/)); // request-light dependency

module.exports = config;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"sanitize-html": "^1.19.1",
"semver": "^5.5.0",
"slickgrid": "github:anthonydresser/SlickGrid#2.3.29",
"spdlog": "0.7.2",
"spdlog": "0.8.1",
"sudo-prompt": "8.2.0",
"v8-inspect-profiler": "^0.0.20",
"vscode-chokidar": "1.6.5",
Expand Down
2 changes: 1 addition & 1 deletion src/sql/parts/modelComponents/queryTextEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export class QueryTextEditor extends BaseTextEditor {
public setHeightToScrollHeight(configChanged?: boolean): void {
let editorWidget = this.getControl() as ICodeEditor;
if (!this._config) {
this._config = new Configuration(undefined, editorWidget.getDomNode(), this.accessibilityService);
this._config = new Configuration(true, undefined, editorWidget.getDomNode(), this.accessibilityService);
this._scrollbarHeight = this._config.editor.viewInfo.scrollbar.horizontalScrollbarSize;
}
let editorWidgetModel = editorWidget.getModel();
Expand Down
2 changes: 2 additions & 0 deletions src/typings/spdlog.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ declare module 'spdlog' {

export const version: string;
export function setAsyncMode(bufferSize: number, flushInterval: number): void;
export function createRotatingLogger(name: string, filename: string, filesize: number, filecount: number): RotatingLogger;
export function createRotatingLoggerAsync(name: string, filename: string, filesize: number, filecount: number): Promise<RotatingLogger>;

export enum LogLevel {
CRITICAL,
Expand Down
9 changes: 4 additions & 5 deletions src/vs/base/browser/ui/dialog/dialog.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,16 @@
left:0;
top:0;
z-index: 2000;
display: flex;
justify-content: center;
align-items: center;
}

/** Dialog: Container */
.monaco-workbench .dialog-box {
position: absolute;
display: flex;
flex-direction: column-reverse;
top: 200px;
left: 50%;
margin-left: -250px;
width: 500px;
min-width: 500px;
min-height: 75px;
padding: 5px;
}
Expand Down
23 changes: 14 additions & 9 deletions src/vs/base/browser/ui/dialog/dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Disposable } from 'vs/base/common/lifecycle';
import { $, hide, show, EventHelper, clearNode, removeClasses, addClass, removeNode } from 'vs/base/browser/dom';
import { domEvent } from 'vs/base/browser/event';
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { KeyCode } from 'vs/base/common/keyCodes';
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import { Color } from 'vs/base/common/color';
import { ButtonGroup, IButtonStyles } from 'vs/base/browser/ui/button/button';
import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
Expand All @@ -26,6 +26,7 @@ export interface IDialogStyles extends IButtonStyles {
dialogForeground?: Color;
dialogBackground?: Color;
dialogShadow?: Color;
dialogBorder?: Color;
}

export class Dialog extends Disposable {
Expand All @@ -49,13 +50,15 @@ export class Dialog extends Disposable {
const messageRowElement = this.element.appendChild($('.dialog-message-row'));
this.iconElement = messageRowElement.appendChild($('.dialog-icon'));
const messageContainer = messageRowElement.appendChild($('.dialog-message-container'));
const messageElement = messageContainer.appendChild($('.dialog-message'));
messageElement.innerText = this.message;

if (this.options.detail) {
const messageDetailElement = messageContainer.appendChild($('.dialog-message-detail'));
messageDetailElement.innerText = this.options.detail;
const messageElement = messageContainer.appendChild($('.dialog-message'));
messageElement.innerText = this.message;
}

const messageDetailElement = messageContainer.appendChild($('.dialog-message-detail'));
messageDetailElement.innerText = this.options.detail ? this.options.detail : message;

const toolbarRowElement = this.element.appendChild($('.dialog-toolbar-row'));
this.toolbarContainer = toolbarRowElement.appendChild($('.dialog-toolbar'));
}
Expand Down Expand Up @@ -87,14 +90,14 @@ export class Dialog extends Disposable {
}));
});

this._register(domEvent(this.element, 'keydown', true)((e: KeyboardEvent) => {
this._register(domEvent(window, 'keydown', true)((e: KeyboardEvent) => {
const evt = new StandardKeyboardEvent(e);
if (evt.equals(KeyCode.Enter)) {
if (evt.equals(KeyCode.Enter) || evt.equals(KeyCode.Space)) {
return;
}

if (this.buttonGroup) {
if ((evt.shiftKey && evt.equals(KeyCode.Tab)) || evt.equals(KeyCode.LeftArrow)) {
if (evt.equals(KeyMod.Shift | KeyCode.Tab) || evt.equals(KeyCode.LeftArrow)) {
focusedButton = focusedButton + this.buttonGroup.buttons.length - 1;
focusedButton = focusedButton % this.buttonGroup.buttons.length;
this.buttonGroup.buttons[focusedButton].focus();
Expand All @@ -108,7 +111,7 @@ export class Dialog extends Disposable {
EventHelper.stop(e, true);
}));

this._register(domEvent(this.element, 'keyup', true)((e: KeyboardEvent) => {
this._register(domEvent(window, 'keyup', true)((e: KeyboardEvent) => {
EventHelper.stop(e, true);
const evt = new StandardKeyboardEvent(e);

Expand Down Expand Up @@ -159,11 +162,13 @@ export class Dialog extends Disposable {
const fgColor = style.dialogForeground ? `${style.dialogForeground}` : null;
const bgColor = style.dialogBackground ? `${style.dialogBackground}` : null;
const shadowColor = style.dialogShadow ? `0 0px 8px ${style.dialogShadow}` : null;
const border = style.dialogBorder ? `1px solid ${style.dialogBorder}` : null;

if (this.element) {
this.element.style.color = fgColor;
this.element.style.backgroundColor = bgColor;
this.element.style.boxShadow = shadowColor;
this.element.style.border = border;

if (this.buttonGroup) {
this.buttonGroup.buttons.forEach(button => button.style(style));
Expand Down
1 change: 1 addition & 0 deletions src/vs/base/browser/ui/list/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export interface IListVirtualDelegate<T> {
getHeight(element: T): number;
getTemplateId(element: T): string;
hasDynamicHeight?(element: T): boolean;
setDynamicHeight?(element: T, height: number): void;
}

export interface IListRenderer<T, TTemplateData> {
Expand Down
16 changes: 6 additions & 10 deletions src/vs/base/browser/ui/list/listView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,15 +191,7 @@ export class ListView<T> implements ISpliceable<T>, IDisposable {
readonly onDidChangeContentHeight: Event<number> = Event.latch(this._onDidChangeContentHeight.event);
get contentHeight(): number { return this.rangeMap.size; }

readonly onDidScroll: Event<void>;

// private _onDragStart = new Emitter<{ element: T, uri: string, event: DragEvent }>();
// readonly onDragStart = this._onDragStart.event;

// readonly onDragOver: Event<IListDragEvent<T>>;
// readonly onDragLeave: Event<void>;
// readonly onDrop: Event<IListDragEvent<T>>;
// readonly onDragEnd: Event<void>;
get onDidScroll(): Event<ScrollEvent> { return this.scrollableElement.onScroll; }

constructor(
container: HTMLElement,
Expand Down Expand Up @@ -253,7 +245,6 @@ export class ListView<T> implements ISpliceable<T>, IDisposable {

this.disposables = [this.rangeMap, this.gesture, this.scrollableElement, this.cache];

this.onDidScroll = Event.signal(this.scrollableElement.onScroll);
this.scrollableElement.onScroll(this.onScroll, this, this.disposables);
domEvent(this.rowsContainer, TouchEventType.Change)(this.onTouchChange, this, this.disposables);

Expand Down Expand Up @@ -1105,6 +1096,11 @@ export class ListView<T> implements ISpliceable<T>, IDisposable {
}

item.size = row.domNode!.offsetHeight;

if (this.virtualDelegate.setDynamicHeight) {
this.virtualDelegate.setDynamicHeight(item.element, item.size);
}

item.lastDynamicHeightWidth = this.renderWidth;
this.rowsContainer.removeChild(row.domNode!);
this.cache.release(row);
Expand Down
4 changes: 2 additions & 2 deletions src/vs/base/browser/ui/list/listWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { IListVirtualDelegate, IListRenderer, IListEvent, IListContextMenuEvent,
import { ListView, IListViewOptions, IListViewDragAndDrop, IAriaSetProvider } from './listView';
import { Color } from 'vs/base/common/color';
import { mixin } from 'vs/base/common/objects';
import { ScrollbarVisibility } from 'vs/base/common/scrollable';
import { ScrollbarVisibility, ScrollEvent } from 'vs/base/common/scrollable';
import { ISpliceable } from 'vs/base/common/sequence';
import { CombinedSpliceable } from 'vs/base/browser/ui/list/splice';
import { clamp } from 'vs/base/common/numbers';
Expand Down Expand Up @@ -1112,7 +1112,7 @@ export class List<T> implements ISpliceable<T>, IDisposable {
return Event.map(this._onPin.event, indexes => this.toListEvent({ indexes }));
}

get onDidScroll(): Event<void> { return this.view.onDidScroll; }
get onDidScroll(): Event<ScrollEvent> { return this.view.onDidScroll; }
get onMouseClick(): Event<IListMouseEvent<T>> { return this.view.onMouseClick; }
get onMouseDblClick(): Event<IListMouseEvent<T>> { return this.view.onMouseDblClick; }
get onMouseMiddleClick(): Event<IListMouseEvent<T>> { return this.view.onMouseMiddleClick; }
Expand Down
11 changes: 9 additions & 2 deletions src/vs/base/browser/ui/tree/abstractTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { disposableTimeout } from 'vs/base/common/async';
import { isMacintosh } from 'vs/base/common/platform';
import { values } from 'vs/base/common/map';
import { clamp } from 'vs/base/common/numbers';
import { ScrollEvent } from 'vs/base/common/scrollable';

function asTreeDragAndDropData<T, TFilterData>(data: IDragAndDropData): IDragAndDropData {
if (data instanceof ElementsDragAndDropData) {
Expand Down Expand Up @@ -177,6 +178,12 @@ export class ComposedTreeDelegate<T, N extends { element: T }> implements IListV
hasDynamicHeight(element: N): boolean {
return !!this.delegate.hasDynamicHeight && this.delegate.hasDynamicHeight(element.element);
}

setDynamicHeight(element: N, height: number): void {
if (this.delegate.setDynamicHeight) {
this.delegate.setDynamicHeight(element.element, height);
}
}
}

interface ITreeListTemplateData<T> {
Expand Down Expand Up @@ -502,7 +509,7 @@ class TypeFilterController<T, TFilterData> implements IDisposable {
.map(e => new StandardKeyboardEvent(e))
.filter(this.keyboardNavigationEventFilter || (() => true))
.filter(() => this.automaticKeyboardNavigation || this.triggered)
.filter(e => isPrintableCharEvent(e) || ((this.pattern.length > 0 || this.triggered) && ((e.keyCode === KeyCode.Escape || e.keyCode === KeyCode.Backspace) && !e.altKey && !e.ctrlKey && !e.metaKey) || (e.keyCode === KeyCode.Backspace && (isMacintosh ? e.altKey : e.ctrlKey) && !e.shiftKey)))
.filter(e => isPrintableCharEvent(e) || ((this.pattern.length > 0 || this.triggered) && ((e.keyCode === KeyCode.Escape || e.keyCode === KeyCode.Backspace) && !e.altKey && !e.ctrlKey && !e.metaKey) || (e.keyCode === KeyCode.Backspace && (isMacintosh ? (e.altKey && !e.metaKey) : e.ctrlKey) && !e.shiftKey)))
.forEach(e => { e.stopPropagation(); e.preventDefault(); })
.event;

Expand Down Expand Up @@ -971,7 +978,7 @@ export abstract class AbstractTree<T, TFilterData, TRef> implements IDisposable
private focusNavigationFilter: ((node: ITreeNode<T, TFilterData>) => boolean) | undefined;
protected disposables: IDisposable[] = [];

get onDidScroll(): Event<void> { return this.view.onDidScroll; }
get onDidScroll(): Event<ScrollEvent> { return this.view.onDidScroll; }

get onDidChangeFocus(): Event<ITreeEvent<T>> { return this.eventBufferer.wrapEvent(this.focus.onDidChange); }
get onDidChangeSelection(): Event<ITreeEvent<T>> { return this.eventBufferer.wrapEvent(this.selection.onDidChange); }
Expand Down
3 changes: 2 additions & 1 deletion src/vs/base/browser/ui/tree/asyncDataTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { ElementsDragAndDropData } from 'vs/base/browser/ui/list/listView';
import { isPromiseCanceledError, onUnexpectedError } from 'vs/base/common/errors';
import { toggleClass } from 'vs/base/browser/dom';
import { values } from 'vs/base/common/map';
import { ScrollEvent } from 'vs/base/common/scrollable';

interface IAsyncDataTreeNode<TInput, T> {
element: TInput | T;
Expand Down Expand Up @@ -296,7 +297,7 @@ export class AsyncDataTree<TInput, T, TFilterData = void> implements IDisposable

protected readonly disposables: IDisposable[] = [];

get onDidScroll(): Event<void> { return this.tree.onDidScroll; }
get onDidScroll(): Event<ScrollEvent> { return this.tree.onDidScroll; }

get onDidChangeFocus(): Event<ITreeEvent<T>> { return Event.map(this.tree.onDidChangeFocus, asTreeEvent); }
get onDidChangeSelection(): Event<ITreeEvent<T>> { return Event.map(this.tree.onDidChangeSelection, asTreeEvent); }
Expand Down
8 changes: 2 additions & 6 deletions src/vs/base/node/extfs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,6 @@ export function del(path: string, tmpFolder: string, callback: (error: Error | n

// do the heavy deletion outside the callers callback
rmRecursive(pathInTemp, error => {
if (error) {
console.error(error);
}

if (done) {
done(error);
}
Expand Down Expand Up @@ -308,12 +304,12 @@ export function mv(source: string, target: string, callback: (error: Error | nul
return callback(err);
}

fs.stat(target, (error, stat) => {
fs.lstat(target, (error, stat) => {
if (error) {
return callback(error);
}

if (stat.isDirectory()) {
if (stat.isDirectory() || stat.isSymbolicLink()) {
return callback(null);
}

Expand Down
9 changes: 7 additions & 2 deletions src/vs/editor/browser/config/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,13 @@ export class Configuration extends CommonEditorConfiguration {

private readonly _elementSizeObserver: ElementSizeObserver;

constructor(options: IEditorOptions, referenceDomElement: HTMLElement | null = null, private readonly accessibilityService: IAccessibilityService) {
super(options);
constructor(
isSimpleWidget: boolean,
options: IEditorOptions,
referenceDomElement: HTMLElement | null = null,
private readonly accessibilityService: IAccessibilityService
) {
super(isSimpleWidget, options);

this._elementSizeObserver = this._register(new ElementSizeObserver(referenceDomElement, () => this._onReferenceDomElementSizeChanged()));

Expand Down
2 changes: 1 addition & 1 deletion src/vs/editor/browser/widget/codeEditorWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
}

protected _createConfiguration(options: editorOptions.IEditorOptions, accessibilityService: IAccessibilityService): editorCommon.IConfiguration {
return new Configuration(options, this._domElement, accessibilityService);
return new Configuration(this.isSimpleWidget, options, this._domElement, accessibilityService);
}

public getId(): string {
Expand Down
Loading

0 comments on commit e6785ff

Please sign in to comment.