mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
More work around isolating node imports (#6512)
* more work around isolating node imports * rewrite query plan input * fix hygiene errors * fix tests * address feedback * remove welcome page changes
This commit is contained in:
@@ -8,7 +8,7 @@ import { ServicesAccessor, IInstantiationService } from 'vs/platform/instantiati
|
||||
import { IEditorService, ACTIVE_GROUP } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement';
|
||||
import { ProfilerInput } from 'sql/workbench/parts/profiler/browser/profilerInput';
|
||||
import * as TaskUtilities from 'sql/workbench/common/taskUtilities';
|
||||
import * as TaskUtilities from 'sql/workbench/browser/taskUtilities';
|
||||
import { IProfilerService } from 'sql/workbench/services/profiler/common/interfaces';
|
||||
import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
|
||||
import { ProfilerEditor } from 'sql/workbench/parts/profiler/browser/profilerEditor';
|
||||
|
||||
@@ -26,6 +26,7 @@ import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/resourceConfiguration';
|
||||
|
||||
class EventItem {
|
||||
|
||||
@@ -316,9 +317,10 @@ export class ProfilerColumnEditorDialog extends Modal {
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
@IContextViewService private _contextViewService: IContextViewService,
|
||||
@IClipboardService clipboardService: IClipboardService,
|
||||
@ILogService logService: ILogService
|
||||
@ILogService logService: ILogService,
|
||||
@ITextResourcePropertiesService textResourcePropertiesService: ITextResourcePropertiesService
|
||||
) {
|
||||
super(nls.localize('profilerColumnDialog.profiler', "Profiler"), TelemetryKeys.Profiler, telemetryService, layoutService, clipboardService, themeService, logService, contextKeyService);
|
||||
super(nls.localize('profilerColumnDialog.profiler', "Profiler"), TelemetryKeys.Profiler, telemetryService, layoutService, clipboardService, themeService, logService, textResourcePropertiesService, contextKeyService);
|
||||
}
|
||||
|
||||
public render(): void {
|
||||
|
||||
@@ -2,10 +2,12 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import * as os from 'os';
|
||||
import { IClipboardService } from 'sql/platform/clipboard/common/clipboardService';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/resourceConfiguration';
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
|
||||
export function handleCopyRequest(clipboardService: IClipboardService, range: Slick.Range, getCellValue: (row, cell) => string): void {
|
||||
export function handleCopyRequest(clipboardService: IClipboardService, textResourcePropertiesService: ITextResourcePropertiesService, range: Slick.Range, getCellValue: (row, cell) => string): void {
|
||||
if (range) {
|
||||
let results = '';
|
||||
for (let i = range.fromRow; i <= range.toRow; i++) {
|
||||
@@ -18,9 +20,9 @@ export function handleCopyRequest(clipboardService: IClipboardService, range: Sl
|
||||
}
|
||||
|
||||
if (i !== range.toRow) {
|
||||
results += os.EOL;
|
||||
results += textResourcePropertiesService.getEOL(URI.from({ scheme: Schemas.untitled }));
|
||||
}
|
||||
}
|
||||
clipboardService.writeText(results);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ import { CopyKeybind } from 'sql/base/browser/ui/table/plugins/copyKeybind.plugi
|
||||
import { IClipboardService } from 'sql/platform/clipboard/common/clipboardService';
|
||||
import { CellSelectionModel } from 'sql/base/browser/ui/table/plugins/cellSelectionModel.plugin';
|
||||
import { handleCopyRequest } from 'sql/workbench/parts/profiler/browser/profilerCopyHandler';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/resourceConfiguration';
|
||||
|
||||
class BasicView implements IView {
|
||||
public get element(): HTMLElement {
|
||||
@@ -161,7 +162,8 @@ export class ProfilerEditor extends BaseEditor {
|
||||
@IContextViewService private _contextViewService: IContextViewService,
|
||||
@IEditorService editorService: IEditorService,
|
||||
@IStorageService storageService: IStorageService,
|
||||
@IClipboardService private _clipboardService: IClipboardService
|
||||
@IClipboardService private _clipboardService: IClipboardService,
|
||||
@ITextResourcePropertiesService private readonly textResourcePropertiesService: ITextResourcePropertiesService
|
||||
) {
|
||||
super(ProfilerEditor.ID, telemetryService, themeService, storageService);
|
||||
this._profilerEditorContextKey = CONTEXT_PROFILER_EDITOR.bindTo(this._contextKeyService);
|
||||
@@ -392,7 +394,7 @@ export class ProfilerEditor extends BaseEditor {
|
||||
detailTableCopyKeybind.onCopy((ranges: Slick.Range[]) => {
|
||||
// we always only get 1 item in the ranges
|
||||
if (ranges && ranges.length === 1) {
|
||||
handleCopyRequest(this._clipboardService, ranges[0], (row, cell) => {
|
||||
handleCopyRequest(this._clipboardService, this.textResourcePropertiesService, ranges[0], (row, cell) => {
|
||||
const item = this._detailTableData.getItem(row);
|
||||
// only 2 columns in this table
|
||||
return cell === 0 ? item.label : item.value;
|
||||
|
||||
@@ -25,6 +25,7 @@ import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
import { ProfilerFilter, ProfilerFilterClause, ProfilerFilterClauseOperator, IProfilerService } from 'sql/workbench/services/profiler/common/interfaces';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/resourceConfiguration';
|
||||
|
||||
|
||||
const ClearText: string = localize('profilerFilterDialog.clear', "Clear all");
|
||||
@@ -77,9 +78,10 @@ export class ProfilerFilterDialog extends Modal {
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
@ILogService logService: ILogService,
|
||||
@IContextViewService private contextViewService: IContextViewService,
|
||||
@IProfilerService private profilerService: IProfilerService
|
||||
@IProfilerService private profilerService: IProfilerService,
|
||||
@ITextResourcePropertiesService textResourcePropertiesService: ITextResourcePropertiesService
|
||||
) {
|
||||
super('', TelemetryKeys.ProfilerFilter, telemetryService, layoutService, clipboardService, themeService, logService, contextKeyService, { isFlyout: false, hasTitleIcon: true });
|
||||
super('', TelemetryKeys.ProfilerFilter, telemetryService, layoutService, clipboardService, themeService, logService, textResourcePropertiesService, contextKeyService, { isFlyout: false, hasTitleIcon: true });
|
||||
}
|
||||
|
||||
public open(input: ProfilerInput) {
|
||||
|
||||
@@ -32,6 +32,7 @@ import { localize } from 'vs/nls';
|
||||
import { CopyKeybind } from 'sql/base/browser/ui/table/plugins/copyKeybind.plugin';
|
||||
import { IClipboardService } from 'sql/platform/clipboard/common/clipboardService';
|
||||
import { handleCopyRequest } from 'sql/workbench/parts/profiler/browser/profilerCopyHandler';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/resourceConfiguration';
|
||||
|
||||
export interface ProfilerTableViewState {
|
||||
scrollTop: number;
|
||||
@@ -66,7 +67,8 @@ export class ProfilerTableEditor extends BaseEditor implements IProfilerControll
|
||||
@IInstantiationService private _instantiationService: IInstantiationService,
|
||||
@IStorageService storageService: IStorageService,
|
||||
@IStatusbarService private _statusbarService: IStatusbarService,
|
||||
@IClipboardService private _clipboardService: IClipboardService
|
||||
@IClipboardService private _clipboardService: IClipboardService,
|
||||
@ITextResourcePropertiesService private readonly textResourcePropertiesService: ITextResourcePropertiesService
|
||||
) {
|
||||
super(ProfilerTableEditor.ID, telemetryService, _themeService, storageService);
|
||||
this._actionMap[ACTION_IDS.FIND_NEXT] = this._instantiationService.createInstance(ProfilerFindNext, this);
|
||||
@@ -98,7 +100,7 @@ export class ProfilerTableEditor extends BaseEditor implements IProfilerControll
|
||||
// in context of this table, the selection mode is row selection, copy the whole row will get a lot of unwanted data
|
||||
// ignore the passed in range and create a range so that it only copies the currently selected cell value.
|
||||
const activeCell = this._profilerTable.activeCell;
|
||||
handleCopyRequest(this._clipboardService, new Slick.Range(activeCell.row, activeCell.cell), (row, cell) => {
|
||||
handleCopyRequest(this._clipboardService, this.textResourcePropertiesService, new Slick.Range(activeCell.row, activeCell.cell), (row, cell) => {
|
||||
const fieldName = this._input.columns[cell].field;
|
||||
return this._input.data.getItem(row)[fieldName];
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user