Merge from vscode fcf3346a8e9f5ee1e00674461d9e2c2292a14ee3 (#12295)

* Merge from vscode fcf3346a8e9f5ee1e00674461d9e2c2292a14ee3

* Fix test build break

* Update distro

* Fix build errors

* Update distro

* Update REH build file

* Update build task names for REL

* Fix product build yaml

* Fix product REH task name

* Fix type in task name

* Update linux build step

* Update windows build tasks

* Turn off server publish

* Disable REH

* Fix typo

* Bump distro

* Update vscode tests

* Bump distro

* Fix type in disto

* Bump distro

* Turn off docker build

* Remove docker step from release

Co-authored-by: ADS Merger <andresse@microsoft.com>
Co-authored-by: Karl Burtram <karlb@microsoft.com>
This commit is contained in:
Christopher Suh
2020-10-03 14:42:05 -04:00
committed by GitHub
parent 58d02b76db
commit 6ff1e3866b
687 changed files with 10507 additions and 9104 deletions

View File

@@ -12,7 +12,6 @@ import { CellActionBase, CellContext } from 'sql/workbench/contrib/notebook/brow
import { CellModel } from 'sql/workbench/services/notebook/browser/models/cell';
import { CellTypes, CellType } from 'sql/workbench/services/notebook/common/contracts';
import { ToggleableAction } from 'sql/workbench/contrib/notebook/browser/notebookActions';
import { firstIndex } from 'vs/base/common/arrays';
import { getErrorMessage } from 'vs/base/common/errors';
import Severity from 'vs/base/common/severity';
import { INotebookService } from 'sql/workbench/services/notebook/browser/notebookService';
@@ -218,7 +217,7 @@ export class AddCellFromContextAction extends CellActionBase {
doRun(context: CellContext): Promise<void> {
try {
let model = context.model;
let index = firstIndex(model.cells, (cell) => cell.id === context.cell.id);
let index = model.cells.findIndex((cell) => cell.id === context.cell.id);
if (index !== undefined && this.isAfter) {
index += 1;
}

View File

@@ -5,7 +5,6 @@
import { ICellMagicMapper } from 'sql/workbench/services/notebook/browser/models/modelInterfaces';
import { ILanguageMagic } from 'sql/workbench/services/notebook/browser/notebookService';
import { find } from 'vs/base/common/arrays';
const defaultKernel = '*';
export class CellMagicMapper implements ICellMagicMapper {
@@ -40,7 +39,7 @@ export class CellMagicMapper implements ICellMagicMapper {
searchText = searchText.toLowerCase();
let kernelMagics = this.kernelToMagicMap.get(kernelId) || [];
if (kernelMagics) {
return find(kernelMagics, m => m.magic.toLowerCase() === searchText);
return kernelMagics.find(m => m.magic.toLowerCase() === searchText);
}
return undefined;
}

View File

@@ -50,7 +50,6 @@ import { Button } from 'sql/base/browser/ui/button/button';
import { isUndefinedOrNull } from 'vs/base/common/types';
import { IBootstrapParams } from 'sql/workbench/services/bootstrap/common/bootstrapParams';
import { getErrorMessage, onUnexpectedError } from 'vs/base/common/errors';
import { find, firstIndex } from 'vs/base/common/arrays';
import { CodeCellComponent } from 'sql/workbench/contrib/notebook/browser/cellViews/codeCell.component';
import { TextCellComponent } from 'sql/workbench/contrib/notebook/browser/cellViews/textCell.component';
import { NotebookInput } from 'sql/workbench/contrib/notebook/browser/models/notebookInput';
@@ -364,7 +363,7 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe
if (DEFAULT_NOTEBOOK_PROVIDER === providerInfo.providerId) {
let providers = notebookUtils.getProvidersForFileName(this._notebookParams.notebookUri.fsPath, this.notebookService);
let tsqlProvider = find(providers, provider => provider === SQL_NOTEBOOK_PROVIDER);
let tsqlProvider = providers.find(provider => provider === SQL_NOTEBOOK_PROVIDER);
providerInfo.providerId = tsqlProvider ? SQL_NOTEBOOK_PROVIDER : providers[0];
}
}
@@ -411,7 +410,7 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe
}
findCellIndex(cellModel: ICellModel): number {
return firstIndex(this._model.cells, (cell) => cell.id === cellModel.id);
return this._model.cells.findIndex((cell) => cell.id === cellModel.id);
}
private setViewInErrorState(error: any): any {
@@ -607,7 +606,7 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe
private addPrimaryContributedActions(primary: IAction[]) {
for (let action of primary) {
// Need to ensure that we don't add the same action multiple times
let foundIndex = firstIndex(this._providerRelatedActions, act => act.id === action.id);
let foundIndex = this._providerRelatedActions.findIndex(act => act.id === action.id);
if (foundIndex < 0) {
this._actionBar.addAction(action);
this._providerRelatedActions.push(action);
@@ -658,7 +657,7 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe
public async runCell(cell: ICellModel): Promise<boolean> {
await this.modelReady;
let uriString = cell.cellUri.toString();
if (firstIndex(this._model.cells, c => c.cellUri.toString() === uriString) > -1) {
if (this._model.cells.findIndex(c => c.cellUri.toString() === uriString) > -1) {
this.selectCell(cell);
return cell.runCell(this.notificationService, this.connectionManagementService);
} else {
@@ -674,10 +673,10 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe
let startIndex = 0;
let endIndex = codeCells.length;
if (!isUndefinedOrNull(startCell)) {
startIndex = firstIndex(codeCells, c => c.id === startCell.id);
startIndex = codeCells.findIndex(c => c.id === startCell.id);
}
if (!isUndefinedOrNull(endCell)) {
endIndex = firstIndex(codeCells, c => c.id === endCell.id);
endIndex = codeCells.findIndex(c => c.id === endCell.id);
}
for (let i = startIndex; i < endIndex; i++) {
let cellStatus = await this.runCell(codeCells[i]);
@@ -693,7 +692,7 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe
try {
await this.modelReady;
let uriString = cell.cellUri.toString();
if (firstIndex(this._model.cells, c => c.cellUri.toString() === uriString) > -1) {
if (this._model.cells.findIndex(c => c.cellUri.toString() === uriString) > -1) {
this.selectCell(cell);
// Clear outputs of the requested cell if cell type is code cell.
// If cell is markdown cell, clearOutputs() is a no-op
@@ -767,7 +766,7 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe
let elBody: HTMLElement = document.body;
let tabBar = elBody.querySelector('.title.tabs') as HTMLElement;
let actionBar = elBody.querySelector('.editor-toolbar.actionbar-container') as HTMLElement;
let section = find(this.getSectionElements(), s => s.relativeUri && s.relativeUri.toLowerCase() === id);
let section = this.getSectionElements().find(s => s.relativeUri && s.relativeUri.toLowerCase() === id);
if (section) {
// Scroll this section to the top of the header instead of just bringing header into view.
if (tabBar && actionBar) {

View File

@@ -24,7 +24,6 @@ import { IFindNotebookController } from 'sql/workbench/contrib/notebook/browser/
import { INotebookModel } from 'sql/workbench/services/notebook/browser/models/modelInterfaces';
import { IObjectExplorerService } from 'sql/workbench/services/objectExplorer/browser/objectExplorerService';
import { TreeUpdateUtils } from 'sql/workbench/services/objectExplorer/browser/treeUpdateUtils';
import { find, firstIndex } from 'vs/base/common/arrays';
import { INotebookService } from 'sql/workbench/services/notebook/browser/notebookService';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { CellContext } from 'sql/workbench/contrib/notebook/browser/cellViews/codeActions';
@@ -323,10 +322,10 @@ export class KernelsDropdown extends SelectBox {
if (kernels) {
let index;
if (standardKernel) {
index = firstIndex(kernels, kernel => kernel === standardKernel.displayName);
index = kernels.findIndex(kernel => kernel === standardKernel.displayName);
} else {
let kernelSpec = this.model.specs.kernels.find(k => k.name === kernel.name);
index = firstIndex(kernels, k => k === kernelSpec?.display_name);
index = kernels.findIndex(k => k === kernelSpec?.display_name);
}
if (nbKernelAlias) {
index = kernels.indexOf(nbKernelAlias);
@@ -407,7 +406,7 @@ export class AttachToDropdown extends SelectBox {
let kernelDisplayName: string;
if (this.model.clientSession && this.model.clientSession.kernel && this.model.clientSession.kernel.name) {
let currentKernelName = this.model.clientSession.kernel.name.toLowerCase();
let currentKernelSpec = find(this.model.specs.kernels, kernel => kernel.name && kernel.name.toLowerCase() === currentKernelName);
let currentKernelSpec = this.model.specs.kernels.find(kernel => kernel.name && kernel.name.toLowerCase() === currentKernelName);
if (currentKernelSpec) {
//KernelDisplayName should be Kusto when connecting to Kusto connection
if ((this.model.context?.serverCapabilities.notebookKernelAlias && this.model.currentKernelAlias === this.model.context?.serverCapabilities.notebookKernelAlias) || (this.model.kernelAliases.includes(this.model.selectedKernelDisplayName) && this.model.selectedKernelDisplayName)) {
@@ -427,7 +426,7 @@ export class AttachToDropdown extends SelectBox {
this.setOptions([msgLocalHost]);
} else {
let connections: string[] = model.context && model.context.title && (connProviderIds.includes(this.model.context.providerName)) ? [model.context.title] : [msgSelectConnection];
if (!find(connections, x => x === msgChangeConnection)) {
if (!connections.find(x => x === msgChangeConnection)) {
connections.push(msgChangeConnection);
}
this.setOptions(connections, 0);
@@ -497,7 +496,7 @@ export class AttachToDropdown extends SelectBox {
//To ignore n/a after we have at least one valid connection
attachToConnections = attachToConnections.filter(val => val !== msgSelectConnection);
let index = firstIndex(attachToConnections, connection => connection === connectedServer);
let index = attachToConnections.findIndex(connection => connection === connectedServer);
this.setOptions([]);
this.setOptions(attachToConnections);
if (!index || index < 0 || index >= attachToConnections.length) {