Vscode merge (#4582)

* Merge from vscode 37cb23d3dd4f9433d56d4ba5ea3203580719a0bd

* fix issues with merges

* bump node version in azpipe

* replace license headers

* remove duplicate launch task

* fix build errors

* fix build errors

* fix tslint issues

* working through package and linux build issues

* more work

* wip

* fix packaged builds

* working through linux build errors

* wip

* wip

* wip

* fix mac and linux file limits

* iterate linux pipeline

* disable editor typing

* revert series to parallel

* remove optimize vscode from linux

* fix linting issues

* revert testing change

* add work round for new node

* readd packaging for extensions

* fix issue with angular not resolving decorator dependencies
This commit is contained in:
Anthony Dresser
2019-03-19 17:44:35 -07:00
committed by GitHub
parent 833d197412
commit 87765e8673
1879 changed files with 54505 additions and 38058 deletions

View File

@@ -0,0 +1,10 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0)">
<path d="M2 5.5L3.05473 4.44428L8 9.38955L12.9453 4.44428L14 5.5L8 11.5L2 5.5Z" fill="white"/>
</g>
<defs>
<clipPath id="clip0">
<rect width="12" height="12" fill="white" transform="translate(2 2)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 351 B

View File

@@ -0,0 +1,10 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0)">
<path d="M2 5.5L3.05473 4.44428L8 9.38955L12.9453 4.44428L14 5.5L8 11.5L2 5.5Z" fill="#4B4B4B"/>
</g>
<defs>
<clipPath id="clip0">
<rect width="12" height="12" fill="white" transform="translate(2 2)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 353 B

View File

@@ -0,0 +1,10 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0)">
<path d="M2 5.5L3.05473 4.44428L8 9.38955L12.9453 4.44428L14 5.5L8 11.5L2 5.5Z" fill="#C8C8C8"/>
</g>
<defs>
<clipPath id="clip0">
<rect width="12" height="12" fill="white" transform="translate(2 2)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 353 B

View File

@@ -0,0 +1,10 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0)">
<path d="M14 10.5L12.9453 11.5557L8 6.61045L3.05473 11.5557L2 10.5L8 4.5L14 10.5Z" fill="white"/>
</g>
<defs>
<clipPath id="clip0">
<rect width="12" height="12" fill="white" transform="translate(2 2)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 354 B

View File

@@ -0,0 +1,10 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0)">
<path d="M14 10.5L12.9453 11.5557L8 6.61045L3.05473 11.5557L2 10.5L8 4.5L14 10.5Z" fill="white"/>
</g>
<defs>
<clipPath id="clip0">
<rect width="12" height="12" fill="white" transform="translate(2 2)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 354 B

View File

@@ -0,0 +1,10 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0)">
<path d="M14 10.5L12.9453 11.5557L8 6.61045L3.05473 11.5557L2 10.5L8 4.5L14 10.5Z" fill="#4B4B4B"/>
</g>
<defs>
<clipPath id="clip0">
<rect width="12" height="12" fill="white" transform="translate(2 2)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 356 B

View File

@@ -0,0 +1,10 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0)">
<path d="M14 10.5L12.9453 11.5557L8 6.61045L3.05473 11.5557L2 10.5L8 4.5L14 10.5Z" fill="#C8C8C8"/>
</g>
<defs>
<clipPath id="clip0">
<rect width="12" height="12" fill="white" transform="translate(2 2)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 356 B

View File

@@ -19,6 +19,14 @@
cursor: pointer;
}
.monaco-editor .peekview-widget .head .peekview-title .icon {
display: inline-block;
height: 16px;
width: 16px;
vertical-align: text-bottom;
margin-right: 4px;
}
.monaco-editor .peekview-widget .head .peekview-title .dirname:not(:empty) {
font-size: 0.9em;
margin-left: 0.5em;
@@ -73,3 +81,27 @@
background: url('close-inverse.svg') center center no-repeat;
}
.monaco-editor .peekview-widget .peekview-actions .icon.chevron-up {
background: url('chevron-up-inverse.svg') center center no-repeat;
}
.vs-dark .monaco-editor .peekview-widget .peekview-actions .icon.chevron-up {
background: url('chevron-up.svg') center center no-repeat;
}
.hc-black .monaco-editor .peekview-widget .peekview-actions .icon.chevron-up {
background: url('chevron-up-inverse-hc.svg') center center no-repeat;
}
.monaco-editor .peekview-widget .peekview-actions .icon.chevron-down {
background: url('chevron-down-inverse.svg') center center no-repeat;
}
.vs-dark .monaco-editor .peekview-widget .peekview-actions .icon.chevron-down {
background: url('chevron-down.svg') center center no-repeat;
}
.hc-black .monaco-editor .peekview-widget .peekview-actions .icon.chevron-down {
background: url('chevron-down-hc.svg') center center no-repeat;
}

View File

@@ -34,9 +34,9 @@ export function getOuterEditor(accessor: ServicesAccessor): ICodeEditor | null {
}
export interface IPeekViewStyles extends IStyles {
headerBackgroundColor?: Color | null;
primaryHeadingColor?: Color | null;
secondaryHeadingColor?: Color | null;
headerBackgroundColor?: Color;
primaryHeadingColor?: Color;
secondaryHeadingColor?: Color;
}
export type IPeekViewOptions = IOptions & IPeekViewStyles;
@@ -54,6 +54,7 @@ export abstract class PeekViewWidget extends ZoneWidget {
private _onDidClose = new Emitter<PeekViewWidget>();
protected _headElement: HTMLDivElement;
protected _headingIcon: HTMLElement;
protected _primaryHeading: HTMLElement;
protected _secondaryHeading: HTMLElement;
protected _metaHeading: HTMLElement;
@@ -123,10 +124,11 @@ export abstract class PeekViewWidget extends ZoneWidget {
dom.append(this._headElement, titleElement);
dom.addStandardDisposableListener(titleElement, 'click', event => this._onTitleClick(event));
this._headingIcon = dom.$('span');
this._primaryHeading = dom.$('span.filename');
this._secondaryHeading = dom.$('span.dirname');
this._metaHeading = dom.$('span.meta');
dom.append(titleElement, this._primaryHeading, this._secondaryHeading, this._metaHeading);
dom.append(titleElement, this._headingIcon, this._primaryHeading, this._secondaryHeading, this._metaHeading);
const actionsContainer = dom.$('.peekview-actions');
dom.append(this._headElement, actionsContainer);
@@ -149,6 +151,10 @@ export abstract class PeekViewWidget extends ZoneWidget {
// implement me
}
public setTitleIcon(iconClassName: string): void {
this._headingIcon.className = iconClassName ? `icon ${iconClassName}` : '';
}
public setTitle(primaryHeading: string, secondaryHeading?: string): void {
this._primaryHeading.innerHTML = strings.escape(primaryHeading);
this._primaryHeading.setAttribute('aria-label', primaryHeading);

View File

@@ -32,21 +32,21 @@ export abstract class ReferencesController implements editorCommon.IEditorContri
private static readonly ID = 'editor.contrib.referencesController';
private _editor: ICodeEditor;
private _widget: ReferenceWidget;
private _model: ReferencesModel;
private readonly _editor: ICodeEditor;
private _widget: ReferenceWidget | null;
private _model: ReferencesModel | null;
private _requestIdPool = 0;
private _disposables: IDisposable[] = [];
private _ignoreModelChangeEvent = false;
private _referenceSearchVisible: IContextKey<boolean>;
private readonly _referenceSearchVisible: IContextKey<boolean>;
public static get(editor: ICodeEditor): ReferencesController {
return editor.getContribution<ReferencesController>(ReferencesController.ID);
}
public constructor(
private _defaultTreeKeyboardSupport: boolean,
private readonly _defaultTreeKeyboardSupport: boolean,
editor: ICodeEditor,
@IContextKeyService contextKeyService: IContextKeyService,
@ICodeEditorService private readonly _editorService: ICodeEditorService,
@@ -66,23 +66,26 @@ export abstract class ReferencesController implements editorCommon.IEditorContri
public dispose(): void {
this._referenceSearchVisible.reset();
dispose(this._disposables);
dispose(this._widget);
dispose(this._model);
this._widget = null;
this._model = null;
this._editor = null;
if (this._widget) {
dispose(this._widget);
this._widget = null;
}
if (this._model) {
dispose(this._model);
this._model = null;
}
}
public toggleWidget(range: Range, modelPromise: CancelablePromise<ReferencesModel>, options: RequestOptions): void {
// close current widget and return early is position didn't change
let widgetPosition: Position;
let widgetPosition: Position | undefined;
if (this._widget) {
widgetPosition = this._widget.position;
}
this.closeWidget();
if (!!widgetPosition && range.containsPosition(widgetPosition)) {
return null;
return;
}
this._referenceSearchVisible.set(true);
@@ -101,9 +104,10 @@ export abstract class ReferencesController implements editorCommon.IEditorContri
this._widget.show(range);
this._disposables.push(this._widget.onDidClose(() => {
modelPromise.cancel();
this._storageService.store(storageKey, JSON.stringify(this._widget.layoutData), StorageScope.GLOBAL);
this._widget = null;
if (this._widget) {
this._storageService.store(storageKey, JSON.stringify(this._widget.layoutData), StorageScope.GLOBAL);
this._widget = null;
}
this.closeWidget();
}));
@@ -119,13 +123,17 @@ export abstract class ReferencesController implements editorCommon.IEditorContri
break;
}
case 'side':
this.openReference(element, kind === 'side');
if (element) {
this.openReference(element, kind === 'side');
}
break;
case 'goto':
if (options.onGoto) {
options.onGoto(element);
} else {
this._gotoReference(element);
if (element) {
if (options.onGoto) {
options.onGoto(element);
} else {
this._gotoReference(element);
}
}
break;
}
@@ -148,7 +156,7 @@ export abstract class ReferencesController implements editorCommon.IEditorContri
// show widget
return this._widget.setModel(this._model).then(() => {
if (this._widget) { // might have been closed
if (this._widget && this._model && this._editor.hasModel()) { // might have been closed
// set title
this._widget.setMetaTitle(options.getMetaTitle(this._model));
@@ -169,31 +177,46 @@ export abstract class ReferencesController implements editorCommon.IEditorContri
}
public async goToNextOrPreviousReference(fwd: boolean) {
if (this._model) { // can be called while still resolving...
let source = this._model.nearestReference(this._editor.getModel().uri, this._widget.position);
let target = this._model.nextOrPreviousReference(source, fwd);
let editorFocus = this._editor.hasTextFocus();
await this._widget.setSelection(target);
await this._gotoReference(target);
if (editorFocus) {
this._editor.focus();
}
if (!this._editor.hasModel() || !this._model || !this._widget) {
// can be called while still resolving...
return;
}
const currentPosition = this._widget.position;
if (!currentPosition) {
return;
}
const source = this._model.nearestReference(this._editor.getModel().uri, currentPosition);
if (!source) {
return;
}
const target = this._model.nextOrPreviousReference(source, fwd);
const editorFocus = this._editor.hasTextFocus();
await this._widget.setSelection(target);
await this._gotoReference(target);
if (editorFocus) {
this._editor.focus();
}
}
public closeWidget(): void {
dispose(this._widget);
this._widget = null;
if (this._widget) {
dispose(this._widget);
this._widget = null;
}
this._referenceSearchVisible.reset();
this._disposables = dispose(this._disposables);
dispose(this._model);
this._model = null;
if (this._model) {
dispose(this._model);
this._model = null;
}
this._editor.focus();
this._requestIdPool += 1; // Cancel pending requests
}
private _gotoReference(ref: Location): Promise<any> {
this._widget.hide();
if (this._widget) {
this._widget.hide();
}
this._ignoreModelChangeEvent = true;
const range = Range.lift(ref.range).collapseToStart();
@@ -216,8 +239,10 @@ export abstract class ReferencesController implements editorCommon.IEditorContri
return;
}
this._widget.show(range);
this._widget.focus();
if (this._widget) {
this._widget.show(range);
this._widget.focus();
}
}, (err) => {
this._ignoreModelChangeEvent = false;

View File

@@ -5,7 +5,7 @@
import { localize } from 'vs/nls';
import { Event, Emitter } from 'vs/base/common/event';
import { basename } from 'vs/base/common/paths';
import { basename } from 'vs/base/common/resources';
import { IDisposable, dispose, IReference } from 'vs/base/common/lifecycle';
import * as strings from 'vs/base/common/strings';
import { URI } from 'vs/base/common/uri';
@@ -44,7 +44,7 @@ export class OneReference {
getAriaMessage(): string {
return localize(
'aria.oneReference', "symbol in {0} on line {1} at column {2}",
basename(this.uri.fsPath), this.range.startLineNumber, this.range.startColumn
basename(this.uri), this.range.startLineNumber, this.range.startColumn
);
}
}
@@ -89,7 +89,7 @@ export class FileReferences implements IDisposable {
private _resolved: boolean;
private _loadFailure: any;
constructor(private readonly _parent: ReferencesModel, private _uri: URI) {
constructor(private readonly _parent: ReferencesModel, private readonly _uri: URI) {
this._children = [];
}
@@ -120,9 +120,9 @@ export class FileReferences implements IDisposable {
getAriaMessage(): string {
const len = this.children.length;
if (len === 1) {
return localize('aria.fileReferences.1', "1 symbol in {0}, full path {1}", basename(this.uri.fsPath), this.uri.fsPath);
return localize('aria.fileReferences.1', "1 symbol in {0}, full path {1}", basename(this.uri), this.uri.fsPath);
} else {
return localize('aria.fileReferences.N', "{0} symbols in {1}, full path {2}", len, basename(this.uri.fsPath), this.uri.fsPath);
return localize('aria.fileReferences.N', "{0} symbols in {1}, full path {2}", len, basename(this.uri), this.uri.fsPath);
}
}

View File

@@ -3,7 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { ReferencesModel, FileReferences, OneReference } from './referencesModel';
import { ITextModelService } from 'vs/editor/common/services/resolverService';
import { ITreeRenderer, ITreeNode, IAsyncDataSource } from 'vs/base/browser/ui/tree/tree';
@@ -15,7 +14,7 @@ import { attachBadgeStyler } from 'vs/platform/theme/common/styler';
import * as dom from 'vs/base/browser/dom';
import { localize } from 'vs/nls';
import { getBaseLabel } from 'vs/base/common/labels';
import { dirname } from 'vs/base/common/resources';
import { dirname, basename } from 'vs/base/common/resources';
import { escape } from 'vs/base/common/strings';
import { Disposable } from 'vs/base/common/lifecycle';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
@@ -23,7 +22,6 @@ import { IAccessibilityProvider } from 'vs/base/browser/ui/list/listWidget';
import { IListVirtualDelegate, IKeyboardNavigationLabelProvider, IIdentityProvider } from 'vs/base/browser/ui/list/list';
import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { basename } from 'vs/base/common/paths';
import { FuzzyScore, createMatches, IMatch } from 'vs/base/common/filters';
//#region data source
@@ -86,7 +84,7 @@ export class StringRepresentationProvider implements IKeyboardNavigationLabelPro
getKeyboardNavigationLabel(element: TreeElement): { toString(): string; } {
// todo@joao `OneReference` elements are lazy and their "real" label
// isn't known yet
return basename(element.uri.path);
return basename(element.uri);
}
mightProducePrintableCharacter(event: IKeyboardEvent): boolean {
@@ -126,7 +124,7 @@ class FileReferencesTemplate extends Disposable {
set(element: FileReferences, matches: IMatch[]) {
let parent = dirname(element.uri);
this.file.setLabel(getBaseLabel(element.uri), parent ? this._uriLabel.getUriLabel(parent, { relative: true }) : undefined, { title: this._uriLabel.getUriLabel(element.uri), matches });
this.file.setLabel(getBaseLabel(element.uri), this._uriLabel.getUriLabel(parent, { relative: true }), { title: this._uriLabel.getUriLabel(element.uri), matches });
const len = element.children.length;
this.badge.setCount(len);
if (element.failure) {

View File

@@ -400,7 +400,6 @@ export class ReferenceWidget extends PeekViewWidget {
if (e.browserEvent instanceof KeyboardEvent) {
// todo@joh make this a command
goto = true;
} else if (e.browserEvent instanceof MouseEvent) {
aside = e.browserEvent.ctrlKey || e.browserEvent.metaKey || e.browserEvent.altKey;
goto = e.browserEvent.detail === 2;
@@ -413,6 +412,18 @@ export class ReferenceWidget extends PeekViewWidget {
onEvent(e.elements[0], 'show');
}
});
this._tree.onDidOpen(e => {
const aside = (e.browserEvent instanceof MouseEvent) && (e.browserEvent.ctrlKey || e.browserEvent.metaKey || e.browserEvent.altKey);
const goto = !e.browserEvent || ((e.browserEvent instanceof MouseEvent) && e.browserEvent.detail === 2);
if (aside) {
onEvent(e.elements[0], 'side');
} else if (goto) {
onEvent(e.elements[0], 'goto');
} else {
onEvent(e.elements[0], 'show');
}
});
dom.hide(this._treeContainer);
}
@@ -461,14 +472,14 @@ export class ReferenceWidget extends PeekViewWidget {
});
}
public setModel(newModel: ReferencesModel | undefined): Promise<any> | undefined {
public setModel(newModel: ReferencesModel | undefined): Promise<any> {
// clean up
this._disposeOnNewModel = dispose(this._disposeOnNewModel);
this._model = newModel;
if (this._model) {
return this._onNewModel();
}
return undefined;
return Promise.resolve();
}
private _onNewModel(): Promise<any> {
@@ -488,7 +499,7 @@ export class ReferenceWidget extends PeekViewWidget {
this._disposeOnNewModel.push(this._decorationsManager);
// listen on model changes
this._disposeOnNewModel.push(this._model.onDidChangeReferenceRange(reference => this._tree.refresh(reference)));
this._disposeOnNewModel.push(this._model.onDidChangeReferenceRange(reference => this._tree.rerender(reference)));
// listen on editor
this._disposeOnNewModel.push(this._preview.onMouseDown(e => {
@@ -543,7 +554,7 @@ export class ReferenceWidget extends PeekViewWidget {
// Update widget header
if (reference.uri.scheme !== Schemas.inMemory) {
this.setTitle(basenameOrAuthority(reference.uri), this._uriLabel.getUriLabel(dirname(reference.uri)!));
this.setTitle(basenameOrAuthority(reference.uri), this._uriLabel.getUriLabel(dirname(reference.uri)));
} else {
this.setTitle(nls.localize('peekView.alternateTitle', "References"));
}