mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-31 17:23:31 -05:00
Merge from vscode a348d103d1256a06a2c9b3f9b406298a9fef6898 (#15681)
* Merge from vscode a348d103d1256a06a2c9b3f9b406298a9fef6898 * Fixes and cleanup * Distro * Fix hygiene yarn * delete no yarn lock changes file * Fix hygiene * Fix layer check * Fix CI * Skip lib checks * Remove tests deleted in vs code * Fix tests * Distro * Fix tests and add removed extension point * Skip failing notebook tests for now * Disable broken tests and cleanup build folder * Update yarn.lock and fix smoke tests * Bump sqlite * fix contributed actions and file spacing * Fix user data path * Update yarn.locks Co-authored-by: ADS Merger <karlb@microsoft.com>
This commit is contained in:
@@ -4,26 +4,44 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
//@ts-check
|
||||
'use strict';
|
||||
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
const bootstrapWindow = bootstrapWindowLib();
|
||||
|
||||
// Load process explorer into window
|
||||
bootstrapWindow.load(['vs/code/electron-sandbox/processExplorer/processExplorerMain'], function (processExplorer, configuration) {
|
||||
processExplorer.startup(configuration.windowId, configuration.data);
|
||||
}, { forceEnableDeveloperKeybindings: true });
|
||||
|
||||
|
||||
//#region Globals
|
||||
return processExplorer.startup(configuration);
|
||||
}, {
|
||||
configureDeveloperSettings: function () {
|
||||
return {
|
||||
forceEnableDeveloperKeybindings: true
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
* @returns {{ load: (modules: string[], resultCallback: (result, configuration: object) => any, options?: object) => unknown }}
|
||||
* @typedef {import('../../../base/parts/sandbox/common/sandboxTypes').ISandboxConfiguration} ISandboxConfiguration
|
||||
*
|
||||
* @returns {{
|
||||
* load: (
|
||||
* modules: string[],
|
||||
* resultCallback: (result, configuration: ISandboxConfiguration) => unknown,
|
||||
* options?: {
|
||||
* configureDeveloperSettings?: (config: ISandboxConfiguration) => {
|
||||
* forceEnableDeveloperKeybindings?: boolean,
|
||||
* disallowReloadKeybinding?: boolean,
|
||||
* removeDeveloperKeybindingsAfterLoad?: boolean
|
||||
* },
|
||||
* canModifyDOM?: (config: ISandboxConfiguration) => void,
|
||||
* beforeLoaderConfig?: (loaderConfig: object) => void,
|
||||
* beforeRequire?: () => void
|
||||
* }
|
||||
* ) => Promise<unknown>
|
||||
* }}
|
||||
*/
|
||||
function bootstrapWindowLib() {
|
||||
// @ts-ignore (defined in bootstrap-window.js)
|
||||
return window.MonacoBootstrapWindow;
|
||||
}
|
||||
|
||||
//#endregion
|
||||
}());
|
||||
|
||||
@@ -9,13 +9,12 @@ import { INativeHostService } from 'vs/platform/native/electron-sandbox/native';
|
||||
import { NativeHostService } from 'vs/platform/native/electron-sandbox/nativeHostService';
|
||||
import { ipcRenderer } from 'vs/base/parts/sandbox/electron-sandbox/globals';
|
||||
import { localize } from 'vs/nls';
|
||||
import { ProcessExplorerStyles, ProcessExplorerData } from 'vs/platform/issue/common/issue';
|
||||
import { ProcessExplorerStyles, ProcessExplorerData, ProcessExplorerWindowConfiguration } from 'vs/platform/issue/common/issue';
|
||||
import { applyZoom, zoomIn, zoomOut } from 'vs/platform/windows/electron-sandbox/window';
|
||||
import { IContextMenuItem } from 'vs/base/parts/contextmenu/common/contextmenu';
|
||||
import { popup } from 'vs/base/parts/contextmenu/electron-sandbox/contextmenu';
|
||||
import { ProcessItem } from 'vs/base/common/processes';
|
||||
import * as dom from 'vs/base/browser/dom';
|
||||
import { DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import { append, $ } from 'vs/base/browser/dom';
|
||||
import { isRemoteDiagnosticError, IRemoteDiagnosticError } from 'vs/platform/diagnostics/common/diagnostics';
|
||||
import { ElectronIPCMainProcessService } from 'vs/platform/ipc/electron-sandbox/mainProcessService';
|
||||
import { ByteSize } from 'vs/platform/files/common/files';
|
||||
@@ -105,11 +104,11 @@ class ProcessHeaderTreeRenderer implements ITreeRenderer<ProcessInformation, voi
|
||||
templateId: string = 'header';
|
||||
renderTemplate(container: HTMLElement): IProcessItemTemplateData {
|
||||
const data = Object.create(null);
|
||||
const row = dom.append(container, dom.$('.row'));
|
||||
data.name = dom.append(row, dom.$('.nameLabel'));
|
||||
data.CPU = dom.append(row, dom.$('.cpu'));
|
||||
data.memory = dom.append(row, dom.$('.memory'));
|
||||
data.PID = dom.append(row, dom.$('.pid'));
|
||||
const row = append(container, $('.row'));
|
||||
data.name = append(row, $('.nameLabel'));
|
||||
data.CPU = append(row, $('.cpu'));
|
||||
data.memory = append(row, $('.memory'));
|
||||
data.PID = append(row, $('.pid'));
|
||||
return data;
|
||||
}
|
||||
renderElement(node: ITreeNode<ProcessInformation, void>, index: number, templateData: IProcessItemTemplateData, height: number | undefined): void {
|
||||
@@ -128,8 +127,8 @@ class MachineRenderer implements ITreeRenderer<MachineProcessInformation, void,
|
||||
templateId: string = 'machine';
|
||||
renderTemplate(container: HTMLElement): IProcessRowTemplateData {
|
||||
const data = Object.create(null);
|
||||
const row = dom.append(container, dom.$('.row'));
|
||||
data.name = dom.append(row, dom.$('.nameLabel'));
|
||||
const row = append(container, $('.row'));
|
||||
data.name = append(row, $('.nameLabel'));
|
||||
return data;
|
||||
}
|
||||
renderElement(node: ITreeNode<MachineProcessInformation, void>, index: number, templateData: IProcessRowTemplateData, height: number | undefined): void {
|
||||
@@ -144,8 +143,8 @@ class ErrorRenderer implements ITreeRenderer<IRemoteDiagnosticError, void, IProc
|
||||
templateId: string = 'error';
|
||||
renderTemplate(container: HTMLElement): IProcessRowTemplateData {
|
||||
const data = Object.create(null);
|
||||
const row = dom.append(container, dom.$('.row'));
|
||||
data.name = dom.append(row, dom.$('.nameLabel'));
|
||||
const row = append(container, $('.row'));
|
||||
data.name = append(row, $('.nameLabel'));
|
||||
return data;
|
||||
}
|
||||
renderElement(node: ITreeNode<IRemoteDiagnosticError, void>, index: number, templateData: IProcessRowTemplateData, height: number | undefined): void {
|
||||
@@ -163,12 +162,12 @@ class ProcessRenderer implements ITreeRenderer<ProcessItem, void, IProcessItemTe
|
||||
templateId: string = 'process';
|
||||
renderTemplate(container: HTMLElement): IProcessItemTemplateData {
|
||||
const data = <IProcessItemTemplateData>Object.create(null);
|
||||
const row = dom.append(container, dom.$('.row'));
|
||||
const row = append(container, $('.row'));
|
||||
|
||||
data.name = dom.append(row, dom.$('.nameLabel'));
|
||||
data.CPU = dom.append(row, dom.$('.cpu'));
|
||||
data.memory = dom.append(row, dom.$('.memory'));
|
||||
data.PID = dom.append(row, dom.$('.pid'));
|
||||
data.name = append(row, $('.nameLabel'));
|
||||
data.CPU = append(row, $('.cpu'));
|
||||
data.memory = append(row, $('.memory'));
|
||||
data.PID = append(row, $('.pid'));
|
||||
|
||||
return data;
|
||||
}
|
||||
@@ -226,8 +225,6 @@ class ProcessExplorer {
|
||||
|
||||
private mapPidToWindowTitle = new Map<number, string>();
|
||||
|
||||
private listeners = new DisposableStore();
|
||||
|
||||
private nativeHostService: INativeHostService;
|
||||
|
||||
private tree: DataTree<any, ProcessTree | MachineProcessInformation | ProcessItem | ProcessInformation | IRemoteDiagnosticError, any> | undefined;
|
||||
@@ -237,6 +234,7 @@ class ProcessExplorer {
|
||||
this.nativeHostService = new NativeHostService(windowId, mainProcessService) as INativeHostService;
|
||||
|
||||
this.applyStyles(data.styles);
|
||||
this.setEventHandlers(data);
|
||||
|
||||
// Map window process pids to titles, annotate process names with this when rendering to distinguish between them
|
||||
ipcRenderer.on('vscode:windowsInfoResponse', (event: unknown, windows: any[]) => {
|
||||
@@ -263,6 +261,32 @@ class ProcessExplorer {
|
||||
this.lastRequestTime = Date.now();
|
||||
ipcRenderer.send('vscode:windowsInfoRequest');
|
||||
ipcRenderer.send('vscode:listProcesses');
|
||||
|
||||
|
||||
}
|
||||
|
||||
private setEventHandlers(data: ProcessExplorerData): void {
|
||||
document.onkeydown = (e: KeyboardEvent) => {
|
||||
const cmdOrCtrlKey = data.platform === 'darwin' ? e.metaKey : e.ctrlKey;
|
||||
|
||||
// Cmd/Ctrl + w closes issue window
|
||||
if (cmdOrCtrlKey && e.keyCode === 87) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
|
||||
ipcRenderer.send('vscode:closeProcessExplorer');
|
||||
}
|
||||
|
||||
// Cmd/Ctrl + zooms in
|
||||
if (cmdOrCtrlKey && e.keyCode === 187) {
|
||||
zoomIn();
|
||||
}
|
||||
|
||||
// Cmd/Ctrl - zooms out
|
||||
if (cmdOrCtrlKey && e.keyCode === 189) {
|
||||
zoomOut();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private async createProcessTree(processRoots: MachineProcessInformation[]): Promise<void> {
|
||||
@@ -449,39 +473,12 @@ class ProcessExplorer {
|
||||
}
|
||||
}, 200);
|
||||
}
|
||||
|
||||
public dispose() {
|
||||
this.listeners.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
export function startup(windowId: number, data: ProcessExplorerData): void {
|
||||
const platformClass = data.platform === 'win32' ? 'windows' : data.platform === 'linux' ? 'linux' : 'mac';
|
||||
export function startup(configuration: ProcessExplorerWindowConfiguration): void {
|
||||
const platformClass = configuration.data.platform === 'win32' ? 'windows' : configuration.data.platform === 'linux' ? 'linux' : 'mac';
|
||||
document.body.classList.add(platformClass); // used by our fonts
|
||||
applyZoom(data.zoomLevel);
|
||||
applyZoom(configuration.data.zoomLevel);
|
||||
|
||||
const processExplorer = new ProcessExplorer(windowId, data);
|
||||
|
||||
document.onkeydown = (e: KeyboardEvent) => {
|
||||
const cmdOrCtrlKey = data.platform === 'darwin' ? e.metaKey : e.ctrlKey;
|
||||
|
||||
// Cmd/Ctrl + w closes issue window
|
||||
if (cmdOrCtrlKey && e.keyCode === 87) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
|
||||
processExplorer.dispose();
|
||||
ipcRenderer.send('vscode:closeProcessExplorer');
|
||||
}
|
||||
|
||||
// Cmd/Ctrl + zooms in
|
||||
if (cmdOrCtrlKey && e.keyCode === 187) {
|
||||
zoomIn();
|
||||
}
|
||||
|
||||
// Cmd/Ctrl - zooms out
|
||||
if (cmdOrCtrlKey && e.keyCode === 189) {
|
||||
zoomOut();
|
||||
}
|
||||
};
|
||||
new ProcessExplorer(configuration.windowId, configuration.data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user