mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-27 17:23:21 -05:00
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:
@@ -20,7 +20,6 @@ import { IDashboardService } from 'sql/platform/dashboard/browser/dashboardServi
|
||||
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { IColorTheme } from 'vs/platform/theme/common/themeService';
|
||||
import { attachButtonStyler } from 'sql/platform/theme/common/styler';
|
||||
import { find } from 'vs/base/common/arrays';
|
||||
import { RowDetailView, ExtendedItem } from 'sql/base/browser/ui/table/plugins/rowDetailView';
|
||||
import {
|
||||
IAssessmentComponent,
|
||||
@@ -478,13 +477,13 @@ export class AsmtResultsViewComponent extends TabChild implements IAssessmentCom
|
||||
let filterValues = col.filterValues;
|
||||
if (filterValues && filterValues.length > 0) {
|
||||
if (item._parent) {
|
||||
value = value && find(filterValues, x => x === item._parent[col.field]);
|
||||
value = value && filterValues.find(x => x === item._parent[col.field]);
|
||||
} else {
|
||||
let colValue = item[col.field];
|
||||
if (colValue instanceof Array) {
|
||||
value = value && find(filterValues, x => colValue.indexOf(x) >= 0);
|
||||
value = value && filterValues.find(x => colValue.indexOf(x) >= 0);
|
||||
} else {
|
||||
value = value && find(filterValues, x => x === colValue);
|
||||
value = value && filterValues.find(x => x === colValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ import { ConnectionProfileGroup } from 'sql/platform/connection/common/connectio
|
||||
import { equalsIgnoreCase } from 'vs/base/common/strings';
|
||||
import { IConnectionManagementService, IConnectionCompletionOptions, ConnectionType, RunQueryOnConnectionMode } from 'sql/platform/connection/common/connectionManagement';
|
||||
import { ICapabilitiesService } from 'sql/platform/capabilities/common/capabilitiesService';
|
||||
import { ParsedArgs } from 'vs/platform/environment/node/argv';
|
||||
import * as Constants from 'sql/platform/connection/common/constants';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { ICommandService } from 'vs/platform/commands/common/commands';
|
||||
@@ -28,9 +27,8 @@ import { openNewQuery } from 'sql/workbench/contrib/query/browser/queryActions';
|
||||
import { IURLService, IURLHandler } from 'vs/platform/url/common/url';
|
||||
import { getErrorMessage } from 'vs/base/common/errors';
|
||||
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
|
||||
import { find } from 'vs/base/common/arrays';
|
||||
import { INativeEnvironmentService } from 'vs/platform/environment/node/environmentService';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { IEnvironmentService, INativeEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { NativeParsedArgs } from 'vs/platform/environment/common/argv';
|
||||
|
||||
export interface SqlArgs {
|
||||
_?: string[];
|
||||
@@ -79,7 +77,7 @@ export class CommandLineWorkbenchContribution implements IWorkbenchContribution,
|
||||
@IDialogService private readonly dialogService: IDialogService
|
||||
) {
|
||||
if (ipc) {
|
||||
ipc.on('ads:processCommandLine', (event: any, args: ParsedArgs) => this.onLaunched(args));
|
||||
ipc.on('ads:processCommandLine', (event: any, args: NativeParsedArgs) => this.onLaunched(args));
|
||||
}
|
||||
// we only get the ipc from main during window reuse
|
||||
if (environmentService) {
|
||||
@@ -90,7 +88,7 @@ export class CommandLineWorkbenchContribution implements IWorkbenchContribution,
|
||||
}
|
||||
}
|
||||
|
||||
private onLaunched(args: ParsedArgs) {
|
||||
private onLaunched(args: NativeParsedArgs) {
|
||||
let sqlProvider = this._capabilitiesService.getCapabilities(Constants.mssqlProviderName);
|
||||
// We can't connect to object explorer until the MSSQL connection provider is registered
|
||||
if (sqlProvider) {
|
||||
@@ -310,7 +308,7 @@ export class CommandLineWorkbenchContribution implements IWorkbenchContribution,
|
||||
if (groups && groups.length > 0) {
|
||||
let rootGroup = groups[0];
|
||||
let connections = ConnectionProfileGroup.getConnectionsInGroup(rootGroup);
|
||||
match = find(connections, (c) => this.matchProfile(profile, c));
|
||||
match = connections.find((c) => this.matchProfile(profile, c));
|
||||
}
|
||||
return match ? match : profile;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ import { ConnectionProfile } from 'sql/platform/connection/common/connectionProf
|
||||
import { ConnectionProfileGroup } from 'sql/platform/connection/common/connectionProfileGroup';
|
||||
import { CommandLineWorkbenchContribution, SqlArgs } from 'sql/workbench/contrib/commandLine/electron-browser/commandLine';
|
||||
import * as Constants from 'sql/platform/connection/common/constants';
|
||||
import { ParsedArgs } from 'vs/platform/environment/node/argv';
|
||||
import { ICapabilitiesService } from 'sql/platform/capabilities/common/capabilitiesService';
|
||||
import { TestCapabilitiesService } from 'sql/platform/capabilities/test/common/testCapabilitiesService';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
@@ -34,8 +33,9 @@ import { isUndefinedOrNull } from 'vs/base/common/types';
|
||||
import { FileEditorInput } from 'vs/workbench/contrib/files/common/editors/fileEditorInput';
|
||||
import { FileQueryEditorInput } from 'sql/workbench/contrib/query/common/fileQueryEditorInput';
|
||||
import { TestDialogService } from 'vs/platform/dialogs/test/common/testDialogService';
|
||||
import { NativeParsedArgs } from 'vs/platform/environment/common/argv';
|
||||
|
||||
class TestParsedArgs implements ParsedArgs, SqlArgs {
|
||||
class TestParsedArgs implements NativeParsedArgs, SqlArgs {
|
||||
[arg: string]: any;
|
||||
_: string[];
|
||||
database?: string;
|
||||
|
||||
@@ -13,7 +13,6 @@ import { WIDGETS_CONTAINER, validateWidgetContainerContribution } from 'sql/work
|
||||
import { GRID_CONTAINER, validateGridContainerContribution } from 'sql/workbench/contrib/dashboard/browser/containers/dashboardGridContainer.contribution';
|
||||
import { WEBVIEW_CONTAINER } from 'sql/workbench/contrib/dashboard/browser/containers/dashboardWebviewContainer.contribution';
|
||||
import { values } from 'vs/base/common/collections';
|
||||
import { find } from 'vs/base/common/arrays';
|
||||
import { NavSectionConfig } from 'sql/workbench/contrib/dashboard/browser/core/dashboardWidget';
|
||||
|
||||
const containerTypes = [
|
||||
@@ -78,7 +77,7 @@ ExtensionsRegistry.registerExtensionPoint<IDashboardContainerContrib | IDashboar
|
||||
const containerkey = Object.keys(container)[0];
|
||||
const containerValue = values(container)[0];
|
||||
|
||||
const containerTypeFound = find(containerTypes, c => c === containerkey);
|
||||
const containerTypeFound = containerTypes.find(c => c === containerkey);
|
||||
if (!containerTypeFound) {
|
||||
extension.collector.error(localize('dashboardTab.contribution.unKnownContainerType', "Unknown container type defines in dashboard container for extension."));
|
||||
return;
|
||||
|
||||
@@ -9,7 +9,6 @@ import * as nls from 'vs/nls';
|
||||
|
||||
import { generateDashboardGridLayoutSchema } from 'sql/workbench/contrib/dashboard/browser/pages/dashboardPageContribution';
|
||||
import { registerContainerType, registerNavSectionContainerType } from 'sql/platform/dashboard/common/dashboardContainerRegistry';
|
||||
import { find } from 'vs/base/common/arrays';
|
||||
|
||||
export const GRID_CONTAINER = 'grid-container';
|
||||
|
||||
@@ -26,7 +25,7 @@ export function validateGridContainerContribution(extension: IExtensionPointUser
|
||||
let result = true;
|
||||
gridConfigs.forEach(widgetConfig => {
|
||||
const allKeys = Object.keys(widgetConfig);
|
||||
const widgetOrWebviewKey = find(allKeys, key => key === 'widget' || key === 'webview');
|
||||
const widgetOrWebviewKey = allKeys.find(key => key === 'widget' || key === 'webview');
|
||||
if (!widgetOrWebviewKey) {
|
||||
result = false;
|
||||
extension.collector.error(nls.localize('gridContainer.invalidInputs', "widgets or webviews are expected inside widgets-container for extension."));
|
||||
|
||||
@@ -19,7 +19,6 @@ import * as dashboardHelper from 'sql/workbench/contrib/dashboard/browser/core/d
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { find } from 'vs/base/common/arrays';
|
||||
import { values } from 'vs/base/common/collections';
|
||||
|
||||
@Component({
|
||||
@@ -129,7 +128,7 @@ export class DashboardNavSection extends DashboardTab implements OnDestroy, OnCh
|
||||
}
|
||||
|
||||
private addNewTab(tab: TabConfig): void {
|
||||
const existedTab = find(this.tabs, i => i.id === tab.id);
|
||||
const existedTab = this.tabs.find(i => i.id === tab.id);
|
||||
if (!existedTab) {
|
||||
this.tabs.push(tab);
|
||||
this._cd.detectChanges();
|
||||
|
||||
@@ -9,7 +9,6 @@ import * as nls from 'vs/nls';
|
||||
|
||||
import { generateDashboardWidgetSchema } from 'sql/workbench/contrib/dashboard/browser/pages/dashboardPageContribution';
|
||||
import { registerContainerType, registerNavSectionContainerType } from 'sql/platform/dashboard/common/dashboardContainerRegistry';
|
||||
import { find } from 'vs/base/common/arrays';
|
||||
|
||||
export const WIDGETS_CONTAINER = 'widgets-container';
|
||||
|
||||
@@ -26,7 +25,7 @@ export function validateWidgetContainerContribution(extension: IExtensionPointUs
|
||||
let result = true;
|
||||
WidgetConfigs.forEach(widgetConfig => {
|
||||
const allKeys = Object.keys(widgetConfig);
|
||||
const widgetKey = find(allKeys, key => key === 'widget');
|
||||
const widgetKey = allKeys.find(key => key === 'widget');
|
||||
if (!widgetKey) {
|
||||
result = false;
|
||||
extension.collector.error(nls.localize('widgetContainer.invalidInputs', "The list of widgets is expected inside widgets-container for extension."));
|
||||
|
||||
@@ -21,7 +21,6 @@ import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { ScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement';
|
||||
import { ScrollbarVisibility } from 'vs/base/common/scrollable';
|
||||
import { getContentHeight, addDisposableListener, EventType } from 'vs/base/browser/dom';
|
||||
import { find, firstIndex } from 'vs/base/common/arrays';
|
||||
|
||||
/**
|
||||
* Sorting function for dashboard widgets
|
||||
@@ -209,10 +208,10 @@ export class WidgetContent extends AngularDisposable implements AfterViewInit {
|
||||
this._grid.enableResize();
|
||||
this._grid.enableDrag();
|
||||
this._editDispose.push(this.dashboardService.onDeleteWidget(e => {
|
||||
let index = firstIndex(this.widgets, i => i.id === e);
|
||||
let index = this.widgets.findIndex(i => i.id === e);
|
||||
this.widgets.splice(index, 1);
|
||||
|
||||
index = firstIndex(this.originalConfig, i => i.id === e);
|
||||
index = this.originalConfig.findIndex(i => i.id === e);
|
||||
this.originalConfig.splice(index, 1);
|
||||
|
||||
this._rewriteConfig();
|
||||
@@ -221,7 +220,7 @@ export class WidgetContent extends AngularDisposable implements AfterViewInit {
|
||||
this._editDispose.push(subscriptionToDisposable(this._grid.onResizeStop.subscribe((e: NgGridItem) => {
|
||||
this._onResize.fire();
|
||||
const event = e.getEventOutput();
|
||||
const config = find(this.originalConfig, i => i.id === event.payload.id);
|
||||
const config = this.originalConfig.find(i => i.id === event.payload.id);
|
||||
|
||||
if (!config.gridItemConfig) {
|
||||
config.gridItemConfig = {};
|
||||
@@ -239,7 +238,7 @@ export class WidgetContent extends AngularDisposable implements AfterViewInit {
|
||||
this._onResize.fire();
|
||||
const event = e.getEventOutput();
|
||||
this._items.forEach(i => {
|
||||
const config = find(this.originalConfig, j => j.id === i.getEventOutput().payload.id);
|
||||
const config = this.originalConfig.find(j => j.id === i.getEventOutput().payload.id);
|
||||
if ((config.gridItemConfig && config.gridItemConfig.col) || config.id === event.payload.id) {
|
||||
if (!config.gridItemConfig) {
|
||||
config.gridItemConfig = {};
|
||||
|
||||
@@ -11,7 +11,6 @@ import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
import { IAngularEventingService, AngularEventType, IAngularEvent } from 'sql/platform/angularEventing/browser/angularEventingService';
|
||||
import { INewDashboardTabDialogService } from 'sql/workbench/services/dashboard/browser/newDashboardTabDialog';
|
||||
import { IDashboardTab } from 'sql/workbench/services/dashboard/browser/common/interfaces';
|
||||
import { find, firstIndex } from 'vs/base/common/arrays';
|
||||
import { CellContext } from 'sql/workbench/contrib/notebook/browser/cellViews/codeActions';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
@@ -202,14 +201,14 @@ export class AddFeatureTabAction extends Action {
|
||||
case AngularEventType.NEW_TABS:
|
||||
const openedTabs = <IDashboardTab[]>event.payload.dashboardTabs;
|
||||
openedTabs.forEach(tab => {
|
||||
const existedTab = find(this._openedTabs, i => i === tab);
|
||||
const existedTab = this._openedTabs.find(i => i === tab);
|
||||
if (!existedTab) {
|
||||
this._openedTabs.push(tab);
|
||||
}
|
||||
});
|
||||
break;
|
||||
case AngularEventType.CLOSE_TAB:
|
||||
const index = firstIndex(this._openedTabs, i => i.id === event.payload.id);
|
||||
const index = this._openedTabs.findIndex(i => i.id === event.payload.id);
|
||||
this._openedTabs.splice(index, 1);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ import { IDashboardContainerRegistry, Extensions as DashboardContainerExtensions
|
||||
import { SingleConnectionManagementService } from 'sql/workbench/services/bootstrap/browser/commonServiceInterface.service';
|
||||
import * as Constants from 'sql/platform/connection/common/constants';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { find } from 'vs/base/common/arrays';
|
||||
|
||||
const dashboardcontainerRegistry = Registry.as<IDashboardContainerRegistry>(DashboardContainerExtensions.dashboardContainerContributions);
|
||||
const containerTypes = [
|
||||
@@ -163,7 +162,7 @@ function hasCompatibleProvider(provider: string | string[], contextKeyService: I
|
||||
const connectionProvider = contextKeyService.getContextKeyValue<string>(Constants.connectionProviderContextKey);
|
||||
if (connectionProvider) {
|
||||
const providers = (provider instanceof Array) ? provider : [provider];
|
||||
const matchingProvider = find(providers, (p) => p === connectionProvider || p === Constants.anyProviderName);
|
||||
const matchingProvider = providers.find((p) => p === connectionProvider || p === Constants.anyProviderName);
|
||||
isCompatible = (matchingProvider !== undefined);
|
||||
} // Else there's no connection context so skip the check
|
||||
return isCompatible;
|
||||
@@ -175,7 +174,7 @@ function hasCompatibleProvider(provider: string | string[], contextKeyService: I
|
||||
*/
|
||||
export function getDashboardContainer(container: object, logService: ILogService): { result: boolean, message: string, container: { [key: string]: any } } {
|
||||
const key = Object.keys(container)[0];
|
||||
const containerTypeFound = find(containerTypes, c => (c === key));
|
||||
const containerTypeFound = containerTypes.find(c => (c === key));
|
||||
if (!containerTypeFound) {
|
||||
const dashboardContainer = dashboardcontainerRegistry.getRegisteredContainer(key);
|
||||
if (!dashboardContainer) {
|
||||
|
||||
@@ -36,7 +36,6 @@ import Severity from 'vs/base/common/severity';
|
||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
import { IContextKeyService, ContextKeyExpr, RawContextKey, IContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { firstIndex, find } from 'vs/base/common/arrays';
|
||||
import { values } from 'vs/base/common/collections';
|
||||
import { RefreshWidgetAction, ToolbarAction } from 'sql/workbench/contrib/dashboard/browser/core/actions';
|
||||
import { Taskbar, ITaskbarContent } from 'sql/base/browser/ui/taskbar/taskbar';
|
||||
@@ -187,7 +186,7 @@ export abstract class DashboardPage extends AngularDisposable implements IConfig
|
||||
primary.forEach(a => {
|
||||
if (a instanceof MenuItemAction) {
|
||||
// Need to ensure that we don't add the same action multiple times
|
||||
let foundIndex = firstIndex(tasks, act => act.action && act.action.id === a.id);
|
||||
let foundIndex = tasks.findIndex(act => act.action && act.action.id === a.id);
|
||||
if (foundIndex < 0) {
|
||||
tasks.push({ action: a });
|
||||
}
|
||||
@@ -318,7 +317,7 @@ export abstract class DashboardPage extends AngularDisposable implements IConfig
|
||||
this._cd.detectChanges();
|
||||
|
||||
this._tabsDispose.push(this.dashboardService.onPinUnpinTab(e => {
|
||||
const tabConfig = find(this._tabSettingConfigs, i => i.tabId === e.tabId);
|
||||
const tabConfig = this._tabSettingConfigs.find(i => i.tabId === e.tabId);
|
||||
if (tabConfig) {
|
||||
tabConfig.isPinned = e.isPinned;
|
||||
} else {
|
||||
@@ -395,7 +394,7 @@ export abstract class DashboardPage extends AngularDisposable implements IConfig
|
||||
iconClass: 'home-tab-icon'
|
||||
};
|
||||
|
||||
const homeTabIndex = firstIndex(allTabs, (tab) => tab.isHomeTab === true);
|
||||
const homeTabIndex = allTabs.findIndex(tab => tab.isHomeTab === true);
|
||||
if (homeTabIndex !== undefined && homeTabIndex > -1) {
|
||||
// Have a tab: get its information and copy over to the home tab definition
|
||||
const homeTab = allTabs.splice(homeTabIndex, 1)[0];
|
||||
@@ -491,7 +490,7 @@ export abstract class DashboardPage extends AngularDisposable implements IConfig
|
||||
}
|
||||
|
||||
private addNewTab(tab: TabConfig): void {
|
||||
const existedTab = find(this.tabs, i => i.id === tab.id);
|
||||
const existedTab = this.tabs.find(i => i.id === tab.id);
|
||||
if (!existedTab) {
|
||||
if (!tab.iconClass && tab.type !== 'group-header') {
|
||||
tab.iconClass = 'default-tab-icon';
|
||||
@@ -553,7 +552,7 @@ export abstract class DashboardPage extends AngularDisposable implements IConfig
|
||||
}
|
||||
|
||||
public handleTabClose(tab: TabComponent): void {
|
||||
const index = firstIndex(this.tabs, i => i.id === tab.identifier);
|
||||
const index = this.tabs.findIndex(i => i.id === tab.identifier);
|
||||
this.tabs.splice(index, 1);
|
||||
this.angularEventingService.sendAngularEvent(this.dashboardService.getUnderlyingUri(), AngularEventType.CLOSE_TAB, { id: tab.identifier });
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ import { IExtensionPointUser, ExtensionsRegistry } from 'vs/workbench/services/e
|
||||
import { DATABASE_DASHBOARD_TABS } from 'sql/workbench/contrib/dashboard/browser/pages/databaseDashboardPage.contribution';
|
||||
import { SERVER_DASHBOARD_TABS } from 'sql/workbench/contrib/dashboard/browser/pages/serverDashboardPage.contribution';
|
||||
import { DASHBOARD_CONFIG_ID, DASHBOARD_TABS_KEY_PROPERTY } from 'sql/workbench/contrib/dashboard/browser/pages/dashboardPageContribution';
|
||||
import { find } from 'vs/base/common/arrays';
|
||||
import { IDashboardTab, IDashboardTabGroup } from 'sql/workbench/services/dashboard/browser/common/interfaces';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
@@ -169,7 +168,7 @@ class DashboardRegistry implements IDashboardRegistry {
|
||||
|
||||
public registerTab(tab: IDashboardTab): void {
|
||||
this._tabs.push(tab);
|
||||
let dashboardConfig = find(this._configurationRegistry.getConfigurations(), c => c.id === DASHBOARD_CONFIG_ID);
|
||||
let dashboardConfig = this._configurationRegistry.getConfigurations().find(c => c.id === DASHBOARD_CONFIG_ID);
|
||||
|
||||
if (dashboardConfig) {
|
||||
let dashboardDatabaseTabProperty = (<IJSONSchema>dashboardConfig.properties[DATABASE_DASHBOARD_TABS].items).properties[DASHBOARD_TABS_KEY_PROPERTY];
|
||||
|
||||
@@ -16,7 +16,6 @@ import { INotificationService } from 'vs/platform/notification/common/notificati
|
||||
import Severity from 'vs/base/common/severity';
|
||||
import { attachSelectBoxStyler } from 'vs/platform/theme/common/styler';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { firstIndex } from 'vs/base/common/arrays';
|
||||
const $ = dom.$;
|
||||
|
||||
/**
|
||||
@@ -196,7 +195,7 @@ export class ChangeMaxRowsActionItem extends Disposable implements IActionViewIt
|
||||
}
|
||||
|
||||
public set setCurrentOptionIndex(selection: number) {
|
||||
this._currentOptionsIndex = firstIndex(this._options, x => x === selection.toString());
|
||||
this._currentOptionsIndex = this._options.findIndex(x => x === selection.toString());
|
||||
this._refreshOptions();
|
||||
}
|
||||
|
||||
@@ -214,7 +213,7 @@ export class ChangeMaxRowsActionItem extends Disposable implements IActionViewIt
|
||||
|
||||
private _registerListeners(): void {
|
||||
this._register(this.selectBox.onDidSelect(selection => {
|
||||
this._currentOptionsIndex = firstIndex(this._options, x => x === selection.selected);
|
||||
this._currentOptionsIndex = this._options.findIndex(x => x === selection.selected);
|
||||
this._editor.editDataInput.onRowDropDownSet(Number(selection.selected));
|
||||
}));
|
||||
this._register(attachSelectBoxStyler(this.selectBox, this._themeService));
|
||||
|
||||
@@ -33,7 +33,6 @@ import { IDashboardService } from 'sql/platform/dashboard/browser/dashboardServi
|
||||
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
|
||||
import { find } from 'vs/base/common/arrays';
|
||||
|
||||
export const DASHBOARD_SELECTOR: string = 'jobhistory-component';
|
||||
|
||||
@@ -199,10 +198,10 @@ export class JobHistoryComponent extends JobManagementView implements OnInit {
|
||||
const self = this;
|
||||
let cachedHistory = self._jobCacheObject.getJobHistory(element.jobID);
|
||||
if (cachedHistory) {
|
||||
self.agentJobHistoryInfo = find(cachedHistory,
|
||||
self.agentJobHistoryInfo = cachedHistory.find(
|
||||
history => self.formatTime(history.runDate) === self.formatTime(element.runDate));
|
||||
} else {
|
||||
self.agentJobHistoryInfo = find(self._treeController.jobHistories,
|
||||
self.agentJobHistoryInfo = self._treeController.jobHistories.find(
|
||||
history => self.formatTime(history.runDate) === self.formatTime(element.runDate));
|
||||
}
|
||||
if (self.agentJobHistoryInfo) {
|
||||
|
||||
@@ -32,7 +32,6 @@ import { tableBackground, cellBackground, cellBorderColor } from 'sql/platform/t
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
|
||||
import { attachButtonStyler } from 'sql/platform/theme/common/styler';
|
||||
import { find } from 'vs/base/common/arrays';
|
||||
import { IColorTheme } from 'vs/platform/theme/common/themeService';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
|
||||
@@ -311,7 +310,7 @@ export class JobsViewComponent extends JobManagementView implements OnInit, OnDe
|
||||
this._table.grid.removeCellCssStyles('error-row' + i.toString());
|
||||
let item = this.dataView.getItemByIdx(i);
|
||||
// current filter
|
||||
if (find(filterValues, x => x === item[args.column.field])) {
|
||||
if (filterValues.find(x => x === item[args.column.field])) {
|
||||
// check all previous filters
|
||||
if (this.checkPreviousFilters(item)) {
|
||||
if (item.lastRunOutcome === 'Failed') {
|
||||
@@ -563,7 +562,9 @@ export class JobsViewComponent extends JobManagementView implements OnInit, OnDe
|
||||
private checkPreviousFilters(item): boolean {
|
||||
for (let column in this.filterValueMap) {
|
||||
if (column !== 'start' && this.filterValueMap[column][0].length > 0) {
|
||||
if (!find(this.filterValueMap[column][0], x => x === item[JobManagementUtilities.convertColNameToField(column)])) {
|
||||
let temp = this.filterValueMap[column][0] as unknown;
|
||||
let arr = temp as [];
|
||||
if (!arr.find(x => x === item[JobManagementUtilities.convertColNameToField(column)])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -705,9 +706,9 @@ export class JobsViewComponent extends JobManagementView implements OnInit, OnDe
|
||||
let filterValues = col.filterValues;
|
||||
if (filterValues && filterValues.length > 0) {
|
||||
if (item._parent) {
|
||||
value = value && find(filterValues, x => x === item._parent[col.field]);
|
||||
value = value && filterValues.find(x => x === item._parent[col.field]);
|
||||
} else {
|
||||
value = value && find(filterValues, x => x === item[col.field]);
|
||||
value = value && filterValues.find(x => x === item[col.field]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
|
||||
import { attachButtonStyler } from 'sql/platform/theme/common/styler';
|
||||
import { Taskbar } from 'sql/base/browser/ui/taskbar/taskbar';
|
||||
import { find } from 'vs/base/common/arrays';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { IColorTheme } from 'vs/platform/theme/common/themeService';
|
||||
|
||||
@@ -319,7 +318,7 @@ export class NotebooksViewComponent extends JobManagementView implements OnInit,
|
||||
this._table.grid.removeCellCssStyles('notebook-error-row' + i.toString());
|
||||
let item = this.dataView.getItemByIdx(i);
|
||||
// current filter
|
||||
if (!!find(filterValues, x => x === item[args.column.field])) {
|
||||
if (!!filterValues.find(x => x === item[args.column.field])) {
|
||||
// check all previous filters
|
||||
if (this.checkPreviousFilters(item)) {
|
||||
if (item.lastRunOutcome === 'Failed') {
|
||||
@@ -612,7 +611,9 @@ export class NotebooksViewComponent extends JobManagementView implements OnInit,
|
||||
private checkPreviousFilters(item): boolean {
|
||||
for (let column in this.filterValueMap) {
|
||||
if (column !== 'start' && this.filterValueMap[column][0].length > 0) {
|
||||
if (!find(this.filterValueMap[column][0], x => x === item[JobManagementUtilities.convertColNameToField(column)])) {
|
||||
let temp = this.filterValueMap[column][0] as unknown;
|
||||
let arr = temp as [];
|
||||
if (!arr.find(x => x === item[JobManagementUtilities.convertColNameToField(column)])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -771,9 +772,9 @@ export class NotebooksViewComponent extends JobManagementView implements OnInit,
|
||||
let filterValues = col.filterValues;
|
||||
if (filterValues && filterValues.length > 0) {
|
||||
if (item._parent) {
|
||||
value = value && find(filterValues, x => x === item._parent[col.field]);
|
||||
value = value && filterValues.find(x => x === item._parent[col.field]);
|
||||
} else {
|
||||
value = value && find(filterValues, x => x === item[col.field]);
|
||||
value = value && filterValues.find(x => x === item[col.field]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -33,7 +33,7 @@ import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegis
|
||||
import { CommonFindController, FindStartFocusAction } from 'vs/editor/contrib/find/findController';
|
||||
import * as types from 'vs/base/common/types';
|
||||
import { attachSelectBoxStyler } from 'vs/platform/theme/common/styler';
|
||||
import { DARK, HIGH_CONTRAST } from 'vs/platform/theme/common/themeService';
|
||||
import { ColorScheme } from 'vs/platform/theme/common/theme';
|
||||
import { CancellationToken } from 'vs/base/common/cancellation';
|
||||
import { IStorageService } from 'vs/platform/storage/common/storage';
|
||||
import { IView, SplitView, Sizing } from 'vs/base/browser/ui/splitview/splitview';
|
||||
@@ -50,7 +50,6 @@ import { IClipboardService } from 'sql/platform/clipboard/common/clipboardServic
|
||||
import { CellSelectionModel } from 'sql/base/browser/ui/table/plugins/cellSelectionModel.plugin';
|
||||
import { handleCopyRequest } from 'sql/workbench/contrib/profiler/browser/profilerCopyHandler';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfigurationService';
|
||||
import { find } from 'vs/base/common/arrays';
|
||||
import { UntitledTextEditorInput } from 'vs/workbench/services/untitled/common/untitledTextEditorInput';
|
||||
import { attachTabbedPanelStyler } from 'sql/workbench/common/styler';
|
||||
import { UntitledTextEditorModel } from 'vs/workbench/services/untitled/common/untitledTextEditorModel';
|
||||
@@ -239,7 +238,7 @@ export class ProfilerEditor extends EditorPane {
|
||||
this._viewTemplateSelector.setAriaLabel(nls.localize('profiler.viewSelectAccessibleName', "Select View"));
|
||||
this._register(this._viewTemplateSelector.onDidSelect(e => {
|
||||
if (this.input) {
|
||||
this.input.setViewTemplate(find(this._viewTemplates, i => i.name === e.selected));
|
||||
this.input.setViewTemplate(this._viewTemplates.find(i => i.name === e.selected));
|
||||
}
|
||||
}));
|
||||
let viewTemplateContainer = document.createElement('div');
|
||||
@@ -301,16 +300,16 @@ export class ProfilerEditor extends EditorPane {
|
||||
profilerTableContainer.style.overflow = 'hidden';
|
||||
profilerTableContainer.style.position = 'relative';
|
||||
let theme = this.themeService.getColorTheme();
|
||||
if (theme.type === DARK) {
|
||||
if (theme.type === ColorScheme.DARK) {
|
||||
DOM.addClass(profilerTableContainer, VS_DARK_THEME);
|
||||
} else if (theme.type === HIGH_CONTRAST) {
|
||||
} else if (theme.type === ColorScheme.HIGH_CONTRAST) {
|
||||
DOM.addClass(profilerTableContainer, VS_HC_THEME);
|
||||
}
|
||||
this.themeService.onDidColorThemeChange(e => {
|
||||
DOM.removeClasses(profilerTableContainer, VS_DARK_THEME, VS_HC_THEME);
|
||||
if (e.type === DARK) {
|
||||
if (e.type === ColorScheme.DARK) {
|
||||
DOM.addClass(profilerTableContainer, VS_DARK_THEME);
|
||||
} else if (e.type === HIGH_CONTRAST) {
|
||||
} else if (e.type === ColorScheme.HIGH_CONTRAST) {
|
||||
DOM.addClass(profilerTableContainer, VS_HC_THEME);
|
||||
}
|
||||
});
|
||||
@@ -466,7 +465,7 @@ export class ProfilerEditor extends EditorPane {
|
||||
if (input.viewTemplate) {
|
||||
this._viewTemplateSelector.selectWithOptionName(input.viewTemplate.name);
|
||||
} else {
|
||||
input.setViewTemplate(find(this._viewTemplates, i => i.name === 'Standard View'));
|
||||
input.setViewTemplate(this._viewTemplates.find(i => i.name === 'Standard View'));
|
||||
}
|
||||
|
||||
this._actionBar.context = input;
|
||||
|
||||
@@ -29,7 +29,7 @@ import { Emitter, Event } from 'vs/base/common/event';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { isUndefinedOrNull } from 'vs/base/common/types';
|
||||
import { Disposable, dispose, DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import { range, find } from 'vs/base/common/arrays';
|
||||
import { range } from 'vs/base/common/arrays';
|
||||
import { generateUuid } from 'vs/base/common/uuid';
|
||||
import { ActionBar, ActionsOrientation } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import { isInDOM, Dimension } from 'vs/base/browser/dom';
|
||||
@@ -182,7 +182,7 @@ export class GridPanel extends Disposable {
|
||||
|
||||
if (this.configurationService.getValue<IQueryEditorConfiguration>('queryEditor').results.streaming) {
|
||||
for (let set of resultsToUpdate) {
|
||||
let table = find(this.tables, t => t.resultSet.batchId === set.batchId && t.resultSet.id === set.id);
|
||||
let table = this.tables.find(t => t.resultSet.batchId === set.batchId && t.resultSet.id === set.id);
|
||||
if (table) {
|
||||
table.updateResult(set);
|
||||
} else {
|
||||
@@ -204,12 +204,12 @@ export class GridPanel extends Disposable {
|
||||
|
||||
for (const set of resultSet) {
|
||||
// ensure we aren't adding a resultSet that is already visible
|
||||
if (find(this.tables, t => t.resultSet.batchId === set.batchId && t.resultSet.id === set.id)) {
|
||||
if (this.tables.find(t => t.resultSet.batchId === set.batchId && t.resultSet.id === set.id)) {
|
||||
continue;
|
||||
}
|
||||
let tableState: GridTableState;
|
||||
if (this.state) {
|
||||
tableState = find(this.state.tableStates, e => e.batchId === set.batchId && e.resultId === set.id);
|
||||
tableState = this.state.tableStates.find(e => e.batchId === set.batchId && e.resultId === set.id);
|
||||
}
|
||||
if (!tableState) {
|
||||
tableState = new GridTableState(set.id, set.batchId);
|
||||
@@ -263,7 +263,7 @@ export class GridPanel extends Disposable {
|
||||
}
|
||||
|
||||
private maximizeTable(tableid: string): void {
|
||||
if (!find(this.tables, t => t.id === tableid)) {
|
||||
if (!this.tables.find(t => t.id === tableid)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -292,7 +292,7 @@ export class GridPanel extends Disposable {
|
||||
this._state = val;
|
||||
if (this.state) {
|
||||
this.tables.map(t => {
|
||||
let state = find(this.state.tableStates, s => s.batchId === t.resultSet.batchId && s.resultId === t.resultSet.id);
|
||||
let state = this.state.tableStates.find(s => s.batchId === t.resultSet.batchId && s.resultId === t.resultSet.id);
|
||||
if (!state) {
|
||||
this.state.tableStates.push(t.state);
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@ import { EditDataEditor } from 'sql/workbench/contrib/editData/browser/editDataE
|
||||
import { INotificationService, Severity } from 'vs/platform/notification/common/notification';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { QueryEditorInput } from 'sql/workbench/common/editor/query/queryEditorInput';
|
||||
import { firstIndex } from 'vs/base/common/arrays';
|
||||
|
||||
const singleQuote = '\'';
|
||||
|
||||
@@ -369,7 +368,7 @@ export class RunQueryShortcutAction extends Action {
|
||||
}
|
||||
|
||||
private getColumnIndex(columnInfo: azdata.IDbColumn[], columnName: string): number {
|
||||
return columnInfo ? firstIndex(columnInfo, c => c.columnName === columnName) : undefined;
|
||||
return columnInfo ? columnInfo.findIndex(c => c.columnName === columnName) : undefined;
|
||||
}
|
||||
|
||||
private canQueryProcMetadata(editor: QueryEditor): boolean {
|
||||
|
||||
@@ -23,7 +23,7 @@ import { ResourceLabels, IResourceLabel } from 'vs/workbench/browser/labels';
|
||||
import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { dirname, basename } from 'vs/base/common/resources';
|
||||
import { LIGHT, FileThemeIcon, FolderThemeIcon, registerThemingParticipant, ThemeIcon, IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { FileThemeIcon, FolderThemeIcon, registerThemingParticipant, ThemeIcon, IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { FileKind } from 'vs/platform/files/common/files';
|
||||
import { WorkbenchAsyncDataTree } from 'vs/platform/list/browser/listService';
|
||||
import { localize } from 'vs/nls';
|
||||
@@ -37,12 +37,12 @@ import { FuzzyScore, createMatches } from 'vs/base/common/filters';
|
||||
import { CollapseAllAction } from 'vs/base/browser/ui/tree/treeDefaults';
|
||||
import { isFalsyOrWhitespace } from 'vs/base/common/strings';
|
||||
import { SIDE_BAR_BACKGROUND, PANEL_BACKGROUND } from 'vs/workbench/common/theme';
|
||||
import { firstIndex } from 'vs/base/common/arrays';
|
||||
import { ITreeItem, ITreeView } from 'sql/workbench/common/views';
|
||||
import { UserCancelledConnectionError } from 'sql/base/common/errors';
|
||||
import { IOEShimService } from 'sql/workbench/services/objectExplorer/browser/objectExplorerViewTreeShim';
|
||||
import { NodeContextKey } from 'sql/workbench/contrib/views/browser/nodeContext';
|
||||
import { ActionViewItem } from 'vs/base/browser/ui/actionbar/actionViewItems';
|
||||
import { ColorScheme } from 'vs/platform/theme/common/theme';
|
||||
|
||||
class Root implements ITreeItem {
|
||||
label = { label: 'root' };
|
||||
@@ -793,7 +793,7 @@ class TreeRenderer extends Disposable implements ITreeRenderer<ITreeItem, FuzzyS
|
||||
}
|
||||
return ({ start, end });
|
||||
}) : undefined;
|
||||
const icon = this.themeService.getColorTheme().type === LIGHT ? node.icon : node.iconDark;
|
||||
const icon = this.themeService.getColorTheme().type === ColorScheme.LIGHT ? node.icon : node.iconDark;
|
||||
const iconUrl = icon ? URI.revive(icon) : null;
|
||||
const title = node.tooltip ? isString(node.tooltip) ? node.tooltip : undefined : resource ? undefined : label;
|
||||
const sqlIcon = node.sqlIcon;
|
||||
@@ -901,7 +901,7 @@ class Aligner extends Disposable {
|
||||
}
|
||||
|
||||
private hasIcon(node: ITreeItem): boolean {
|
||||
const icon = this.themeService.getColorTheme().type === LIGHT ? node.icon : node.iconDark;
|
||||
const icon = this.themeService.getColorTheme().type === ColorScheme.LIGHT ? node.icon : node.iconDark;
|
||||
if (icon) {
|
||||
return true;
|
||||
}
|
||||
@@ -975,7 +975,7 @@ class TreeMenus extends Disposable implements IDisposable {
|
||||
}
|
||||
|
||||
private mergeActions(actions: IAction[][]): IAction[] {
|
||||
return actions.reduce((p, c) => p.concat(...c.filter(a => firstIndex(p, x => x.id === a.id) === -1)), [] as IAction[]);
|
||||
return actions.reduce((p, c) => p.concat(...c.filter(a => p.findIndex(x => x.id === a.id) === -1)), [] as IAction[]);
|
||||
}
|
||||
|
||||
private getActions(menuId: MenuId, context: { key: string, value?: string }): { primary: IAction[]; secondary: IAction[]; } {
|
||||
|
||||
@@ -85,7 +85,7 @@ export class WelcomePageContribution implements IWorkbenchContribution {
|
||||
try {
|
||||
const folder = await this.fileService.resolve(folderUri);
|
||||
const files = folder.children ? folder.children.map(child => child.name) : [];
|
||||
const file = arrays.find(files.sort(), file => strings.startsWith(file.toLowerCase(), 'readme'));
|
||||
const file = files.sort().find(file => strings.startsWith(file.toLowerCase(), 'readme'));
|
||||
if (file) {
|
||||
return joinPath(folderUri, file);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user