mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-06 01:25:38 -05:00
Merge from vscode c58aaab8a1cc22a7139b761166a0d4f37d41e998 (#7880)
* Merge from vscode c58aaab8a1cc22a7139b761166a0d4f37d41e998 * fix pipelines * fix strict-null-checks * add missing files
This commit is contained in:
@@ -13,6 +13,7 @@ import { handleVetos } from 'vs/platform/lifecycle/common/lifecycle';
|
||||
import { isMacintosh, isWindows } from 'vs/base/common/platform';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { Barrier } from 'vs/base/common/async';
|
||||
import { ParsedArgs } from 'vs/platform/environment/common/environment';
|
||||
|
||||
export const ILifecycleMainService = createDecorator<ILifecycleMainService>('lifecycleMainService');
|
||||
|
||||
@@ -82,6 +83,11 @@ export interface ILifecycleMainService {
|
||||
*/
|
||||
readonly onBeforeWindowUnload: Event<IWindowUnloadEvent>;
|
||||
|
||||
/**
|
||||
* Reload a window. All lifecycle event handlers are triggered.
|
||||
*/
|
||||
reload(window: ICodeWindow, cli?: ParsedArgs): Promise<void>;
|
||||
|
||||
/**
|
||||
* Unload a window for the provided reason. All lifecycle event handlers are triggered.
|
||||
*/
|
||||
@@ -360,6 +366,15 @@ export class LifecycleMainService extends Disposable implements ILifecycleMainSe
|
||||
});
|
||||
}
|
||||
|
||||
async reload(window: ICodeWindow, cli?: ParsedArgs): Promise<void> {
|
||||
|
||||
// Only reload when the window has not vetoed this
|
||||
const veto = await this.unload(window, UnloadReason.RELOAD);
|
||||
if (!veto) {
|
||||
window.reload(undefined, cli);
|
||||
}
|
||||
}
|
||||
|
||||
async unload(window: ICodeWindow, reason: UnloadReason): Promise<boolean /* veto */> {
|
||||
|
||||
// Always allow to unload a window that is not yet ready
|
||||
@@ -489,11 +504,11 @@ export class LifecycleMainService extends Disposable implements ILifecycleMainSe
|
||||
this.logService.trace('Lifecycle#relaunch()');
|
||||
|
||||
const args = process.argv.slice(1);
|
||||
if (options && options.addArgs) {
|
||||
if (options?.addArgs) {
|
||||
args.push(...options.addArgs);
|
||||
}
|
||||
|
||||
if (options && options.removeArgs) {
|
||||
if (options?.removeArgs) {
|
||||
for (const a of options.removeArgs) {
|
||||
const idx = args.indexOf(a);
|
||||
if (idx >= 0) {
|
||||
|
||||
Reference in New Issue
Block a user