mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-04 01:25:38 -05:00
Merge from vscode 64980ea1f3f532c82bb6c28d27bba9ef2c5b4463 (#7206)
* Merge from vscode 64980ea1f3f532c82bb6c28d27bba9ef2c5b4463 * fix config changes * fix strictnull checks
This commit is contained in:
@@ -10,7 +10,7 @@ import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/c
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
|
||||
export abstract class AbstractAccessibilityService extends Disposable implements IAccessibilityService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private _accessibilityModeEnabledContext: IContextKey<boolean>;
|
||||
protected readonly _onDidChangeAccessibilitySupport = new Emitter<void>();
|
||||
|
||||
@@ -10,7 +10,7 @@ import { RawContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||
export const IAccessibilityService = createDecorator<IAccessibilityService>('accessibilityService');
|
||||
|
||||
export interface IAccessibilityService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
readonly onDidChangeAccessibilitySupport: Event<void>;
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import { AbstractAccessibilityService } from 'vs/platform/accessibility/common/a
|
||||
|
||||
export class BrowserAccessibilityService extends AbstractAccessibilityService implements IAccessibilityService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private _accessibilitySupport = AccessibilitySupport.Unknown;
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ export const IMenuService = createDecorator<IMenuService>('menuService');
|
||||
|
||||
export interface IMenuService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
createMenu(id: MenuId, scopedKeybindingService: IContextKeyService): IMenu;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import { ContextKeyExpr, IContextKeyService, IContextKeyChangeEvent } from 'vs/p
|
||||
|
||||
export class MenuService implements IMenuService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
constructor(
|
||||
@ICommandService private readonly _commandService: ICommandService
|
||||
|
||||
@@ -33,7 +33,7 @@ export interface IWorkspaceBackupInfo {
|
||||
}
|
||||
|
||||
export interface IBackupMainService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
isHotExitEnabled(): boolean;
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import { Schemas } from 'vs/base/common/network';
|
||||
|
||||
export class BackupMainService implements IBackupMainService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
protected backupHome: string;
|
||||
protected workspacesJsonPath: string;
|
||||
@@ -138,7 +138,7 @@ export class BackupMainService implements IBackupMainService {
|
||||
}
|
||||
|
||||
registerWorkspaceBackupSync(workspaceInfo: IWorkspaceBackupInfo, migrateFrom?: string): string {
|
||||
if (!this.rootWorkspaces.some(w => workspaceInfo.workspace.id === w.workspace.id)) {
|
||||
if (!this.rootWorkspaces.some(window => workspaceInfo.workspace.id === window.workspace.id)) {
|
||||
this.rootWorkspaces.push(workspaceInfo);
|
||||
this.saveSync();
|
||||
}
|
||||
@@ -219,7 +219,7 @@ export class BackupMainService implements IBackupMainService {
|
||||
backupFolder = this.getRandomEmptyWindowId();
|
||||
}
|
||||
|
||||
if (!this.emptyWorkspaces.some(w => !!w.backupFolder && isEqual(w.backupFolder, backupFolder!, !platform.isLinux))) {
|
||||
if (!this.emptyWorkspaces.some(window => !!window.backupFolder && isEqual(window.backupFolder, backupFolder!, !platform.isLinux))) {
|
||||
this.emptyWorkspaces.push({ backupFolder, remoteAuthority });
|
||||
this.saveSync();
|
||||
}
|
||||
@@ -353,7 +353,7 @@ export class BackupMainService implements IBackupMainService {
|
||||
|
||||
// New empty window backup
|
||||
let newBackupFolder = this.getRandomEmptyWindowId();
|
||||
while (this.emptyWorkspaces.some(w => !!w.backupFolder && isEqual(w.backupFolder, newBackupFolder, platform.isLinux))) {
|
||||
while (this.emptyWorkspaces.some(window => !!window.backupFolder && isEqual(window.backupFolder, newBackupFolder, platform.isLinux))) {
|
||||
newBackupFolder = this.getRandomEmptyWindowId();
|
||||
}
|
||||
|
||||
@@ -374,7 +374,7 @@ export class BackupMainService implements IBackupMainService {
|
||||
|
||||
// New empty window backup
|
||||
let newBackupFolder = this.getRandomEmptyWindowId();
|
||||
while (this.emptyWorkspaces.some(w => !!w.backupFolder && isEqual(w.backupFolder, newBackupFolder, platform.isLinux))) {
|
||||
while (this.emptyWorkspaces.some(window => !!window.backupFolder && isEqual(window.backupFolder, newBackupFolder, platform.isLinux))) {
|
||||
newBackupFolder = this.getRandomEmptyWindowId();
|
||||
}
|
||||
|
||||
@@ -457,4 +457,4 @@ export class BackupMainService implements IBackupMainService {
|
||||
protected getLegacyFolderHash(folderPath: string): string {
|
||||
return crypto.createHash('md5').update(platform.isLinux ? folderPath : folderPath.toLowerCase()).digest('hex');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import * as path from 'vs/base/common/path';
|
||||
import * as pfs from 'vs/base/node/pfs';
|
||||
import { URI as Uri, URI } from 'vs/base/common/uri';
|
||||
import { EnvironmentService } from 'vs/platform/environment/node/environmentService';
|
||||
import { parseArgs } from 'vs/platform/environment/node/argv';
|
||||
import { parseArgs, OPTIONS } from 'vs/platform/environment/node/argv';
|
||||
import { BackupMainService } from 'vs/platform/backup/electron-main/backupMainService';
|
||||
import { IBackupWorkspacesFormat, ISerializedWorkspace, IWorkspaceBackupInfo } from 'vs/platform/backup/common/backup';
|
||||
import { HotExitConfiguration } from 'vs/platform/files/common/files';
|
||||
@@ -32,7 +32,7 @@ suite('BackupMainService', () => {
|
||||
const backupHome = path.join(parentDir, 'Backups');
|
||||
const backupWorkspacesPath = path.join(backupHome, 'workspaces.json');
|
||||
|
||||
const environmentService = new EnvironmentService(parseArgs(process.argv), process.execPath);
|
||||
const environmentService = new EnvironmentService(parseArgs(process.argv, OPTIONS), process.execPath);
|
||||
|
||||
class TestBackupMainService extends BackupMainService {
|
||||
|
||||
@@ -322,7 +322,7 @@ suite('BackupMainService', () => {
|
||||
assert.deepEqual(json.folderURIWorkspaces, [URI.file(folderPath).toString()]);
|
||||
assert.deepEqual(json.rootURIWorkspaces, [{ id: workspace.id, configURIPath: URI.file(workspacePath).toString() }]);
|
||||
|
||||
assertEqualUris(service.getWorkspaceBackups().map(w => w.workspace.configPath), [workspace.configPath]);
|
||||
assertEqualUris(service.getWorkspaceBackups().map(window => window.workspace.configPath), [workspace.configPath]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -731,4 +731,4 @@ suite('BackupMainService', () => {
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -6,11 +6,10 @@
|
||||
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
|
||||
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
|
||||
|
||||
export class BrowserClipboardService implements IClipboardService {
|
||||
|
||||
_serviceBrand!: ServiceIdentifier<IClipboardService>;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private _internalResourcesClipboard: URI[] | undefined;
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ export const IClipboardService = createDecorator<IClipboardService>('clipboardSe
|
||||
|
||||
export interface IClipboardService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
/**
|
||||
* Writes text to the system clipboard.
|
||||
|
||||
@@ -12,7 +12,7 @@ export class ClipboardService implements IClipboardService {
|
||||
|
||||
private static FILE_FORMAT = 'code/file-list'; // Clipboard format for files
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
async writeText(text: string, type?: 'selection' | 'clipboard'): Promise<void> {
|
||||
clipboard.writeText(text, type);
|
||||
|
||||
@@ -19,7 +19,7 @@ export interface ICommandEvent {
|
||||
}
|
||||
|
||||
export interface ICommandService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
onWillExecuteCommand: Event<ICommandEvent>;
|
||||
onDidExecuteCommand: Event<ICommandEvent>;
|
||||
executeCommand<T = any>(commandId: string, ...args: any[]): Promise<T | undefined>;
|
||||
|
||||
@@ -63,7 +63,7 @@ export interface IConfigurationChangeEvent {
|
||||
}
|
||||
|
||||
export interface IConfigurationService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
onDidChangeConfiguration: Event<IConfigurationChangeEvent>;
|
||||
|
||||
|
||||
@@ -442,7 +442,7 @@ export class Configuration {
|
||||
return this._defaultConfiguration;
|
||||
}
|
||||
|
||||
private _userConfiguration: ConfigurationModel | null;
|
||||
private _userConfiguration: ConfigurationModel | null = null;
|
||||
get userConfiguration(): ConfigurationModel {
|
||||
if (!this._userConfiguration) {
|
||||
this._userConfiguration = this._remoteUserConfiguration.isEmpty() ? this._localUserConfiguration : this._localUserConfiguration.merge(this._remoteUserConfiguration);
|
||||
|
||||
@@ -140,6 +140,7 @@ type SettingProperties = { [key: string]: any };
|
||||
export const allSettings: { properties: SettingProperties, patternProperties: SettingProperties } = { properties: {}, patternProperties: {} };
|
||||
export const applicationSettings: { properties: SettingProperties, patternProperties: SettingProperties } = { properties: {}, patternProperties: {} };
|
||||
export const machineSettings: { properties: SettingProperties, patternProperties: SettingProperties } = { properties: {}, patternProperties: {} };
|
||||
export const machineOverridableSettings: { properties: SettingProperties, patternProperties: SettingProperties } = { properties: {}, patternProperties: {} };
|
||||
export const windowSettings: { properties: SettingProperties, patternProperties: SettingProperties } = { properties: {}, patternProperties: {} };
|
||||
export const resourceSettings: { properties: SettingProperties, patternProperties: SettingProperties } = { properties: {}, patternProperties: {} };
|
||||
|
||||
@@ -169,7 +170,7 @@ class ConfigurationRegistry implements IConfigurationRegistry {
|
||||
properties: {}
|
||||
};
|
||||
this.configurationContributors = [this.defaultOverridesConfigurationNode];
|
||||
this.editorConfigurationSchema = { properties: {}, patternProperties: {}, additionalProperties: false, errorMessage: 'Unknown editor configuration setting' };
|
||||
this.editorConfigurationSchema = { properties: {}, patternProperties: {}, additionalProperties: false, errorMessage: 'Unknown editor configuration setting', allowsTrailingCommas: true, allowComments: true };
|
||||
this.configurationProperties = {};
|
||||
this.excludedConfigurationProperties = {};
|
||||
this.computeOverridePropertyPattern();
|
||||
@@ -213,6 +214,9 @@ class ConfigurationRegistry implements IConfigurationRegistry {
|
||||
case ConfigurationScope.MACHINE:
|
||||
delete machineSettings.properties[key];
|
||||
break;
|
||||
case ConfigurationScope.MACHINE_OVERRIDABLE:
|
||||
delete machineOverridableSettings.properties[key];
|
||||
break;
|
||||
case ConfigurationScope.WINDOW:
|
||||
delete windowSettings.properties[key];
|
||||
break;
|
||||
@@ -364,6 +368,9 @@ class ConfigurationRegistry implements IConfigurationRegistry {
|
||||
case ConfigurationScope.MACHINE:
|
||||
machineSettings.properties[key] = properties[key];
|
||||
break;
|
||||
case ConfigurationScope.MACHINE_OVERRIDABLE:
|
||||
machineOverridableSettings.properties[key] = properties[key];
|
||||
break;
|
||||
case ConfigurationScope.WINDOW:
|
||||
windowSettings.properties[key] = properties[key];
|
||||
break;
|
||||
@@ -402,6 +409,7 @@ class ConfigurationRegistry implements IConfigurationRegistry {
|
||||
delete allSettings.patternProperties[this.overridePropertyPattern];
|
||||
delete applicationSettings.patternProperties[this.overridePropertyPattern];
|
||||
delete machineSettings.patternProperties[this.overridePropertyPattern];
|
||||
delete machineOverridableSettings.patternProperties[this.overridePropertyPattern];
|
||||
delete windowSettings.patternProperties[this.overridePropertyPattern];
|
||||
delete resourceSettings.patternProperties[this.overridePropertyPattern];
|
||||
|
||||
@@ -410,6 +418,7 @@ class ConfigurationRegistry implements IConfigurationRegistry {
|
||||
allSettings.patternProperties[this.overridePropertyPattern] = patternProperties;
|
||||
applicationSettings.patternProperties[this.overridePropertyPattern] = patternProperties;
|
||||
machineSettings.patternProperties[this.overridePropertyPattern] = patternProperties;
|
||||
machineOverridableSettings.patternProperties[this.overridePropertyPattern] = patternProperties;
|
||||
windowSettings.patternProperties[this.overridePropertyPattern] = patternProperties;
|
||||
resourceSettings.patternProperties[this.overridePropertyPattern] = patternProperties;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import { Schemas } from 'vs/base/common/network';
|
||||
|
||||
export class ConfigurationService extends Disposable implements IConfigurationService, IDisposable {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private configuration: Configuration;
|
||||
private userConfigModelWatcher: ConfigWatcher<ConfigurationModelParser> | undefined;
|
||||
|
||||
@@ -8,7 +8,7 @@ import { URI } from 'vs/base/common/uri';
|
||||
import { getConfigurationKeys, IConfigurationOverrides, IConfigurationService, getConfigurationValue, isConfigurationOverrides } from 'vs/platform/configuration/common/configuration';
|
||||
|
||||
export class TestConfigurationService implements IConfigurationService {
|
||||
public _serviceBrand: any;
|
||||
public _serviceBrand: undefined;
|
||||
|
||||
private configuration = Object.create(null);
|
||||
|
||||
|
||||
@@ -225,7 +225,7 @@ class CompositeContextKeyChangeEvent implements IContextKeyChangeEvent {
|
||||
}
|
||||
|
||||
export abstract class AbstractContextKeyService implements IContextKeyService {
|
||||
public _serviceBrand: any;
|
||||
public _serviceBrand: undefined;
|
||||
|
||||
protected _isDisposed: boolean;
|
||||
protected _onDidChangeContext = new PauseableEmitter<IContextKeyChangeEvent>({ merge: input => new CompositeContextKeyChangeEvent(input) });
|
||||
|
||||
@@ -980,7 +980,7 @@ export interface IContextKeyChangeEvent {
|
||||
}
|
||||
|
||||
export interface IContextKeyService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
dispose(): void;
|
||||
|
||||
onDidChangeContext: Event<IContextKeyChangeEvent>;
|
||||
|
||||
@@ -24,8 +24,8 @@ export interface IContextMenuHandlerOptions {
|
||||
}
|
||||
|
||||
export class ContextMenuHandler {
|
||||
private focusToReturn: HTMLElement;
|
||||
private block: HTMLElement | null;
|
||||
private focusToReturn: HTMLElement | null = null;
|
||||
private block: HTMLElement | null = null;
|
||||
private options: IContextMenuHandlerOptions = { blockMouse: true };
|
||||
|
||||
constructor(
|
||||
|
||||
@@ -14,7 +14,7 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
|
||||
export class ContextMenuService extends Disposable implements IContextMenuService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private _onDidContextMenu = this._register(new Emitter<void>());
|
||||
readonly onDidContextMenu: Event<void> = this._onDidContextMenu.event;
|
||||
|
||||
@@ -13,7 +13,7 @@ export const IContextViewService = createDecorator<IContextViewService>('context
|
||||
|
||||
export interface IContextViewService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
showContextView(delegate: IContextViewDelegate): void;
|
||||
hideContextView(data?: any): void;
|
||||
@@ -37,7 +37,7 @@ export const IContextMenuService = createDecorator<IContextMenuService>('context
|
||||
|
||||
export interface IContextMenuService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
showContextMenu(delegate: IContextMenuDelegate): void;
|
||||
onDidContextMenu: Event<void>; // TODO@isidor these event should be removed once we get async context menus
|
||||
|
||||
@@ -9,7 +9,7 @@ import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
|
||||
|
||||
export class ContextViewService extends Disposable implements IContextViewService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private contextView: ContextView;
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ export interface ICloseSessionEvent {
|
||||
}
|
||||
|
||||
export interface IExtensionHostDebugService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
reload(sessionId: string): void;
|
||||
onReload: Event<IReloadSessionEvent>;
|
||||
|
||||
@@ -54,7 +54,7 @@ export class ExtensionHostDebugBroadcastChannel<TContext> implements IServerChan
|
||||
|
||||
export class ExtensionHostDebugChannelClient extends Disposable implements IExtensionHostDebugService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
constructor(private channel: IChannel) {
|
||||
super();
|
||||
|
||||
@@ -7,7 +7,6 @@ import { IServerChannel, IChannel } from 'vs/base/parts/ipc/common/ipc';
|
||||
import { IRemoteDiagnosticInfo, IRemoteDiagnosticError, SystemInfo, PerformanceInfo } from 'vs/platform/diagnostics/common/diagnostics';
|
||||
import { IDiagnosticsService } from './diagnosticsService';
|
||||
import { Event } from 'vs/base/common/event';
|
||||
import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IMainProcessInfo } from 'vs/platform/launch/common/launchService';
|
||||
import { IWorkspace } from 'vs/platform/workspace/common/workspace';
|
||||
|
||||
@@ -37,7 +36,7 @@ export class DiagnosticsChannel implements IServerChannel {
|
||||
|
||||
export class DiagnosticsService implements IDiagnosticsService {
|
||||
|
||||
_serviceBrand!: ServiceIdentifier<any>;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
constructor(private channel: IChannel) { }
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ export const ID = 'diagnosticsService';
|
||||
export const IDiagnosticsService = createDecorator<IDiagnosticsService>(ID);
|
||||
|
||||
export interface IDiagnosticsService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
getPerformanceInfo(mainProcessInfo: IMainProcessInfo, remoteInfo: (IRemoteDiagnosticInfo | IRemoteDiagnosticError)[]): Promise<PerformanceInfo>;
|
||||
getSystemInfo(mainProcessInfo: IMainProcessInfo, remoteInfo: (IRemoteDiagnosticInfo | IRemoteDiagnosticError)[]): Promise<SystemInfo>;
|
||||
@@ -248,7 +248,7 @@ export function collectLaunchConfigs(folder: string): Promise<WorkspaceStatItem[
|
||||
|
||||
export class DiagnosticsService implements IDiagnosticsService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
constructor(@ITelemetryService private readonly telemetryService: ITelemetryService) { }
|
||||
|
||||
@@ -538,15 +538,11 @@ export class DiagnosticsService implements IDiagnosticsService {
|
||||
if (folderUri.scheme === 'file') {
|
||||
const folder = folderUri.fsPath;
|
||||
collectWorkspaceStats(folder, ['node_modules', '.git']).then(stats => {
|
||||
type WorkspaceStatItemClassification = {
|
||||
name: { classification: 'SystemMetaData', purpose: 'FeatureInsight' };
|
||||
count: { classification: 'SystemMetaData', purpose: 'FeatureInsight', isMeasurement: true };
|
||||
};
|
||||
type WorkspaceStatsClassification = {
|
||||
'workspace.id': { classification: 'SystemMetaData', purpose: 'FeatureInsight' };
|
||||
fileTypes: WorkspaceStatItemClassification;
|
||||
configTypes: WorkspaceStatItemClassification;
|
||||
launchConfigs: WorkspaceStatItemClassification;
|
||||
fileTypes: { classification: 'SystemMetaData', purpose: 'FeatureInsight', isMeasurement: true };
|
||||
configTypes: { classification: 'SystemMetaData', purpose: 'FeatureInsight', isMeasurement: true };
|
||||
launchConfigs: { classification: 'SystemMetaData', purpose: 'FeatureInsight', isMeasurement: true };
|
||||
};
|
||||
type WorkspaceStatsEvent = {
|
||||
'workspace.id': string | undefined;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as nls from 'vs/nls';
|
||||
import { IDialogService, IDialogOptions, IConfirmation, IConfirmationResult, DialogType } from 'vs/platform/dialogs/common/dialogs';
|
||||
import { IDialogService, IDialogOptions, IConfirmation, IConfirmationResult, DialogType, IShowResult } from 'vs/platform/dialogs/common/dialogs';
|
||||
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import Severity from 'vs/base/common/severity';
|
||||
@@ -17,7 +17,7 @@ import { EventHelper } from 'vs/base/browser/dom';
|
||||
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
|
||||
export class DialogService implements IDialogService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private allowableCommands = ['copy', 'cut'];
|
||||
|
||||
@@ -78,7 +78,7 @@ export class DialogService implements IDialogService {
|
||||
return (severity === Severity.Info) ? 'question' : (severity === Severity.Error) ? 'error' : (severity === Severity.Warning) ? 'warning' : 'none';
|
||||
}
|
||||
|
||||
async show(severity: Severity, message: string, buttons: string[], options?: IDialogOptions): Promise<number> {
|
||||
async show(severity: Severity, message: string, buttons: string[], options?: IDialogOptions): Promise<IShowResult> {
|
||||
this.logService.trace('DialogService#show', message);
|
||||
|
||||
const dialogDisposables = new DisposableStore();
|
||||
@@ -97,7 +97,9 @@ export class DialogService implements IDialogService {
|
||||
EventHelper.stop(event, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
checkboxLabel: options && options.checkbox ? options.checkbox.label : undefined,
|
||||
checkboxChecked: options && options.checkbox ? options.checkbox.checked : undefined
|
||||
});
|
||||
|
||||
dialogDisposables.add(dialog);
|
||||
@@ -106,6 +108,9 @@ export class DialogService implements IDialogService {
|
||||
const result = await dialog.show();
|
||||
dialogDisposables.dispose();
|
||||
|
||||
return result.button;
|
||||
return {
|
||||
choice: result.button,
|
||||
checkboxChecked: result.checkboxChecked
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,22 @@ export interface IConfirmationResult {
|
||||
checkboxChecked?: boolean;
|
||||
}
|
||||
|
||||
export interface IShowResult {
|
||||
|
||||
/**
|
||||
* Selected choice index. If the user refused to choose,
|
||||
* then a promise with index of `cancelId` option is returned. If there is no such
|
||||
* option then promise with index `0` is returned.
|
||||
*/
|
||||
choice: number;
|
||||
|
||||
/**
|
||||
* This will only be defined if the confirmation was created
|
||||
* with the checkbox option defined.
|
||||
*/
|
||||
checkboxChecked?: boolean;
|
||||
}
|
||||
|
||||
export interface IPickAndOpenOptions {
|
||||
forceNewWindow?: boolean;
|
||||
defaultUri?: URI;
|
||||
@@ -127,8 +143,10 @@ export const IDialogService = createDecorator<IDialogService>('dialogService');
|
||||
export interface IDialogOptions {
|
||||
cancelId?: number;
|
||||
detail?: string;
|
||||
checkboxLabel?: string;
|
||||
checkboxChecked?: boolean;
|
||||
checkbox?: {
|
||||
label: string;
|
||||
checked?: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -139,7 +157,7 @@ export interface IDialogOptions {
|
||||
*/
|
||||
export interface IDialogService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
/**
|
||||
* Ask the user for confirmation with a modal dialog.
|
||||
@@ -153,7 +171,7 @@ export interface IDialogService {
|
||||
* then a promise with index of `cancelId` option is returned. If there is no such
|
||||
* option then promise with index `0` is returned.
|
||||
*/
|
||||
show(severity: Severity, message: string, buttons: string[], options?: IDialogOptions): Promise<number>;
|
||||
show(severity: Severity, message: string, buttons: string[], options?: IDialogOptions): Promise<IShowResult>;
|
||||
}
|
||||
|
||||
export const IFileDialogService = createDecorator<IFileDialogService>('fileDialogService');
|
||||
@@ -163,7 +181,7 @@ export const IFileDialogService = createDecorator<IFileDialogService>('fileDialo
|
||||
*/
|
||||
export interface IFileDialogService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
/**
|
||||
* The default path for a new file based on previously used files.
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { IChannel, IServerChannel } from 'vs/base/parts/ipc/common/ipc';
|
||||
import { IDialogService, IConfirmation, IConfirmationResult } from 'vs/platform/dialogs/common/dialogs';
|
||||
import { IDialogService, IConfirmation, IConfirmationResult, IShowResult } from 'vs/platform/dialogs/common/dialogs';
|
||||
import Severity from 'vs/base/common/severity';
|
||||
import { Event } from 'vs/base/common/event';
|
||||
|
||||
@@ -27,15 +27,15 @@ export class DialogChannel implements IServerChannel {
|
||||
|
||||
export class DialogChannelClient implements IDialogService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
constructor(private channel: IChannel) { }
|
||||
|
||||
show(severity: Severity, message: string, options: string[]): Promise<number> {
|
||||
show(severity: Severity, message: string, options: string[]): Promise<IShowResult> {
|
||||
return this.channel.call('show', [severity, message, options]);
|
||||
}
|
||||
|
||||
confirm(confirmation: IConfirmation): Promise<IConfirmationResult> {
|
||||
return this.channel.call('confirm', [confirmation]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ export const IDownloadService = createDecorator<IDownloadService>('downloadServi
|
||||
|
||||
export interface IDownloadService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
download(uri: URI, to: URI, cancellationToken?: CancellationToken): Promise<void>;
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ export class DownloadServiceChannel implements IServerChannel {
|
||||
|
||||
export class DownloadServiceChannelClient implements IDownloadService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
constructor(private channel: IChannel, private getUriTransformer: () => IURITransformer | null) { }
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import { Schemas } from 'vs/base/common/network';
|
||||
|
||||
export class DownloadService implements IDownloadService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
constructor(
|
||||
@IRequestService private readonly requestService: IRequestService,
|
||||
|
||||
@@ -19,7 +19,7 @@ export interface IElement {
|
||||
}
|
||||
|
||||
export interface IDriver {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
getWindowIds(): Promise<number[]>;
|
||||
capturePage(windowId: number): Promise<string>;
|
||||
|
||||
@@ -25,7 +25,7 @@ function isSilentKeyCode(keyCode: KeyCode) {
|
||||
|
||||
export class Driver implements IDriver, IWindowDriverRegistry {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private registeredWindowIds = new Set<number>();
|
||||
private reloadingWindowIds = new Set<number>();
|
||||
|
||||
@@ -42,7 +42,7 @@ export class DriverChannel implements IServerChannel {
|
||||
|
||||
export class DriverChannelClient implements IDriver {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
constructor(private channel: IChannel) { }
|
||||
|
||||
@@ -136,7 +136,7 @@ export class WindowDriverRegistryChannel implements IServerChannel {
|
||||
|
||||
export class WindowDriverRegistryChannelClient implements IWindowDriverRegistry {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
constructor(private channel: IChannel) { }
|
||||
|
||||
@@ -177,7 +177,7 @@ export class WindowDriverChannel implements IServerChannel {
|
||||
|
||||
export class WindowDriverChannelClient implements IWindowDriver {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
constructor(private channel: IChannel) { }
|
||||
|
||||
|
||||
@@ -82,15 +82,26 @@ export interface IResourceInput extends IBaseResourceInput {
|
||||
export enum EditorActivation {
|
||||
|
||||
/**
|
||||
* Activate the editor after it opened.
|
||||
* Activate the editor after it opened. This will automatically restore
|
||||
* the editor if it is minimized.
|
||||
*/
|
||||
ACTIVATE,
|
||||
|
||||
/**
|
||||
* Only restore the editor if it is minimized but do not activate it.
|
||||
*
|
||||
* Note: will only work in combination with the `preserveFocus: true` option.
|
||||
* Otherwise, if focus moves into the editor, it will activate and restore
|
||||
* automatically.
|
||||
*/
|
||||
RESTORE,
|
||||
|
||||
/**
|
||||
* Preserve the current active editor.
|
||||
*
|
||||
* Note: will only work in combination with the
|
||||
* `preserveFocus: true` option.
|
||||
* Note: will only work in combination with the `preserveFocus: true` option.
|
||||
* Otherwise, if focus moves into the editor, it will activate and restore
|
||||
* automatically.
|
||||
*/
|
||||
PRESERVE
|
||||
}
|
||||
@@ -107,7 +118,8 @@ export interface IEditorOptions {
|
||||
|
||||
/**
|
||||
* This option is only relevant if an editor is opened into a group that is not active
|
||||
* already and allows to control if the inactive group should become active or not.
|
||||
* already and allows to control if the inactive group should become active, restored
|
||||
* or preserved.
|
||||
*
|
||||
* By default, the editor group will become active unless `preserveFocus` or `inactive`
|
||||
* is specified.
|
||||
@@ -162,6 +174,11 @@ export interface IEditorOptions {
|
||||
* message as needed. By default, an error will be presented as notification if opening was not possible.
|
||||
*/
|
||||
readonly ignoreError?: boolean;
|
||||
|
||||
/**
|
||||
* Does not use editor overrides while opening the editor
|
||||
*/
|
||||
readonly ignoreOverrides?: boolean;
|
||||
}
|
||||
|
||||
export interface ITextEditorSelection {
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { createDecorator, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
|
||||
export interface ParsedArgs {
|
||||
_: string[];
|
||||
'folder-uri'?: string | string[];
|
||||
'file-uri'?: string | string[];
|
||||
'folder-uri'?: string[]; // undefined or array of 1 or more
|
||||
'file-uri'?: string[]; // undefined or array of 1 or more
|
||||
_urls?: string[];
|
||||
help?: boolean;
|
||||
version?: boolean;
|
||||
@@ -25,7 +25,7 @@ export interface ParsedArgs {
|
||||
'reuse-window'?: boolean;
|
||||
locale?: string;
|
||||
'user-data-dir'?: string;
|
||||
'prof-startup'?: string;
|
||||
'prof-startup'?: boolean;
|
||||
'prof-startup-prefix'?: string;
|
||||
'prof-append-timers'?: string;
|
||||
verbose?: boolean;
|
||||
@@ -36,7 +36,7 @@ export interface ParsedArgs {
|
||||
logExtensionHostCommunication?: boolean;
|
||||
'extensions-dir'?: string;
|
||||
'builtin-extensions-dir'?: string;
|
||||
extensionDevelopmentPath?: string | string[]; // one or more local paths or URIs
|
||||
extensionDevelopmentPath?: string[]; // // undefined or array of 1 or more local paths or URIs
|
||||
extensionTestsPath?: string; // either a local path or a URI
|
||||
'extension-development-confirm-save'?: boolean;
|
||||
'inspect-extensions'?: string;
|
||||
@@ -45,14 +45,14 @@ export interface ParsedArgs {
|
||||
'inspect-search'?: string;
|
||||
'inspect-brk-search'?: string;
|
||||
'disable-extensions'?: boolean;
|
||||
'disable-extension'?: string | string[];
|
||||
'disable-extension'?: string[]; // undefined or array of 1 or more
|
||||
'list-extensions'?: boolean;
|
||||
'show-versions'?: boolean;
|
||||
'category'?: string;
|
||||
'install-extension'?: string | string[];
|
||||
'uninstall-extension'?: string | string[];
|
||||
'locate-extension'?: string | string[];
|
||||
'enable-proposed-api'?: string | string[];
|
||||
'install-extension'?: string[]; // undefined or array of 1 or more
|
||||
'uninstall-extension'?: string[]; // undefined or array of 1 or more
|
||||
'locate-extension'?: string[]; // undefined or array of 1 or more
|
||||
'enable-proposed-api'?: string[]; // undefined or array of 1 or more
|
||||
'open-url'?: boolean;
|
||||
'skip-getting-started'?: boolean;
|
||||
'skip-release-notes'?: boolean;
|
||||
@@ -61,8 +61,8 @@ export interface ParsedArgs {
|
||||
'disable-telemetry'?: boolean;
|
||||
'export-default-configuration'?: string;
|
||||
'install-source'?: string;
|
||||
'disable-updates'?: string;
|
||||
'disable-crash-reporter'?: string;
|
||||
'disable-updates'?: boolean;
|
||||
'disable-crash-reporter'?: boolean;
|
||||
'skip-add-to-recently-opened'?: boolean;
|
||||
'max-memory'?: string;
|
||||
'file-write'?: boolean;
|
||||
@@ -71,7 +71,10 @@ export interface ParsedArgs {
|
||||
'driver-verbose'?: boolean;
|
||||
remote?: string;
|
||||
'disable-user-env-probe'?: boolean;
|
||||
'enable-remote-auto-shutdown'?: boolean;
|
||||
'disable-inspect'?: boolean;
|
||||
'force'?: boolean;
|
||||
'force-user-env'?: boolean;
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
aad?: boolean;
|
||||
database?: string;
|
||||
@@ -80,16 +83,11 @@ export interface ParsedArgs {
|
||||
user?: string;
|
||||
command?: string;
|
||||
// {{SQL CARBON EDIT}}
|
||||
'disable-inspect'?: boolean;
|
||||
'force'?: boolean;
|
||||
'gitCredential'?: string;
|
||||
|
||||
// node flags
|
||||
'js-flags'?: boolean;
|
||||
'js-flags'?: string;
|
||||
'disable-gpu'?: boolean;
|
||||
'nolazy'?: boolean;
|
||||
|
||||
// Web flags
|
||||
'web-user-data-dir'?: string;
|
||||
}
|
||||
|
||||
export const IEnvironmentService = createDecorator<IEnvironmentService>('environmentService');
|
||||
@@ -107,7 +105,7 @@ export const BACKUPS = 'Backups';
|
||||
|
||||
export interface IEnvironmentService {
|
||||
|
||||
_serviceBrand: ServiceIdentifier<any>;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
args: ParsedArgs;
|
||||
|
||||
|
||||
@@ -20,112 +20,145 @@ const helpCategories = {
|
||||
t: localize('troubleshooting', "Troubleshooting")
|
||||
};
|
||||
|
||||
export interface Option {
|
||||
id: keyof ParsedArgs;
|
||||
type: 'boolean' | 'string';
|
||||
export interface Option<OptionType> {
|
||||
type: OptionType;
|
||||
alias?: string;
|
||||
deprecates?: string; // old deprecated id
|
||||
args?: string | string[];
|
||||
description?: string;
|
||||
cat?: keyof typeof helpCategories;
|
||||
}
|
||||
//_urls
|
||||
export const options: Option[] = [
|
||||
{ id: 'diff', type: 'boolean', cat: 'o', alias: 'd', args: ['file', 'file'], description: localize('diff', "Compare two files with each other.") },
|
||||
{ id: 'add', type: 'boolean', cat: 'o', alias: 'a', args: 'folder', description: localize('add', "Add folder(s) to the last active window.") },
|
||||
{ id: 'goto', type: 'boolean', cat: 'o', alias: 'g', args: 'file:line[:character]', description: localize('goto', "Open a file at the path on the specified line and character position.") },
|
||||
{ id: 'new-window', type: 'boolean', cat: 'o', alias: 'n', description: localize('newWindow', "Force to open a new window.") },
|
||||
{ id: 'reuse-window', type: 'boolean', cat: 'o', alias: 'r', description: localize('reuseWindow', "Force to open a file or folder in an already opened window.") },
|
||||
{ id: 'wait', type: 'boolean', cat: 'o', alias: 'w', description: localize('wait', "Wait for the files to be closed before returning.") },
|
||||
{ id: 'locale', type: 'string', cat: 'o', args: 'locale', description: localize('locale', "The locale to use (e.g. en-US or zh-TW).") },
|
||||
{ id: 'user-data-dir', type: 'string', cat: 'o', args: 'dir', description: localize('userDataDir', "Specifies the directory that user data is kept in. Can be used to open multiple distinct instances of Code.") },
|
||||
{ id: 'version', type: 'boolean', cat: 'o', alias: 'v', description: localize('version', "Print version.") },
|
||||
{ id: 'help', type: 'boolean', cat: 'o', alias: 'h', description: localize('help', "Print usage.") },
|
||||
{ id: 'telemetry', type: 'boolean', cat: 'o', description: localize('telemetry', "Shows all telemetry events which VS code collects.") },
|
||||
{ id: 'folder-uri', type: 'string', cat: 'o', args: 'uri', description: localize('folderUri', "Opens a window with given folder uri(s)") },
|
||||
{ id: 'file-uri', type: 'string', cat: 'o', args: 'uri', description: localize('fileUri', "Opens a window with given file uri(s)") },
|
||||
|
||||
{ id: 'extensions-dir', type: 'string', deprecates: 'extensionHomePath', cat: 'e', args: 'dir', description: localize('extensionHomePath', "Set the root path for extensions.") },
|
||||
{ id: 'list-extensions', type: 'boolean', cat: 'e', description: localize('listExtensions', "List the installed extensions.") },
|
||||
{ id: 'show-versions', type: 'boolean', cat: 'e', description: localize('showVersions', "Show versions of installed extensions, when using --list-extension.") },
|
||||
{ id: 'category', type: 'string', cat: 'e', description: localize('category', "Filters installed extensions by provided category, when using --list-extension.") },
|
||||
{ id: 'install-extension', type: 'string', cat: 'e', args: 'extension-id | path-to-vsix', description: localize('installExtension', "Installs or updates the extension. Use `--force` argument to avoid prompts.") },
|
||||
{ id: 'uninstall-extension', type: 'string', cat: 'e', args: 'extension-id', description: localize('uninstallExtension', "Uninstalls an extension.") },
|
||||
{ id: 'enable-proposed-api', type: 'string', cat: 'e', args: 'extension-id', description: localize('experimentalApis', "Enables proposed API features for extensions. Can receive one or more extension IDs to enable individually.") },
|
||||
export type OptionDescriptions<T> = {
|
||||
[P in keyof T]: Option<OptionTypeName<T[P]>>;
|
||||
};
|
||||
|
||||
{ id: 'verbose', type: 'boolean', cat: 't', description: localize('verbose', "Print verbose output (implies --wait).") },
|
||||
{ id: 'log', type: 'string', cat: 't', args: 'level', description: localize('log', "Log level to use. Default is 'info'. Allowed values are 'critical', 'error', 'warn', 'info', 'debug', 'trace', 'off'.") },
|
||||
{ id: 'status', type: 'boolean', alias: 's', cat: 't', description: localize('status', "Print process usage and diagnostics information.") },
|
||||
{ id: 'prof-startup', type: 'boolean', cat: 't', description: localize('prof-startup', "Run CPU profiler during startup") },
|
||||
{ id: 'disable-extensions', type: 'boolean', deprecates: 'disableExtensions', cat: 't', description: localize('disableExtensions', "Disable all installed extensions.") },
|
||||
{ id: 'disable-extension', type: 'string', cat: 't', args: 'extension-id', description: localize('disableExtension', "Disable an extension.") },
|
||||
type OptionTypeName<T> =
|
||||
T extends boolean ? 'boolean' :
|
||||
T extends string ? 'string' :
|
||||
T extends string[] ? 'string[]' :
|
||||
T extends undefined ? 'undefined' :
|
||||
'unknown';
|
||||
|
||||
{ id: 'inspect-extensions', type: 'string', deprecates: 'debugPluginHost', args: 'port', cat: 't', description: localize('inspect-extensions', "Allow debugging and profiling of extensions. Check the developer tools for the connection URI.") },
|
||||
{ id: 'inspect-brk-extensions', type: 'string', deprecates: 'debugBrkPluginHost', args: 'port', cat: 't', description: localize('inspect-brk-extensions', "Allow debugging and profiling of extensions with the extension host being paused after start. Check the developer tools for the connection URI.") },
|
||||
{ id: 'disable-gpu', type: 'boolean', cat: 't', description: localize('disableGPU', "Disable GPU hardware acceleration.") },
|
||||
{ id: 'max-memory', type: 'string', cat: 't', description: localize('maxMemory', "Max memory size for a window (in Mbytes).") },
|
||||
export const OPTIONS: OptionDescriptions<Required<ParsedArgs>> = {
|
||||
'diff': { type: 'boolean', cat: 'o', alias: 'd', args: ['file', 'file'], description: localize('diff', "Compare two files with each other.") },
|
||||
'add': { type: 'boolean', cat: 'o', alias: 'a', args: 'folder', description: localize('add', "Add folder(s) to the last active window.") },
|
||||
'goto': { type: 'boolean', cat: 'o', alias: 'g', args: 'file:line[:character]', description: localize('goto', "Open a file at the path on the specified line and character position.") },
|
||||
'new-window': { type: 'boolean', cat: 'o', alias: 'n', description: localize('newWindow', "Force to open a new window.") },
|
||||
'reuse-window': { type: 'boolean', cat: 'o', alias: 'r', description: localize('reuseWindow', "Force to open a file or folder in an already opened window.") },
|
||||
'wait': { type: 'boolean', cat: 'o', alias: 'w', description: localize('wait', "Wait for the files to be closed before returning.") },
|
||||
'waitMarkerFilePath': { type: 'string' },
|
||||
'locale': { type: 'string', cat: 'o', args: 'locale', description: localize('locale', "The locale to use (e.g. en-US or zh-TW).") },
|
||||
'user-data-dir': { type: 'string', cat: 'o', args: 'dir', description: localize('userDataDir', "Specifies the directory that user data is kept in. Can be used to open multiple distinct instances of Code.") },
|
||||
'version': { type: 'boolean', cat: 'o', alias: 'v', description: localize('version', "Print version.") },
|
||||
'help': { type: 'boolean', cat: 'o', alias: 'h', description: localize('help', "Print usage.") },
|
||||
'telemetry': { type: 'boolean', cat: 'o', description: localize('telemetry', "Shows all telemetry events which VS code collects.") },
|
||||
'folder-uri': { type: 'string[]', cat: 'o', args: 'uri', description: localize('folderUri', "Opens a window with given folder uri(s)") },
|
||||
'file-uri': { type: 'string[]', cat: 'o', args: 'uri', description: localize('fileUri', "Opens a window with given file uri(s)") },
|
||||
|
||||
{ id: 'remote', type: 'string' },
|
||||
{ id: 'locate-extension', type: 'string' },
|
||||
{ id: 'extensionDevelopmentPath', type: 'string' },
|
||||
{ id: 'extensionTestsPath', type: 'string' },
|
||||
{ id: 'extension-development-confirm-save', type: 'boolean' },
|
||||
{ id: 'debugId', type: 'string' },
|
||||
{ id: 'inspect-search', type: 'string', deprecates: 'debugSearch' },
|
||||
{ id: 'inspect-brk-search', type: 'string', deprecates: 'debugBrkSearch' },
|
||||
{ id: 'export-default-configuration', type: 'string' },
|
||||
{ id: 'install-source', type: 'string' },
|
||||
{ id: 'driver', type: 'string' },
|
||||
{ id: 'logExtensionHostCommunication', type: 'boolean' },
|
||||
{ id: 'skip-getting-started', type: 'boolean' },
|
||||
{ id: 'skip-release-notes', type: 'boolean' },
|
||||
{ id: 'sticky-quickopen', type: 'boolean' },
|
||||
{ id: 'disable-restore-windows', type: 'boolean' },
|
||||
{ id: 'disable-telemetry', type: 'boolean' },
|
||||
{ id: 'disable-updates', type: 'boolean' },
|
||||
{ id: 'disable-crash-reporter', type: 'boolean' },
|
||||
{ id: 'skip-add-to-recently-opened', type: 'boolean' },
|
||||
{ id: 'unity-launch', type: 'boolean' },
|
||||
{ id: 'open-url', type: 'boolean' },
|
||||
{ id: 'file-write', type: 'boolean' },
|
||||
{ id: 'file-chmod', type: 'boolean' },
|
||||
{ id: 'driver-verbose', type: 'boolean' },
|
||||
{ id: 'force', type: 'boolean' },
|
||||
{ id: 'trace-category-filter', type: 'string' },
|
||||
{ id: 'trace-options', type: 'string' },
|
||||
{ id: '_', type: 'string' },
|
||||
'extensions-dir': { type: 'string', deprecates: 'extensionHomePath', cat: 'e', args: 'dir', description: localize('extensionHomePath', "Set the root path for extensions.") },
|
||||
'builtin-extensions-dir': { type: 'string' },
|
||||
'list-extensions': { type: 'boolean', cat: 'e', description: localize('listExtensions', "List the installed extensions.") },
|
||||
'show-versions': { type: 'boolean', cat: 'e', description: localize('showVersions', "Show versions of installed extensions, when using --list-extension.") },
|
||||
'category': { type: 'string', cat: 'e', description: localize('category', "Filters installed extensions by provided category, when using --list-extension.") },
|
||||
'install-extension': { type: 'string[]', cat: 'e', args: 'extension-id | path-to-vsix', description: localize('installExtension', "Installs or updates the extension. Use `--force` argument to avoid prompts.") },
|
||||
'uninstall-extension': { type: 'string[]', cat: 'e', args: 'extension-id', description: localize('uninstallExtension', "Uninstalls an extension.") },
|
||||
'enable-proposed-api': { type: 'string[]', cat: 'e', args: 'extension-id', description: localize('experimentalApis', "Enables proposed API features for extensions. Can receive one or more extension IDs to enable individually.") },
|
||||
|
||||
'verbose': { type: 'boolean', cat: 't', description: localize('verbose', "Print verbose output (implies --wait).") },
|
||||
'log': { type: 'string', cat: 't', args: 'level', description: localize('log', "Log level to use. Default is 'info'. Allowed values are 'critical', 'error', 'warn', 'info', 'debug', 'trace', 'off'.") },
|
||||
'status': { type: 'boolean', alias: 's', cat: 't', description: localize('status', "Print process usage and diagnostics information.") },
|
||||
'prof-startup': { type: 'boolean', cat: 't', description: localize('prof-startup', "Run CPU profiler during startup") },
|
||||
'prof-append-timers': { type: 'string' },
|
||||
'prof-startup-prefix': { type: 'string' },
|
||||
'disable-extensions': { type: 'boolean', deprecates: 'disableExtensions', cat: 't', description: localize('disableExtensions', "Disable all installed extensions.") },
|
||||
'disable-extension': { type: 'string[]', cat: 't', args: 'extension-id', description: localize('disableExtension', "Disable an extension.") },
|
||||
|
||||
'inspect-extensions': { type: 'string', deprecates: 'debugPluginHost', args: 'port', cat: 't', description: localize('inspect-extensions', "Allow debugging and profiling of extensions. Check the developer tools for the connection URI.") },
|
||||
'inspect-brk-extensions': { type: 'string', deprecates: 'debugBrkPluginHost', args: 'port', cat: 't', description: localize('inspect-brk-extensions', "Allow debugging and profiling of extensions with the extension host being paused after start. Check the developer tools for the connection URI.") },
|
||||
'disable-gpu': { type: 'boolean', cat: 't', description: localize('disableGPU', "Disable GPU hardware acceleration.") },
|
||||
'max-memory': { type: 'string', cat: 't', description: localize('maxMemory', "Max memory size for a window (in Mbytes).") },
|
||||
|
||||
'remote': { type: 'string' },
|
||||
'locate-extension': { type: 'string[]' },
|
||||
'extensionDevelopmentPath': { type: 'string[]' },
|
||||
'extensionTestsPath': { type: 'string' },
|
||||
'extension-development-confirm-save': { type: 'boolean' },
|
||||
'debugId': { type: 'string' },
|
||||
'inspect-search': { type: 'string', deprecates: 'debugSearch' },
|
||||
'inspect-brk-search': { type: 'string', deprecates: 'debugBrkSearch' },
|
||||
'export-default-configuration': { type: 'string' },
|
||||
'install-source': { type: 'string' },
|
||||
'driver': { type: 'string' },
|
||||
'logExtensionHostCommunication': { type: 'boolean' },
|
||||
'skip-getting-started': { type: 'boolean' },
|
||||
'skip-release-notes': { type: 'boolean' },
|
||||
'sticky-quickopen': { type: 'boolean' },
|
||||
'disable-restore-windows': { type: 'boolean' },
|
||||
'disable-telemetry': { type: 'boolean' },
|
||||
'disable-updates': { type: 'boolean' },
|
||||
'disable-crash-reporter': { type: 'boolean' },
|
||||
'disable-user-env-probe': { type: 'boolean' },
|
||||
'skip-add-to-recently-opened': { type: 'boolean' },
|
||||
'unity-launch': { type: 'boolean' },
|
||||
'open-url': { type: 'boolean' },
|
||||
'file-write': { type: 'boolean' },
|
||||
'file-chmod': { type: 'boolean' },
|
||||
'driver-verbose': { type: 'boolean' },
|
||||
'force': { type: 'boolean' },
|
||||
'trace': { type: 'boolean' },
|
||||
'trace-category-filter': { type: 'string' },
|
||||
'trace-options': { type: 'string' },
|
||||
'disable-inspect': { type: 'boolean' },
|
||||
'force-user-env': { type: 'boolean' },
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
{ id: 'command', type: 'string', alias: 'c', cat: 'o', args: 'command-name', description: localize('commandParameter', 'Name of command to run') },
|
||||
{ id: 'database', type: 'string', alias: 'D', cat: 'o', args: 'database', description: localize('databaseParameter', 'Database name') },
|
||||
{ id: 'server', type: 'string', alias: 'S', cat: 'o', args: 'server', description: localize('serverParameter', 'Server name') },
|
||||
{ id: 'user', type: 'string', alias: 'U', cat: 'o', args: 'user-name', description: localize('userParameter', 'User name for server connection') },
|
||||
{ id: 'aad', type: 'boolean', cat: 'o', description: localize('aadParameter', 'Use Azure Active Directory authentication for server connection') },
|
||||
{ id: 'integrated', type: 'boolean', alias: 'E', cat: 'o', description: localize('integratedAuthParameter', 'Use Integrated authentication for server connection') },
|
||||
'command': { type: 'string', alias: 'c', cat: 'o', args: 'command-name', description: localize('commandParameter', 'Name of command to run') },
|
||||
'database': { type: 'string', alias: 'D', cat: 'o', args: 'database', description: localize('databaseParameter', 'Database name') },
|
||||
'server': { type: 'string', alias: 'S', cat: 'o', args: 'server', description: localize('serverParameter', 'Server name') },
|
||||
'user': { type: 'string', alias: 'U', cat: 'o', args: 'user-name', description: localize('userParameter', 'User name for server connection') },
|
||||
'aad': { type: 'boolean', cat: 'o', description: localize('aadParameter', 'Use Azure Active Directory authentication for server connection') },
|
||||
'integrated': { type: 'boolean', alias: 'E', cat: 'o', description: localize('integratedAuthParameter', 'Use Integrated authentication for server connection') },
|
||||
// {{SQL CARBON EDIT}} - End
|
||||
|
||||
{ id: 'js-flags', type: 'string' }, // chrome js flags
|
||||
{ id: 'nolazy', type: 'boolean' }, // node inspect
|
||||
];
|
||||
'js-flags': { type: 'string' }, // chrome js flags
|
||||
'nolazy': { type: 'boolean' }, // node inspect
|
||||
'_urls': { type: 'string[]' },
|
||||
|
||||
export function parseArgs(args: string[], isOptionSupported = (_: Option) => true): ParsedArgs {
|
||||
_: { type: 'string[]' } // main arguments
|
||||
};
|
||||
|
||||
export interface ErrorReporter {
|
||||
onUnknownOption(id: string): void;
|
||||
onMultipleValues(id: string, usedValue: string): void;
|
||||
}
|
||||
|
||||
const ignoringReporter: ErrorReporter = {
|
||||
onUnknownOption: () => { },
|
||||
onMultipleValues: () => { }
|
||||
};
|
||||
|
||||
export function parseArgs<T>(args: string[], options: OptionDescriptions<T>, errorReporter: ErrorReporter = ignoringReporter): T {
|
||||
const alias: { [key: string]: string } = {};
|
||||
const string: string[] = [];
|
||||
const boolean: string[] = [];
|
||||
for (let o of options) {
|
||||
if (isOptionSupported(o)) {
|
||||
if (o.alias) {
|
||||
alias[o.id] = o.alias;
|
||||
}
|
||||
for (let optionId in options) {
|
||||
if (optionId[0] === '_') {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (o.type === 'string') {
|
||||
string.push(o.id);
|
||||
const o = options[optionId];
|
||||
if (o.alias) {
|
||||
alias[optionId] = o.alias;
|
||||
}
|
||||
|
||||
if (o.type === 'string' || o.type === 'string[]') {
|
||||
string.push(optionId);
|
||||
if (o.deprecates) {
|
||||
string.push(o.deprecates);
|
||||
}
|
||||
} else if (o.type === 'boolean') {
|
||||
boolean.push(o.id);
|
||||
boolean.push(optionId);
|
||||
if (o.deprecates) {
|
||||
boolean.push(o.deprecates);
|
||||
}
|
||||
@@ -133,23 +166,51 @@ export function parseArgs(args: string[], isOptionSupported = (_: Option) => tru
|
||||
}
|
||||
// remote aliases to avoid confusion
|
||||
const parsedArgs = minimist(args, { string, boolean, alias });
|
||||
for (const o of options) {
|
||||
|
||||
const cleanedArgs: any = {};
|
||||
|
||||
// https://github.com/microsoft/vscode/issues/58177
|
||||
cleanedArgs._ = parsedArgs._.filter(arg => arg.length > 0);
|
||||
delete parsedArgs._;
|
||||
|
||||
for (let optionId in options) {
|
||||
const o = options[optionId];
|
||||
if (o.alias) {
|
||||
delete parsedArgs[o.alias];
|
||||
}
|
||||
if (o.deprecates && parsedArgs.hasOwnProperty(o.deprecates) && !parsedArgs[o.id]) {
|
||||
parsedArgs[o.id] = parsedArgs[o.deprecates];
|
||||
|
||||
let val = parsedArgs[optionId];
|
||||
if (o.deprecates && parsedArgs.hasOwnProperty(o.deprecates)) {
|
||||
if (!val) {
|
||||
val = parsedArgs[o.deprecates];
|
||||
}
|
||||
delete parsedArgs[o.deprecates];
|
||||
}
|
||||
|
||||
if (val) {
|
||||
if (o.type === 'string[]') {
|
||||
if (val && !Array.isArray(val)) {
|
||||
val = [val];
|
||||
}
|
||||
} else if (o.type === 'string') {
|
||||
if (Array.isArray(val)) {
|
||||
val = val.pop(); // take the last
|
||||
errorReporter.onMultipleValues(optionId, val);
|
||||
}
|
||||
}
|
||||
cleanedArgs[optionId] = val;
|
||||
}
|
||||
delete parsedArgs[optionId];
|
||||
}
|
||||
|
||||
// https://github.com/microsoft/vscode/issues/58177
|
||||
parsedArgs._ = parsedArgs._.filter(arg => arg.length > 0);
|
||||
for (let key in parsedArgs) {
|
||||
errorReporter.onUnknownOption(key);
|
||||
}
|
||||
|
||||
return parsedArgs;
|
||||
return cleanedArgs;
|
||||
}
|
||||
|
||||
function formatUsage(option: Option) {
|
||||
function formatUsage(optionId: string, option: Option<any>) {
|
||||
let args = '';
|
||||
if (option.args) {
|
||||
if (Array.isArray(option.args)) {
|
||||
@@ -159,30 +220,37 @@ function formatUsage(option: Option) {
|
||||
}
|
||||
}
|
||||
if (option.alias) {
|
||||
return `-${option.alias} --${option.id}${args}`;
|
||||
return `-${option.alias} --${optionId}${args}`;
|
||||
}
|
||||
return `--${option.id}${args}`;
|
||||
return `--${optionId}${args}`;
|
||||
}
|
||||
|
||||
// exported only for testing
|
||||
export function formatOptions(docOptions: Option[], columns: number): string[] {
|
||||
let usageTexts = docOptions.map(formatUsage);
|
||||
let argLength = Math.max.apply(null, usageTexts.map(k => k.length)) + 2/*left padding*/ + 1/*right padding*/;
|
||||
export function formatOptions(options: OptionDescriptions<any>, columns: number): string[] {
|
||||
let maxLength = 0;
|
||||
let usageTexts: [string, string][] = [];
|
||||
for (const optionId in options) {
|
||||
const o = options[optionId];
|
||||
const usageText = formatUsage(optionId, o);
|
||||
maxLength = Math.max(maxLength, usageText.length);
|
||||
usageTexts.push([usageText, o.description!]);
|
||||
}
|
||||
let argLength = maxLength + 2/*left padding*/ + 1/*right padding*/;
|
||||
if (columns - argLength < 25) {
|
||||
// Use a condensed version on narrow terminals
|
||||
return docOptions.reduce<string[]>((r, o, i) => r.concat([` ${usageTexts[i]}`, ` ${o.description}`]), []);
|
||||
return usageTexts.reduce<string[]>((r, ut) => r.concat([` ${ut[0]}`, ` ${ut[1]}`]), []);
|
||||
}
|
||||
let descriptionColumns = columns - argLength - 1;
|
||||
let result: string[] = [];
|
||||
docOptions.forEach((o, i) => {
|
||||
let usage = usageTexts[i];
|
||||
let wrappedDescription = wrapText(o.description!, descriptionColumns);
|
||||
for (const ut of usageTexts) {
|
||||
let usage = ut[0];
|
||||
let wrappedDescription = wrapText(ut[1], descriptionColumns);
|
||||
let keyPadding = indent(argLength - usage.length - 2/*left padding*/);
|
||||
result.push(' ' + usage + keyPadding + wrappedDescription[0]);
|
||||
for (let i = 1; i < wrappedDescription.length; i++) {
|
||||
result.push(indent(argLength) + wrappedDescription[i]);
|
||||
}
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -201,7 +269,7 @@ function wrapText(text: string, columns: number): string[] {
|
||||
return lines;
|
||||
}
|
||||
|
||||
export function buildHelpMessage(productName: string, executableName: string, version: string, isOptionSupported = (_: Option) => true, isPipeSupported = true): string {
|
||||
export function buildHelpMessage(productName: string, executableName: string, version: string, options: OptionDescriptions<any>, isPipeSupported = true): string {
|
||||
const columns = (process.stdout).isTTY && (process.stdout).columns || 80;
|
||||
|
||||
let help = [`${productName} ${version}`];
|
||||
@@ -216,11 +284,23 @@ export function buildHelpMessage(productName: string, executableName: string, ve
|
||||
}
|
||||
help.push('');
|
||||
}
|
||||
for (let helpCategoryKey in helpCategories) {
|
||||
const optionsByCategory: { [P in keyof typeof helpCategories]?: OptionDescriptions<any> } = {};
|
||||
for (const optionId in options) {
|
||||
const o = options[optionId];
|
||||
if (o.description && o.cat) {
|
||||
let optionsByCat = optionsByCategory[o.cat];
|
||||
if (!optionsByCat) {
|
||||
optionsByCategory[o.cat] = optionsByCat = {};
|
||||
}
|
||||
optionsByCat[optionId] = o;
|
||||
}
|
||||
}
|
||||
|
||||
for (let helpCategoryKey in optionsByCategory) {
|
||||
const key = <keyof typeof helpCategories>helpCategoryKey;
|
||||
|
||||
let categoryOptions = options.filter(o => !!o.description && o.cat === key && isOptionSupported(o));
|
||||
if (categoryOptions.length) {
|
||||
let categoryOptions = optionsByCategory[key];
|
||||
if (categoryOptions) {
|
||||
help.push(helpCategories[key]);
|
||||
help.push(...formatOptions(categoryOptions, columns));
|
||||
help.push('');
|
||||
@@ -233,32 +313,6 @@ export function buildVersionMessage(version: string | undefined, commit: string
|
||||
return `${version || localize('unknownVersion', "Unknown version")}\n${commit || localize('unknownCommit', "Unknown commit")}\n${process.arch}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts an argument into an array
|
||||
* @param arg a argument value. Can be undefined, an entry or an array
|
||||
*/
|
||||
export function asArray(arg: string | string[] | undefined): string[] {
|
||||
if (arg) {
|
||||
if (Array.isArray(arg)) {
|
||||
return arg;
|
||||
}
|
||||
return [arg];
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether an argument is present.
|
||||
*/
|
||||
export function hasArgs(arg: string | string[] | undefined): boolean {
|
||||
if (arg) {
|
||||
if (Array.isArray(arg)) {
|
||||
return !!arg.length;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
export function addArg(argv: string[], ...args: string[]): string[] {
|
||||
const endOfArgsMarkerIndex = argv.indexOf('--');
|
||||
|
||||
@@ -8,9 +8,19 @@ import { firstIndex } from 'vs/base/common/arrays';
|
||||
import { localize } from 'vs/nls';
|
||||
import { ParsedArgs } from '../common/environment';
|
||||
import { MIN_MAX_MEMORY_SIZE_MB } from 'vs/platform/files/common/files';
|
||||
import { parseArgs } from 'vs/platform/environment/node/argv';
|
||||
import { parseArgs, ErrorReporter, OPTIONS } from 'vs/platform/environment/node/argv';
|
||||
|
||||
function validate(args: ParsedArgs): ParsedArgs {
|
||||
function parseAndValidate(cmdLineArgs: string[], reportWarnings: boolean): ParsedArgs {
|
||||
const errorReporter: ErrorReporter = {
|
||||
onUnknownOption: (id) => {
|
||||
console.warn(localize('unknownOption', "Option '{0}' is unknown. Ignoring.", id));
|
||||
},
|
||||
onMultipleValues: (id, val) => {
|
||||
console.warn(localize('multipleValues', "Option '{0}' is defined more than once. Using value '{1}.'", id, val));
|
||||
}
|
||||
};
|
||||
|
||||
const args = parseArgs(cmdLineArgs, OPTIONS, reportWarnings ? errorReporter : undefined);
|
||||
if (args.goto) {
|
||||
args._.forEach(arg => assert(/^(\w:)?[^:]+(:\d*){0,2}$/.test(arg), localize('gotoValidation', "Arguments in `--goto` mode should be in the format of `FILE(:LINE(:CHARACTER))`.")));
|
||||
}
|
||||
@@ -42,7 +52,9 @@ export function parseMainProcessArgv(processArgv: string[]): ParsedArgs {
|
||||
args = stripAppPath(args) || [];
|
||||
}
|
||||
|
||||
return validate(parseArgs(args));
|
||||
// If called from CLI, don't report warnings as they are already reported.
|
||||
let reportWarnings = !process.env['VSCODE_CLI'];
|
||||
return parseAndValidate(args, reportWarnings);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -55,5 +67,5 @@ export function parseCLIProcessArgv(processArgv: string[]): ParsedArgs {
|
||||
args = stripAppPath(args) || [];
|
||||
}
|
||||
|
||||
return validate(parseArgs(args));
|
||||
return parseAndValidate(args, true);
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@ import { toLocalISOString } from 'vs/base/common/date';
|
||||
import { isWindows, isLinux } from 'vs/base/common/platform';
|
||||
import { getPathFromAmdModule } from 'vs/base/common/amd';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
|
||||
|
||||
// Read this before there's any chance it is overwritten
|
||||
// Related to https://github.com/Microsoft/vscode/issues/30624
|
||||
@@ -77,7 +76,7 @@ function getCLIPath(execPath: string, appRoot: string, isBuilt: boolean): string
|
||||
|
||||
export class EnvironmentService implements IEnvironmentService {
|
||||
|
||||
_serviceBrand!: ServiceIdentifier<any>;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
get args(): ParsedArgs { return this._args; }
|
||||
|
||||
@@ -105,9 +104,6 @@ export class EnvironmentService implements IEnvironmentService {
|
||||
return parseUserDataDir(this._args, process);
|
||||
}
|
||||
|
||||
@memoize
|
||||
get webUserDataHome(): URI { return URI.file(parsePathArg(this._args['web-user-data-dir'], process) || this.userDataPath); }
|
||||
|
||||
get appNameLong(): string { return product.nameLong; }
|
||||
|
||||
get appQuality(): string | undefined { return product.quality; }
|
||||
@@ -199,11 +195,6 @@ export class EnvironmentService implements IEnvironmentService {
|
||||
}
|
||||
return URI.file(path.normalize(p));
|
||||
});
|
||||
} else if (s) {
|
||||
if (/^[^:/?#]+?:\/\//.test(s)) {
|
||||
return [URI.parse(s)];
|
||||
}
|
||||
return [URI.file(path.normalize(s))];
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
@@ -297,7 +288,7 @@ function parseDebugPort(debugArg: string | undefined, debugBrkArg: string | unde
|
||||
return { port, break: brk, debugId };
|
||||
}
|
||||
|
||||
function parsePathArg(arg: string | undefined, process: NodeJS.Process): string | undefined {
|
||||
export function parsePathArg(arg: string | undefined, process: NodeJS.Process): string | undefined {
|
||||
if (!arg) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
|
||||
import * as assert from 'assert';
|
||||
import * as path from 'vs/base/common/path';
|
||||
import { parseArgs } from 'vs/platform/environment/node/argv';
|
||||
import { parseArgs, OPTIONS } from 'vs/platform/environment/node/argv';
|
||||
import { parseExtensionHostPort, parseUserDataDir } from 'vs/platform/environment/node/environmentService';
|
||||
|
||||
suite('EnvironmentService', () => {
|
||||
|
||||
test('parseExtensionHostPort when built', () => {
|
||||
const parse = (a: string[]) => parseExtensionHostPort(parseArgs(a), true);
|
||||
const parse = (a: string[]) => parseExtensionHostPort(parseArgs(a, OPTIONS), true);
|
||||
|
||||
assert.deepEqual(parse([]), { port: null, break: false, debugId: undefined });
|
||||
assert.deepEqual(parse(['--debugPluginHost']), { port: null, break: false, debugId: undefined });
|
||||
@@ -28,7 +28,7 @@ suite('EnvironmentService', () => {
|
||||
});
|
||||
|
||||
test('parseExtensionHostPort when unbuilt', () => {
|
||||
const parse = (a: string[]) => parseExtensionHostPort(parseArgs(a), false);
|
||||
const parse = (a: string[]) => parseExtensionHostPort(parseArgs(a, OPTIONS), false);
|
||||
|
||||
assert.deepEqual(parse([]), { port: 5870, break: false, debugId: undefined });
|
||||
assert.deepEqual(parse(['--debugPluginHost']), { port: 5870, break: false, debugId: undefined });
|
||||
@@ -45,7 +45,7 @@ suite('EnvironmentService', () => {
|
||||
});
|
||||
|
||||
test('userDataPath', () => {
|
||||
const parse = (a: string[], b: { cwd: () => string, env: { [key: string]: string } }) => parseUserDataDir(parseArgs(a), <any>b);
|
||||
const parse = (a: string[], b: { cwd: () => string, env: { [key: string]: string } }) => parseUserDataDir(parseArgs(a, OPTIONS), <any>b);
|
||||
|
||||
assert.equal(parse(['--user-data-dir', './dir'], { cwd: () => '/foo', env: {} }), path.resolve('/foo/dir'),
|
||||
'should use cwd when --user-data-dir is specified');
|
||||
@@ -55,11 +55,11 @@ suite('EnvironmentService', () => {
|
||||
|
||||
// https://github.com/microsoft/vscode/issues/78440
|
||||
test('careful with boolean file names', function () {
|
||||
let actual = parseArgs(['-r', 'arg.txt']);
|
||||
let actual = parseArgs(['-r', 'arg.txt'], OPTIONS);
|
||||
assert(actual['reuse-window']);
|
||||
assert.deepEqual(actual._, ['arg.txt']);
|
||||
|
||||
actual = parseArgs(['-r', 'true.txt']);
|
||||
actual = parseArgs(['-r', 'true.txt'], OPTIONS);
|
||||
assert(actual['reuse-window']);
|
||||
assert.deepEqual(actual._, ['true.txt']);
|
||||
});
|
||||
|
||||
@@ -375,7 +375,7 @@ interface IRawExtensionsReport {
|
||||
|
||||
export class ExtensionGalleryService implements IExtensionGalleryService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private extensionsGalleryUrl: string | undefined;
|
||||
private extensionsControlUrl: string | undefined;
|
||||
|
||||
@@ -150,7 +150,7 @@ export interface ITranslation {
|
||||
}
|
||||
|
||||
export interface IExtensionGalleryService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
isEnabled(): boolean;
|
||||
query(token: CancellationToken): Promise<IPager<IGalleryExtension>>;
|
||||
query(options: IQueryOptions, token: CancellationToken): Promise<IPager<IGalleryExtension>>;
|
||||
@@ -190,7 +190,7 @@ export const INSTALL_ERROR_MALICIOUS = 'malicious';
|
||||
export const INSTALL_ERROR_INCOMPATIBLE = 'incompatible';
|
||||
|
||||
export interface IExtensionManagementService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
onInstallExtension: Event<InstallExtensionEvent>;
|
||||
onDidInstallExtension: Event<DidInstallExtensionEvent>;
|
||||
|
||||
@@ -77,7 +77,7 @@ export class ExtensionManagementChannel implements IServerChannel {
|
||||
|
||||
export class ExtensionManagementChannelClient implements IExtensionManagementService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
constructor(
|
||||
private readonly channel: IChannel,
|
||||
|
||||
@@ -104,7 +104,7 @@ interface InstallableExtension {
|
||||
|
||||
export class ExtensionManagementService extends Disposable implements IExtensionManagementService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private systemExtensionsPath: string;
|
||||
private extensionsPath: string;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import * as assert from 'assert';
|
||||
import * as os from 'os';
|
||||
import { EnvironmentService } from 'vs/platform/environment/node/environmentService';
|
||||
import { parseArgs } from 'vs/platform/environment/node/argv';
|
||||
import { parseArgs, OPTIONS } from 'vs/platform/environment/node/argv';
|
||||
import { getRandomTestPath } from 'vs/base/test/node/testUtils';
|
||||
import { join } from 'vs/base/common/path';
|
||||
import { mkdirp, RimRafMode, rimraf } from 'vs/base/node/pfs';
|
||||
@@ -51,7 +51,7 @@ suite('Extension Gallery Service', () => {
|
||||
|
||||
test('marketplace machine id', () => {
|
||||
const args = ['--user-data-dir', marketplaceHome];
|
||||
const environmentService = new EnvironmentService(parseArgs(args), process.execPath);
|
||||
const environmentService = new EnvironmentService(parseArgs(args, OPTIONS), process.execPath);
|
||||
|
||||
return resolveMarketplaceHeaders(pkg.version, environmentService, fileService).then(headers => {
|
||||
assert.ok(isUUID(headers['X-Market-User-Id']));
|
||||
@@ -61,7 +61,6 @@ suite('Extension Gallery Service', () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
test('sortByField', () => { // {{SQL CARBON EDIT}} add test
|
||||
let a: {
|
||||
extensionId: string | undefined;
|
||||
|
||||
@@ -7,7 +7,6 @@ import { Disposable, IDisposable, toDisposable, dispose, DisposableStore } from
|
||||
import { IFileService, IResolveFileOptions, FileChangesEvent, FileOperationEvent, IFileSystemProviderRegistrationEvent, IFileSystemProvider, IFileStat, IResolveFileResult, ICreateFileOptions, IFileSystemProviderActivationEvent, FileOperationError, FileOperationResult, FileOperation, FileSystemProviderCapabilities, FileType, toFileSystemProviderErrorCode, FileSystemProviderErrorCode, IStat, IFileStatWithMetadata, IResolveMetadataFileOptions, etag, hasReadWriteCapability, hasFileFolderCopyCapability, hasOpenReadWriteCloseCapability, toFileOperationResult, IFileSystemProviderWithOpenReadWriteCloseCapability, IFileSystemProviderWithFileReadWriteCapability, IResolveFileResultWithMetadata, IWatchOptions, IWriteFileOptions, IReadFileOptions, IFileStreamContent, IFileContent, ETAG_DISABLED } from 'vs/platform/files/common/files';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { isAbsolutePath, dirname, basename, joinPath, isEqual, isEqualOrParent } from 'vs/base/common/resources';
|
||||
import { localize } from 'vs/nls';
|
||||
import { TernarySearchTree } from 'vs/base/common/map';
|
||||
@@ -21,7 +20,7 @@ import { Schemas } from 'vs/base/common/network';
|
||||
|
||||
export class FileService extends Disposable implements IFileService {
|
||||
|
||||
_serviceBrand!: ServiceIdentifier<any>;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private readonly BUFFER_SIZE = 64 * 1024;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import { sep } from 'vs/base/common/path';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import * as glob from 'vs/base/common/glob';
|
||||
import { createDecorator, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { Event } from 'vs/base/common/event';
|
||||
import { startsWithIgnoreCase } from 'vs/base/common/strings';
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
@@ -18,7 +18,7 @@ export const IFileService = createDecorator<IFileService>('fileService');
|
||||
|
||||
export interface IFileService {
|
||||
|
||||
_serviceBrand: ServiceIdentifier<any>;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
/**
|
||||
* An event that is fired when a file system provider is added or removed
|
||||
|
||||
@@ -38,7 +38,7 @@ export class DiskFileSystemProvider extends Disposable implements IFileSystemPro
|
||||
|
||||
onDidChangeCapabilities: Event<void> = Event.None;
|
||||
|
||||
protected _capabilities: FileSystemProviderCapabilities;
|
||||
protected _capabilities: FileSystemProviderCapabilities | undefined;
|
||||
get capabilities(): FileSystemProviderCapabilities {
|
||||
if (!this._capabilities) {
|
||||
this._capabilities =
|
||||
|
||||
@@ -13,7 +13,7 @@ import { ThrottledDelayer } from 'vs/base/common/async';
|
||||
import { join, basename } from 'vs/base/common/path';
|
||||
|
||||
export class FileWatcher extends Disposable {
|
||||
private isDisposed: boolean;
|
||||
private isDisposed: boolean | undefined;
|
||||
|
||||
private fileChangesDelayer: ThrottledDelayer<void> = this._register(new ThrottledDelayer<void>(CHANGE_BUFFER_DELAY * 2 /* sync on delay from underlying library */));
|
||||
private fileChangesBuffer: IDiskFileChange[] = [];
|
||||
@@ -125,4 +125,4 @@ export class FileWatcher extends Disposable {
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,8 +36,8 @@ export class NsfwWatcherService implements IWatcherService {
|
||||
private static readonly FS_EVENT_DELAY = 50; // aggregate and only emit events when changes have stopped for this duration (in ms)
|
||||
|
||||
private _pathWatchers: { [watchPath: string]: IPathWatcher } = {};
|
||||
private _verboseLogging: boolean;
|
||||
private enospcErrorLogged: boolean;
|
||||
private _verboseLogging: boolean | undefined;
|
||||
private enospcErrorLogged: boolean | undefined;
|
||||
|
||||
private _onWatchEvent = new Emitter<IDiskFileChange[]>();
|
||||
readonly onWatchEvent = this._onWatchEvent.event;
|
||||
|
||||
@@ -12,9 +12,10 @@ import { IWatcherRequest } from 'vs/platform/files/node/watcher/nsfw/watcher';
|
||||
import { getPathFromAmdModule } from 'vs/base/common/amd';
|
||||
|
||||
export class FileWatcher extends Disposable {
|
||||
|
||||
private static readonly MAX_RESTARTS = 5;
|
||||
|
||||
private service: WatcherChannelClient;
|
||||
private service: WatcherChannelClient | undefined;
|
||||
private isDisposed: boolean;
|
||||
private restartCounter: number;
|
||||
|
||||
@@ -77,7 +78,7 @@ export class FileWatcher extends Disposable {
|
||||
|
||||
setVerboseLogging(verboseLogging: boolean): void {
|
||||
this.verboseLogging = verboseLogging;
|
||||
if (!this.isDisposed) {
|
||||
if (!this.isDisposed && this.service) {
|
||||
this.service.setVerboseLogging(verboseLogging);
|
||||
}
|
||||
}
|
||||
@@ -89,7 +90,9 @@ export class FileWatcher extends Disposable {
|
||||
setFolders(folders: IWatcherRequest[]): void {
|
||||
this.folders = folders;
|
||||
|
||||
this.service.setRoots(folders);
|
||||
if (this.service) {
|
||||
this.service.setRoots(folders);
|
||||
}
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
|
||||
@@ -37,11 +37,11 @@ export class ChokidarWatcherService implements IWatcherService {
|
||||
|
||||
private _pollingInterval?: number;
|
||||
private _usePolling?: boolean;
|
||||
private _verboseLogging: boolean;
|
||||
private _verboseLogging: boolean | undefined;
|
||||
|
||||
private spamCheckStartTime: number;
|
||||
private spamWarningLogged: boolean;
|
||||
private enospcErrorLogged: boolean;
|
||||
private spamCheckStartTime: number | undefined;
|
||||
private spamWarningLogged: boolean | undefined;
|
||||
private enospcErrorLogged: boolean | undefined;
|
||||
|
||||
private _onWatchEvent = new Emitter<IDiskFileChange[]>();
|
||||
readonly onWatchEvent = this._onWatchEvent.event;
|
||||
@@ -231,7 +231,7 @@ export class ChokidarWatcherService implements IWatcherService {
|
||||
if (undeliveredFileEvents.length === 0) {
|
||||
this.spamWarningLogged = false;
|
||||
this.spamCheckStartTime = now;
|
||||
} else if (!this.spamWarningLogged && this.spamCheckStartTime + ChokidarWatcherService.EVENT_SPAM_WARNING_THRESHOLD < now) {
|
||||
} else if (!this.spamWarningLogged && typeof this.spamCheckStartTime === 'number' && this.spamCheckStartTime + ChokidarWatcherService.EVENT_SPAM_WARNING_THRESHOLD < now) {
|
||||
this.spamWarningLogged = true;
|
||||
this.warn(`Watcher is busy catching up with ${undeliveredFileEvents.length} file changes in 60 seconds. Latest changed path is "${event.path}"`);
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ export class FileWatcher extends Disposable {
|
||||
|
||||
private isDisposed: boolean;
|
||||
private restartCounter: number;
|
||||
private service: WatcherChannelClient;
|
||||
private service: WatcherChannelClient | undefined;
|
||||
|
||||
constructor(
|
||||
private folders: IWatcherRequest[],
|
||||
@@ -81,13 +81,18 @@ export class FileWatcher extends Disposable {
|
||||
|
||||
setVerboseLogging(verboseLogging: boolean): void {
|
||||
this.verboseLogging = verboseLogging;
|
||||
this.service.setVerboseLogging(verboseLogging);
|
||||
|
||||
if (this.service) {
|
||||
this.service.setVerboseLogging(verboseLogging);
|
||||
}
|
||||
}
|
||||
|
||||
setFolders(folders: IWatcherRequest[]): void {
|
||||
this.folders = folders;
|
||||
|
||||
this.service.setRoots(folders);
|
||||
if (this.service) {
|
||||
this.service.setRoots(folders);
|
||||
}
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
|
||||
@@ -47,7 +47,7 @@ export function isRecentFile(curr: IRecent): curr is IRecentFile {
|
||||
|
||||
|
||||
export interface IHistoryMainService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
onRecentlyOpenedChange: CommonEvent<void>;
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@ import { IEnvironmentService } from 'vs/platform/environment/common/environment'
|
||||
import { getSimpleWorkspaceLabel } from 'vs/platform/label/common/label';
|
||||
import { toStoreData, restoreRecentlyOpened, RecentlyOpenedStorageData } from 'vs/platform/history/common/historyStorage';
|
||||
import { exists } from 'vs/base/node/pfs';
|
||||
import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { ILifecycleService, LifecycleMainPhase } from 'vs/platform/lifecycle/electron-main/lifecycleMain';
|
||||
|
||||
export class HistoryMainService implements IHistoryMainService {
|
||||
@@ -40,7 +39,7 @@ export class HistoryMainService implements IHistoryMainService {
|
||||
|
||||
private static readonly recentlyOpenedStorageKey = 'openedPathsList';
|
||||
|
||||
_serviceBrand!: ServiceIdentifier<IHistoryMainService>;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private _onRecentlyOpenedChange = new Emitter<void>();
|
||||
readonly onRecentlyOpenedChange: CommonEvent<void> = this._onRecentlyOpenedChange.event;
|
||||
|
||||
@@ -23,39 +23,39 @@ export namespace _util {
|
||||
// --- interfaces ------
|
||||
|
||||
export interface IConstructorSignature0<T> {
|
||||
new(...services: { _serviceBrand: any; }[]): T;
|
||||
new(...services: { _serviceBrand: undefined; }[]): T;
|
||||
}
|
||||
|
||||
export interface IConstructorSignature1<A1, T> {
|
||||
new(first: A1, ...services: { _serviceBrand: any; }[]): T;
|
||||
new(first: A1, ...services: { _serviceBrand: undefined; }[]): T;
|
||||
}
|
||||
|
||||
export interface IConstructorSignature2<A1, A2, T> {
|
||||
new(first: A1, second: A2, ...services: { _serviceBrand: any; }[]): T;
|
||||
new(first: A1, second: A2, ...services: { _serviceBrand: undefined; }[]): T;
|
||||
}
|
||||
|
||||
export interface IConstructorSignature3<A1, A2, A3, T> {
|
||||
new(first: A1, second: A2, third: A3, ...services: { _serviceBrand: any; }[]): T;
|
||||
new(first: A1, second: A2, third: A3, ...services: { _serviceBrand: undefined; }[]): T;
|
||||
}
|
||||
|
||||
export interface IConstructorSignature4<A1, A2, A3, A4, T> {
|
||||
new(first: A1, second: A2, third: A3, fourth: A4, ...services: { _serviceBrand: any; }[]): T;
|
||||
new(first: A1, second: A2, third: A3, fourth: A4, ...services: { _serviceBrand: undefined; }[]): T;
|
||||
}
|
||||
|
||||
export interface IConstructorSignature5<A1, A2, A3, A4, A5, T> {
|
||||
new(first: A1, second: A2, third: A3, fourth: A4, fifth: A5, ...services: { _serviceBrand: any; }[]): T;
|
||||
new(first: A1, second: A2, third: A3, fourth: A4, fifth: A5, ...services: { _serviceBrand: undefined; }[]): T;
|
||||
}
|
||||
|
||||
export interface IConstructorSignature6<A1, A2, A3, A4, A5, A6, T> {
|
||||
new(first: A1, second: A2, third: A3, fourth: A4, fifth: A5, sixth: A6, ...services: { _serviceBrand: any; }[]): T;
|
||||
new(first: A1, second: A2, third: A3, fourth: A4, fifth: A5, sixth: A6, ...services: { _serviceBrand: undefined; }[]): T;
|
||||
}
|
||||
|
||||
export interface IConstructorSignature7<A1, A2, A3, A4, A5, A6, A7, T> {
|
||||
new(first: A1, second: A2, third: A3, fourth: A4, fifth: A5, sixth: A6, seventh: A7, ...services: { _serviceBrand: any; }[]): T;
|
||||
new(first: A1, second: A2, third: A3, fourth: A4, fifth: A5, sixth: A6, seventh: A7, ...services: { _serviceBrand: undefined; }[]): T;
|
||||
}
|
||||
|
||||
export interface IConstructorSignature8<A1, A2, A3, A4, A5, A6, A7, A8, T> {
|
||||
new(first: A1, second: A2, third: A3, fourth: A4, fifth: A5, sixth: A6, seventh: A7, eigth: A8, ...services: { _serviceBrand: any; }[]): T;
|
||||
new(first: A1, second: A2, third: A3, fourth: A4, fifth: A5, sixth: A6, seventh: A7, eigth: A8, ...services: { _serviceBrand: undefined; }[]): T;
|
||||
}
|
||||
|
||||
export interface ServicesAccessor {
|
||||
@@ -67,7 +67,7 @@ export const IInstantiationService = createDecorator<IInstantiationService>('ins
|
||||
|
||||
export interface IInstantiationService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
/**
|
||||
* Synchronously creates an instance that is denoted by
|
||||
|
||||
@@ -28,7 +28,7 @@ class CyclicDependencyError extends Error {
|
||||
|
||||
export class InstantiationService implements IInstantiationService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private readonly _services: ServiceCollection;
|
||||
private readonly _strict: boolean;
|
||||
|
||||
@@ -12,48 +12,48 @@ import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
|
||||
let IService1 = createDecorator<IService1>('service1');
|
||||
|
||||
interface IService1 {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
c: number;
|
||||
}
|
||||
|
||||
class Service1 implements IService1 {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
c = 1;
|
||||
}
|
||||
|
||||
let IService2 = createDecorator<IService2>('service2');
|
||||
|
||||
interface IService2 {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
d: boolean;
|
||||
}
|
||||
|
||||
class Service2 implements IService2 {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
d = true;
|
||||
}
|
||||
|
||||
let IService3 = createDecorator<IService3>('service3');
|
||||
|
||||
interface IService3 {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
s: string;
|
||||
}
|
||||
|
||||
class Service3 implements IService3 {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
s = 'farboo';
|
||||
}
|
||||
|
||||
let IDependentService = createDecorator<IDependentService>('dependentService');
|
||||
|
||||
interface IDependentService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
name: string;
|
||||
}
|
||||
|
||||
class DependentService implements IDependentService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
constructor(@IService1 service: IService1) {
|
||||
assert.equal(service.c, 1);
|
||||
}
|
||||
@@ -116,7 +116,7 @@ class DependentServiceTarget2 {
|
||||
|
||||
|
||||
class ServiceLoop1 implements IService1 {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
c = 1;
|
||||
|
||||
constructor(@IService2 s: IService2) {
|
||||
@@ -125,7 +125,7 @@ class ServiceLoop1 implements IService1 {
|
||||
}
|
||||
|
||||
class ServiceLoop2 implements IService2 {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
d = true;
|
||||
|
||||
constructor(@IService1 s: IService1) {
|
||||
@@ -364,7 +364,7 @@ suite('Instantiation Service', () => {
|
||||
let serviceInstanceCount = 0;
|
||||
|
||||
const CtorCounter = class implements Service1 {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
c = 1;
|
||||
constructor() {
|
||||
serviceInstanceCount += 1;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { createDecorator, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IChannel, IServerChannel } from 'vs/base/parts/ipc/common/ipc';
|
||||
import { Client } from 'vs/base/parts/ipc/electron-browser/ipc.electron-browser';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
@@ -12,7 +12,7 @@ export const IMainProcessService = createDecorator<IMainProcessService>('mainPro
|
||||
|
||||
export interface IMainProcessService {
|
||||
|
||||
_serviceBrand: ServiceIdentifier<any>;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
getChannel(channelName: string): IChannel;
|
||||
|
||||
@@ -21,7 +21,7 @@ export interface IMainProcessService {
|
||||
|
||||
export class MainProcessService extends Disposable implements IMainProcessService {
|
||||
|
||||
_serviceBrand!: ServiceIdentifier<any>;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private mainProcessConnection: Client;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { createDecorator, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { Client } from 'vs/base/parts/ipc/common/ipc.net';
|
||||
import { connect } from 'vs/base/parts/ipc/node/ipc.net';
|
||||
import { IWindowsService, IWindowService } from 'vs/platform/windows/common/windows';
|
||||
@@ -14,7 +14,7 @@ export const ISharedProcessService = createDecorator<ISharedProcessService>('sha
|
||||
|
||||
export interface ISharedProcessService {
|
||||
|
||||
_serviceBrand: ServiceIdentifier<any>;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
getChannel(channelName: string): IChannel;
|
||||
|
||||
@@ -23,7 +23,7 @@ export interface ISharedProcessService {
|
||||
|
||||
export class SharedProcessService implements ISharedProcessService {
|
||||
|
||||
_serviceBrand!: ServiceIdentifier<any>;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private withSharedProcessConnection: Promise<Client<string>>;
|
||||
|
||||
|
||||
@@ -6,11 +6,10 @@
|
||||
import { IChannel } from 'vs/base/parts/ipc/common/ipc';
|
||||
import { IIssueService, IssueReporterData, ProcessExplorerData } from 'vs/platform/issue/node/issue';
|
||||
import { IMainProcessService } from 'vs/platform/ipc/electron-browser/mainProcessService';
|
||||
import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
|
||||
|
||||
export class IssueService implements IIssueService {
|
||||
|
||||
_serviceBrand!: ServiceIdentifier<any>;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private channel: IChannel;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import { localize } from 'vs/nls';
|
||||
import * as objects from 'vs/base/common/objects';
|
||||
import { parseArgs } from 'vs/platform/environment/node/argv';
|
||||
import { parseArgs, OPTIONS } from 'vs/platform/environment/node/argv';
|
||||
import { IIssueService, IssueReporterData, IssueReporterFeatures, ProcessExplorerData } from 'vs/platform/issue/node/issue';
|
||||
import { BrowserWindow, ipcMain, screen, Event, dialog } from 'electron';
|
||||
import { ILaunchService } from 'vs/platform/launch/electron-main/launchService';
|
||||
@@ -21,7 +21,7 @@ import { listProcesses } from 'vs/base/node/ps';
|
||||
const DEFAULT_BACKGROUND_COLOR = '#1E1E1E';
|
||||
|
||||
export class IssueService implements IIssueService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
_issueWindow: BrowserWindow | null = null;
|
||||
_issueParentWindow: BrowserWindow | null = null;
|
||||
_processExplorerWindow: BrowserWindow | null = null;
|
||||
@@ -372,7 +372,7 @@ export class IssueService implements IIssueService {
|
||||
}
|
||||
|
||||
function toLauchUrl<T>(pathToHtml: string, windowConfiguration: T): string {
|
||||
const environment = parseArgs(process.argv);
|
||||
const environment = parseArgs(process.argv, OPTIONS);
|
||||
const config = objects.assign(environment, windowConfiguration);
|
||||
for (const keyValue of Object.keys(config)) {
|
||||
const key = keyValue as keyof typeof config;
|
||||
|
||||
@@ -87,7 +87,7 @@ export interface ProcessExplorerData extends WindowData {
|
||||
}
|
||||
|
||||
export interface IIssueService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
openReporter(data: IssueReporterData): Promise<void>;
|
||||
openProcessExplorer(data: ProcessExplorerData): Promise<void>;
|
||||
getSystemStatus(): Promise<string>;
|
||||
|
||||
@@ -24,7 +24,7 @@ interface CurrentChord {
|
||||
}
|
||||
|
||||
export abstract class AbstractKeybindingService extends Disposable implements IKeybindingService {
|
||||
public _serviceBrand: any;
|
||||
public _serviceBrand: undefined;
|
||||
|
||||
protected readonly _onDidUpdateKeybindings: Emitter<IKeybindingEvent> = this._register(new Emitter<IKeybindingEvent>());
|
||||
get onDidUpdateKeybindings(): Event<IKeybindingEvent> {
|
||||
|
||||
@@ -41,7 +41,7 @@ export interface IKeyboardEvent {
|
||||
export const IKeybindingService = createDecorator<IKeybindingService>('keybindingService');
|
||||
|
||||
export interface IKeybindingService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
onDidUpdateKeybindings: Event<IKeybindingEvent>;
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ import { ResolvedKeybindingItem } from 'vs/platform/keybinding/common/resolvedKe
|
||||
import { USLayoutResolvedKeybinding } from 'vs/platform/keybinding/common/usLayoutResolvedKeybinding';
|
||||
import { INotification, INotificationService, IPromptChoice, IPromptOptions, NoOpNotification, IStatusMessageOptions } from 'vs/platform/notification/common/notification';
|
||||
import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils';
|
||||
import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
|
||||
|
||||
function createContext(ctx: any) {
|
||||
return {
|
||||
@@ -132,7 +131,7 @@ suite('AbstractKeybindingService', () => {
|
||||
};
|
||||
|
||||
let notificationService: INotificationService = {
|
||||
_serviceBrand: {} as ServiceIdentifier<INotificationService>,
|
||||
_serviceBrand: undefined,
|
||||
notify: (notification: INotification) => {
|
||||
showMessageCalls.push({ sev: notification.severity, message: notification.message });
|
||||
return new NoOpNotification();
|
||||
|
||||
@@ -36,7 +36,7 @@ class MockKeybindingContextKey<T> implements IContextKey<T> {
|
||||
|
||||
export class MockContextKeyService implements IContextKeyService {
|
||||
|
||||
public _serviceBrand: any;
|
||||
public _serviceBrand: undefined;
|
||||
private _keys = new Map<string, IContextKey<any>>();
|
||||
|
||||
public dispose(): void {
|
||||
@@ -69,7 +69,7 @@ export class MockContextKeyService implements IContextKeyService {
|
||||
}
|
||||
|
||||
export class MockKeybindingService implements IKeybindingService {
|
||||
public _serviceBrand: any;
|
||||
public _serviceBrand: undefined;
|
||||
|
||||
public get onDidUpdateKeybindings(): Event<IKeybindingEvent> {
|
||||
return Event.None;
|
||||
|
||||
@@ -14,7 +14,7 @@ import { isEqualOrParent, basename } from 'vs/base/common/resources';
|
||||
import { endsWith } from 'vs/base/common/strings';
|
||||
|
||||
export interface ILabelService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
/**
|
||||
* Gets the human readable label for a uri.
|
||||
* If relative is passed returns a label relative to the workspace root that the uri belongs to.
|
||||
|
||||
@@ -8,7 +8,7 @@ import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IURLService } from 'vs/platform/url/common/url';
|
||||
import { IProcessEnvironment, isMacintosh } from 'vs/base/common/platform';
|
||||
import { ParsedArgs, IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { createDecorator, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { OpenContext, IWindowSettings } from 'vs/platform/windows/common/windows';
|
||||
import { IWindowsMainService, ICodeWindow } from 'vs/platform/windows/electron-main/windows';
|
||||
import { whenDeleted } from 'vs/base/node/pfs';
|
||||
@@ -17,7 +17,6 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { BrowserWindow, ipcMain, Event as IpcEvent, app } from 'electron';
|
||||
import { Event } from 'vs/base/common/event';
|
||||
import { hasArgs } from 'vs/platform/environment/node/argv';
|
||||
import { coalesce } from 'vs/base/common/arrays';
|
||||
import { IDiagnosticInfoOptions, IDiagnosticInfo, IRemoteDiagnosticInfo, IRemoteDiagnosticError } from 'vs/platform/diagnostics/common/diagnostics';
|
||||
import { IMainProcessInfo, IWindowInfo } from 'vs/platform/launch/common/launchService';
|
||||
@@ -53,7 +52,7 @@ function parseOpenUrl(args: ParsedArgs): URI[] {
|
||||
}
|
||||
|
||||
export interface ILaunchService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
start(args: ParsedArgs, userEnv: IProcessEnvironment): Promise<void>;
|
||||
getMainProcessId(): Promise<number>;
|
||||
getMainProcessInfo(): Promise<IMainProcessInfo>;
|
||||
@@ -94,7 +93,7 @@ export class LaunchChannel implements IServerChannel {
|
||||
|
||||
export class LaunchChannelClient implements ILaunchService {
|
||||
|
||||
_serviceBrand!: ServiceIdentifier<ILaunchService>;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
constructor(private channel: IChannel) { }
|
||||
|
||||
@@ -121,7 +120,7 @@ export class LaunchChannelClient implements ILaunchService {
|
||||
|
||||
export class LaunchService implements ILaunchService {
|
||||
|
||||
_serviceBrand!: ServiceIdentifier<ILaunchService>;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
constructor(
|
||||
@ILogService private readonly logService: ILogService,
|
||||
@@ -173,7 +172,7 @@ export class LaunchService implements ILaunchService {
|
||||
}
|
||||
|
||||
// Start without file/folder arguments
|
||||
else if (!hasArgs(args._) && !hasArgs(args['folder-uri']) && !hasArgs(args['file-uri'])) {
|
||||
else if (!args._.length && !args['folder-uri'] && !args['file-uri']) {
|
||||
let openNewWindow = false;
|
||||
|
||||
// Force new window
|
||||
|
||||
@@ -15,7 +15,7 @@ export interface IDimension {
|
||||
|
||||
export interface ILayoutService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
/**
|
||||
* The dimensions of the container.
|
||||
|
||||
@@ -3,15 +3,14 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { ShutdownReason, ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle';
|
||||
import { ShutdownReason } from 'vs/platform/lifecycle/common/lifecycle';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { AbstractLifecycleService } from 'vs/platform/lifecycle/common/lifecycleService';
|
||||
import { localize } from 'vs/nls';
|
||||
import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
|
||||
|
||||
export class BrowserLifecycleService extends AbstractLifecycleService {
|
||||
|
||||
_serviceBrand!: ServiceIdentifier<ILifecycleService>;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
constructor(
|
||||
@ILogService readonly logService: ILogService
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Event } from 'vs/base/common/event';
|
||||
import { createDecorator, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { isThenable } from 'vs/base/common/async';
|
||||
|
||||
export const ILifecycleService = createDecorator<ILifecycleService>('lifecycleService');
|
||||
@@ -123,7 +123,7 @@ export function LifecyclePhaseToString(phase: LifecyclePhase) {
|
||||
*/
|
||||
export interface ILifecycleService {
|
||||
|
||||
_serviceBrand: ServiceIdentifier<any>;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
/**
|
||||
* Value indicates how this window got loaded.
|
||||
@@ -167,7 +167,7 @@ export interface ILifecycleService {
|
||||
|
||||
export const NullLifecycleService: ILifecycleService = {
|
||||
|
||||
_serviceBrand: null as any,
|
||||
_serviceBrand: undefined,
|
||||
|
||||
onBeforeShutdown: Event.None,
|
||||
onWillShutdown: Event.None,
|
||||
|
||||
@@ -9,11 +9,10 @@ import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { ILifecycleService, BeforeShutdownEvent, WillShutdownEvent, StartupKind, LifecyclePhase, LifecyclePhaseToString } from 'vs/platform/lifecycle/common/lifecycle';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { mark } from 'vs/base/common/performance';
|
||||
import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
|
||||
|
||||
export abstract class AbstractLifecycleService extends Disposable implements ILifecycleService {
|
||||
|
||||
_serviceBrand!: ServiceIdentifier<ILifecycleService>;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
protected readonly _onBeforeShutdown = this._register(new Emitter<BeforeShutdownEvent>());
|
||||
readonly onBeforeShutdown: Event<BeforeShutdownEvent> = this._onBeforeShutdown.event;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { toErrorMessage } from 'vs/base/common/errorMessage';
|
||||
import { ShutdownReason, StartupKind, handleVetos, ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle';
|
||||
import { ShutdownReason, StartupKind, handleVetos } from 'vs/platform/lifecycle/common/lifecycle';
|
||||
import { IStorageService, StorageScope, WillSaveStateReason } from 'vs/platform/storage/common/storage';
|
||||
import { ipcRenderer as ipc } from 'electron';
|
||||
import { IWindowService } from 'vs/platform/windows/common/windows';
|
||||
@@ -12,13 +12,12 @@ import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { AbstractLifecycleService } from 'vs/platform/lifecycle/common/lifecycleService';
|
||||
import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
|
||||
|
||||
export class LifecycleService extends AbstractLifecycleService {
|
||||
|
||||
private static readonly LAST_SHUTDOWN_REASON_KEY = 'lifecyle.lastShutdownReason';
|
||||
|
||||
_serviceBrand!: ServiceIdentifier<ILifecycleService>;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private shutdownReason: ShutdownReason;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import { ipcMain as ipc, app } from 'electron';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IStateService } from 'vs/platform/state/common/state';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { createDecorator, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { ICodeWindow } from 'vs/platform/windows/electron-main/windows';
|
||||
import { handleVetos } from 'vs/platform/lifecycle/common/lifecycle';
|
||||
import { isMacintosh, isWindows } from 'vs/base/common/platform';
|
||||
@@ -40,7 +40,7 @@ export interface ShutdownEvent {
|
||||
|
||||
export interface ILifecycleService {
|
||||
|
||||
_serviceBrand: ServiceIdentifier<ILifecycleService>;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
/**
|
||||
* Will be true if the program was restarted (e.g. due to explicit request or update).
|
||||
@@ -131,7 +131,7 @@ export const enum LifecycleMainPhase {
|
||||
|
||||
export class LifecycleService extends Disposable implements ILifecycleService {
|
||||
|
||||
_serviceBrand!: ServiceIdentifier<ILifecycleService>;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private static readonly QUIT_FROM_RESTART_MARKER = 'quit.from.restart'; // use a marker to find out if the session was restarted
|
||||
|
||||
@@ -139,10 +139,10 @@ export class LifecycleService extends Disposable implements ILifecycleService {
|
||||
private oneTimeListenerTokenGenerator = 0;
|
||||
private windowCounter = 0;
|
||||
|
||||
private pendingQuitPromise: Promise<boolean> | null;
|
||||
private pendingQuitPromiseResolve: { (veto: boolean): void } | null;
|
||||
private pendingQuitPromise: Promise<boolean> | null = null;
|
||||
private pendingQuitPromiseResolve: { (veto: boolean): void } | null = null;
|
||||
|
||||
private pendingWillShutdownPromise: Promise<void> | null;
|
||||
private pendingWillShutdownPromise: Promise<void> | null = null;
|
||||
|
||||
private _quitRequested = false;
|
||||
get quitRequested(): boolean { return this._quitRequested; }
|
||||
|
||||
@@ -25,9 +25,9 @@ import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { attachListStyler, computeStyles, defaultListStyles } from 'vs/platform/theme/common/styler';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { InputFocusedContextKey } from 'vs/platform/contextkey/common/contextkeys';
|
||||
import { ObjectTree, IObjectTreeOptions } from 'vs/base/browser/ui/tree/objectTree';
|
||||
import { ObjectTree, IObjectTreeOptions, ICompressibleTreeRenderer } from 'vs/base/browser/ui/tree/objectTree';
|
||||
import { ITreeEvent, ITreeRenderer, IAsyncDataSource, IDataSource, ITreeMouseEvent } from 'vs/base/browser/ui/tree/tree';
|
||||
import { AsyncDataTree, IAsyncDataTreeOptions } from 'vs/base/browser/ui/tree/asyncDataTree';
|
||||
import { AsyncDataTree, IAsyncDataTreeOptions, CompressibleAsyncDataTree, ITreeCompressionDelegate } from 'vs/base/browser/ui/tree/asyncDataTree';
|
||||
import { DataTree, IDataTreeOptions } from 'vs/base/browser/ui/tree/dataTree';
|
||||
import { IKeyboardNavigationEventFilter, IAbstractTreeOptions, RenderIndentGuides } from 'vs/base/browser/ui/tree/abstractTree';
|
||||
import { IAccessibilityService, AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility';
|
||||
@@ -38,7 +38,7 @@ export const IListService = createDecorator<IListService>('listService');
|
||||
|
||||
export interface IListService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
/**
|
||||
* Returns the currently focused list widget if any.
|
||||
@@ -53,7 +53,7 @@ interface IRegisteredList {
|
||||
|
||||
export class ListService implements IListService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private lists: IRegisteredList[] = [];
|
||||
private _lastFocusedWidget: ListWidget | undefined = undefined;
|
||||
@@ -245,6 +245,7 @@ export class WorkbenchList<T> extends List<T> {
|
||||
private _useAltAsMultipleSelectionModifier: boolean;
|
||||
|
||||
constructor(
|
||||
user: string,
|
||||
container: HTMLElement,
|
||||
delegate: IListVirtualDelegate<T>,
|
||||
renderers: IListRenderer<T, any>[],
|
||||
@@ -258,7 +259,7 @@ export class WorkbenchList<T> extends List<T> {
|
||||
const horizontalScrolling = typeof options.horizontalScrolling !== 'undefined' ? options.horizontalScrolling : getHorizontalScrollingSetting(configurationService);
|
||||
const [workbenchListOptions, workbenchListOptionsDisposable] = toWorkbenchListOptions(options, configurationService, keybindingService);
|
||||
|
||||
super(container, delegate, renderers,
|
||||
super(user, container, delegate, renderers,
|
||||
{
|
||||
keyboardSupport: false,
|
||||
styleController: new DefaultStyleController(getSharedListStyleSheet()),
|
||||
@@ -326,6 +327,7 @@ export class WorkbenchPagedList<T> extends PagedList<T> {
|
||||
private _useAltAsMultipleSelectionModifier: boolean;
|
||||
|
||||
constructor(
|
||||
user: string,
|
||||
container: HTMLElement,
|
||||
delegate: IListVirtualDelegate<number>,
|
||||
renderers: IPagedRenderer<T, any>[],
|
||||
@@ -338,7 +340,7 @@ export class WorkbenchPagedList<T> extends PagedList<T> {
|
||||
) {
|
||||
const horizontalScrolling = typeof options.horizontalScrolling !== 'undefined' ? options.horizontalScrolling : getHorizontalScrollingSetting(configurationService);
|
||||
const [workbenchListOptions, workbenchListOptionsDisposable] = toWorkbenchListOptions(options, configurationService, keybindingService);
|
||||
super(container, delegate, renderers,
|
||||
super(user, container, delegate, renderers,
|
||||
{
|
||||
keyboardSupport: false,
|
||||
styleController: new DefaultStyleController(getSharedListStyleSheet()),
|
||||
@@ -679,7 +681,7 @@ export class TreeResourceNavigator2<T, TFilterData> extends Disposable {
|
||||
readonly onDidOpenResource: Event<IOpenEvent<T | null>> = this._onDidOpenResource.event;
|
||||
|
||||
constructor(
|
||||
private tree: WorkbenchObjectTree<T, TFilterData> | WorkbenchDataTree<any, T, TFilterData> | WorkbenchAsyncDataTree<any, T, TFilterData>,
|
||||
private tree: WorkbenchObjectTree<T, TFilterData> | WorkbenchDataTree<any, T, TFilterData> | WorkbenchAsyncDataTree<any, T, TFilterData> | WorkbenchCompressibleAsyncDataTree<any, T, TFilterData>,
|
||||
options?: IResourceResultsNavigationOptions2
|
||||
) {
|
||||
super();
|
||||
@@ -785,6 +787,7 @@ export class WorkbenchObjectTree<T extends NonNullable<any>, TFilterData = void>
|
||||
get useAltAsMultipleSelectionModifier(): boolean { return this.internals.useAltAsMultipleSelectionModifier; }
|
||||
|
||||
constructor(
|
||||
user: string,
|
||||
container: HTMLElement,
|
||||
delegate: IListVirtualDelegate<T>,
|
||||
renderers: ITreeRenderer<T, TFilterData, any>[],
|
||||
@@ -797,7 +800,7 @@ export class WorkbenchObjectTree<T extends NonNullable<any>, TFilterData = void>
|
||||
@IAccessibilityService accessibilityService: IAccessibilityService
|
||||
) {
|
||||
const { options: treeOptions, getAutomaticKeyboardNavigation, disposable } = workbenchTreeDataPreamble(container, options, contextKeyService, themeService, configurationService, keybindingService, accessibilityService);
|
||||
super(container, delegate, renderers, treeOptions);
|
||||
super(user, container, delegate, renderers, treeOptions);
|
||||
this.disposables.push(disposable);
|
||||
this.internals = new WorkbenchTreeInternals(this, treeOptions, getAutomaticKeyboardNavigation, contextKeyService, listService, themeService, configurationService, accessibilityService);
|
||||
this.disposables.push(this.internals);
|
||||
@@ -811,6 +814,7 @@ export class WorkbenchDataTree<TInput, T, TFilterData = void> extends DataTree<T
|
||||
get useAltAsMultipleSelectionModifier(): boolean { return this.internals.useAltAsMultipleSelectionModifier; }
|
||||
|
||||
constructor(
|
||||
user: string,
|
||||
container: HTMLElement,
|
||||
delegate: IListVirtualDelegate<T>,
|
||||
renderers: ITreeRenderer<T, TFilterData, any>[],
|
||||
@@ -824,7 +828,7 @@ export class WorkbenchDataTree<TInput, T, TFilterData = void> extends DataTree<T
|
||||
@IAccessibilityService accessibilityService: IAccessibilityService
|
||||
) {
|
||||
const { options: treeOptions, getAutomaticKeyboardNavigation, disposable } = workbenchTreeDataPreamble(container, options, contextKeyService, themeService, configurationService, keybindingService, accessibilityService);
|
||||
super(container, delegate, renderers, dataSource, treeOptions);
|
||||
super(user, container, delegate, renderers, dataSource, treeOptions);
|
||||
this.disposables.push(disposable);
|
||||
this.internals = new WorkbenchTreeInternals(this, treeOptions, getAutomaticKeyboardNavigation, contextKeyService, listService, themeService, configurationService, accessibilityService);
|
||||
this.disposables.push(this.internals);
|
||||
@@ -838,6 +842,7 @@ export class WorkbenchAsyncDataTree<TInput, T, TFilterData = void> extends Async
|
||||
get useAltAsMultipleSelectionModifier(): boolean { return this.internals.useAltAsMultipleSelectionModifier; }
|
||||
|
||||
constructor(
|
||||
user: string,
|
||||
container: HTMLElement,
|
||||
delegate: IListVirtualDelegate<T>,
|
||||
renderers: ITreeRenderer<T, TFilterData, any>[],
|
||||
@@ -851,7 +856,36 @@ export class WorkbenchAsyncDataTree<TInput, T, TFilterData = void> extends Async
|
||||
@IAccessibilityService accessibilityService: IAccessibilityService
|
||||
) {
|
||||
const { options: treeOptions, getAutomaticKeyboardNavigation, disposable } = workbenchTreeDataPreamble(container, options, contextKeyService, themeService, configurationService, keybindingService, accessibilityService);
|
||||
super(container, delegate, renderers, dataSource, treeOptions);
|
||||
super(user, container, delegate, renderers, dataSource, treeOptions);
|
||||
this.disposables.push(disposable);
|
||||
this.internals = new WorkbenchTreeInternals(this, treeOptions, getAutomaticKeyboardNavigation, contextKeyService, listService, themeService, configurationService, accessibilityService);
|
||||
this.disposables.push(this.internals);
|
||||
}
|
||||
}
|
||||
|
||||
export class WorkbenchCompressibleAsyncDataTree<TInput, T, TFilterData = void> extends CompressibleAsyncDataTree<TInput, T, TFilterData> {
|
||||
|
||||
private internals: WorkbenchTreeInternals<TInput, T, TFilterData>;
|
||||
get contextKeyService(): IContextKeyService { return this.internals.contextKeyService; }
|
||||
get useAltAsMultipleSelectionModifier(): boolean { return this.internals.useAltAsMultipleSelectionModifier; }
|
||||
|
||||
constructor(
|
||||
user: string,
|
||||
container: HTMLElement,
|
||||
virtualDelegate: IListVirtualDelegate<T>,
|
||||
compressionDelegate: ITreeCompressionDelegate<T>,
|
||||
renderers: ICompressibleTreeRenderer<T, TFilterData, any>[],
|
||||
dataSource: IAsyncDataSource<TInput, T>,
|
||||
options: IAsyncDataTreeOptions<T, TFilterData>,
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
@IListService listService: IListService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IConfigurationService configurationService: IConfigurationService,
|
||||
@IKeybindingService keybindingService: IKeybindingService,
|
||||
@IAccessibilityService accessibilityService: IAccessibilityService
|
||||
) {
|
||||
const { options: treeOptions, getAutomaticKeyboardNavigation, disposable } = workbenchTreeDataPreamble(container, options, contextKeyService, themeService, configurationService, keybindingService, accessibilityService);
|
||||
super(user, container, virtualDelegate, compressionDelegate, renderers, dataSource, treeOptions);
|
||||
this.disposables.push(disposable);
|
||||
this.internals = new WorkbenchTreeInternals(this, treeOptions, getAutomaticKeyboardNavigation, contextKeyService, listService, themeService, configurationService, accessibilityService);
|
||||
this.disposables.push(this.internals);
|
||||
@@ -923,7 +957,7 @@ class WorkbenchTreeInternals<TInput, T, TFilterData> {
|
||||
private disposables: IDisposable[] = [];
|
||||
|
||||
constructor(
|
||||
tree: WorkbenchObjectTree<T, TFilterData> | WorkbenchDataTree<TInput, T, TFilterData> | WorkbenchAsyncDataTree<TInput, T, TFilterData>,
|
||||
tree: WorkbenchObjectTree<T, TFilterData> | WorkbenchDataTree<TInput, T, TFilterData> | WorkbenchAsyncDataTree<TInput, T, TFilterData> | WorkbenchCompressibleAsyncDataTree<TInput, T, TFilterData>,
|
||||
options: IAbstractTreeOptions<T, TFilterData> | IAsyncDataTreeOptions<T, TFilterData>,
|
||||
getAutomaticKeyboardNavigation: () => boolean | undefined,
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
|
||||
@@ -26,7 +26,7 @@ export const enum LanguageType {
|
||||
|
||||
export const ILocalizationsService = createDecorator<ILocalizationsService>('localizationsService');
|
||||
export interface ILocalizationsService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
readonly onDidLanguagesChange: Event<void>;
|
||||
getLanguageIds(type?: LanguageType): Promise<string[]>;
|
||||
|
||||
@@ -7,11 +7,10 @@ import { IChannel } from 'vs/base/parts/ipc/common/ipc';
|
||||
import { Event } from 'vs/base/common/event';
|
||||
import { ILocalizationsService, LanguageType } from 'vs/platform/localizations/common/localizations';
|
||||
import { ISharedProcessService } from 'vs/platform/ipc/electron-browser/sharedProcessService';
|
||||
import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
|
||||
|
||||
export class LocalizationsService implements ILocalizationsService {
|
||||
|
||||
_serviceBrand!: ServiceIdentifier<any>;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private channel: IChannel;
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ if (product.quality !== 'stable') {
|
||||
|
||||
export class LocalizationsService extends Disposable implements ILocalizationsService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private readonly cache: LanguagePacksCache;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { ILogService, LogLevel, AbstractLogService } from 'vs/platform/log/common/log';
|
||||
import { ILogService, LogLevel, AbstractLogService, DEFAULT_LOG_LEVEL } from 'vs/platform/log/common/log';
|
||||
|
||||
interface ILog {
|
||||
level: LogLevel;
|
||||
@@ -24,12 +24,13 @@ function getLogFunction(logger: ILogService, level: LogLevel): Function {
|
||||
|
||||
export class BufferLogService extends AbstractLogService implements ILogService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
private buffer: ILog[] = [];
|
||||
private _logger: ILogService | undefined = undefined;
|
||||
|
||||
constructor() {
|
||||
constructor(logLevel: LogLevel = DEFAULT_LOG_LEVEL) {
|
||||
super();
|
||||
this.setLevel(logLevel);
|
||||
this._register(this.onDidChangeLogLevel(level => {
|
||||
if (this._logger) {
|
||||
this._logger.setLevel(level);
|
||||
@@ -86,4 +87,4 @@ export class BufferLogService extends AbstractLogService implements ILogService
|
||||
this._logger.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,12 +8,16 @@ import { URI } from 'vs/base/common/uri';
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
import { Queue } from 'vs/base/common/async';
|
||||
import { VSBuffer } from 'vs/base/common/buffer';
|
||||
import { dirname, joinPath, basename } from 'vs/base/common/resources';
|
||||
|
||||
const MAX_FILE_SIZE = 1024 * 1024 * 5;
|
||||
|
||||
export class FileLogService extends AbstractLogService implements ILogService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private readonly queue: Queue<void>;
|
||||
private backupIndex: number = 1;
|
||||
|
||||
constructor(
|
||||
private readonly name: string,
|
||||
@@ -81,6 +85,10 @@ export class FileLogService extends AbstractLogService implements ILogService {
|
||||
private _log(level: LogLevel, message: string): void {
|
||||
this.queue.queue(async () => {
|
||||
let content = await this.loadContent();
|
||||
if (content.length > MAX_FILE_SIZE) {
|
||||
await this.fileService.writeFile(this.getBackupResource(), VSBuffer.fromString(content));
|
||||
content = '';
|
||||
}
|
||||
content += `[${this.getCurrentTimestamp()}] [${this.name}] [${this.stringifyLogLevel(level)}] ${message}\n`;
|
||||
await this.fileService.writeFile(this.resource, VSBuffer.fromString(content));
|
||||
});
|
||||
@@ -93,6 +101,11 @@ export class FileLogService extends AbstractLogService implements ILogService {
|
||||
return `${currentTime.getFullYear()}-${toTwoDigits(currentTime.getMonth() + 1)}-${toTwoDigits(currentTime.getDate())} ${toTwoDigits(currentTime.getHours())}:${toTwoDigits(currentTime.getMinutes())}:${toTwoDigits(currentTime.getSeconds())}.${toThreeDigits(currentTime.getMilliseconds())}`;
|
||||
}
|
||||
|
||||
private getBackupResource(): URI {
|
||||
this.backupIndex = this.backupIndex > 5 ? 1 : this.backupIndex;
|
||||
return joinPath(dirname(this.resource), `${basename(this.resource)}_${this.backupIndex++}`);
|
||||
}
|
||||
|
||||
private async loadContent(): Promise<string> {
|
||||
try {
|
||||
const content = await this.fileService.readFile(this.resource);
|
||||
|
||||
@@ -28,7 +28,7 @@ export enum LogLevel {
|
||||
export const DEFAULT_LOG_LEVEL: LogLevel = LogLevel.Info;
|
||||
|
||||
export interface ILogService extends IDisposable {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
onDidChangeLogLevel: Event<LogLevel>;
|
||||
|
||||
getLevel(): LogLevel;
|
||||
@@ -61,7 +61,7 @@ export abstract class AbstractLogService extends Disposable {
|
||||
|
||||
export class ConsoleLogMainService extends AbstractLogService implements ILogService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
private useColors: boolean;
|
||||
|
||||
constructor(logLevel: LogLevel = DEFAULT_LOG_LEVEL) {
|
||||
@@ -137,7 +137,7 @@ export class ConsoleLogMainService extends AbstractLogService implements ILogSer
|
||||
|
||||
export class ConsoleLogService extends AbstractLogService implements ILogService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
constructor(logLevel: LogLevel = DEFAULT_LOG_LEVEL) {
|
||||
super();
|
||||
@@ -184,7 +184,7 @@ export class ConsoleLogService extends AbstractLogService implements ILogService
|
||||
}
|
||||
|
||||
export class MultiplexLogService extends AbstractLogService implements ILogService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
constructor(private readonly logServices: ReadonlyArray<ILogService>) {
|
||||
super();
|
||||
@@ -244,7 +244,7 @@ export class MultiplexLogService extends AbstractLogService implements ILogServi
|
||||
}
|
||||
|
||||
export class DelegatedLogService extends Disposable implements ILogService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
constructor(private logService: ILogService) {
|
||||
super();
|
||||
@@ -289,7 +289,7 @@ export class DelegatedLogService extends Disposable implements ILogService {
|
||||
}
|
||||
|
||||
export class NullLogService implements ILogService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
readonly onDidChangeLogLevel: Event<LogLevel> = new Emitter<LogLevel>().event;
|
||||
setLevel(level: LogLevel): void { }
|
||||
getLevel(): LogLevel { return LogLevel.Info; }
|
||||
|
||||
@@ -46,7 +46,7 @@ export class LogLevelSetterChannelClient {
|
||||
}
|
||||
|
||||
export class FollowerLogService extends DelegatedLogService implements ILogService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
constructor(private master: LogLevelSetterChannelClient, logService: ILogService) {
|
||||
super(logService);
|
||||
|
||||
@@ -44,7 +44,7 @@ function log(logger: spdlog.RotatingLogger, level: LogLevel, message: string): v
|
||||
|
||||
export class SpdLogService extends AbstractLogService implements ILogService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private buffer: ILog[] = [];
|
||||
private _loggerCreationPromise: Promise<void> | undefined = undefined;
|
||||
|
||||
@@ -121,7 +121,7 @@ class MarkerStats implements MarkerStatistics {
|
||||
|
||||
export class MarkerService implements IMarkerService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private _onMarkerChanged = new Emitter<URI[]>();
|
||||
private _onMarkerChangedEvent: Event<URI[]> = Event.debounce(this._onMarkerChanged.event, MarkerService._debouncer, 0);
|
||||
|
||||
@@ -10,7 +10,7 @@ import { localize } from 'vs/nls';
|
||||
import Severity from 'vs/base/common/severity';
|
||||
|
||||
export interface IMarkerService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
getStatistics(): MarkerStatistics;
|
||||
|
||||
|
||||
@@ -6,11 +6,10 @@
|
||||
import { IChannel } from 'vs/base/parts/ipc/common/ipc';
|
||||
import { IMenubarService, IMenubarData } from 'vs/platform/menubar/node/menubar';
|
||||
import { IMainProcessService } from 'vs/platform/ipc/electron-browser/mainProcessService';
|
||||
import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
|
||||
|
||||
export class MenubarService implements IMenubarService {
|
||||
|
||||
_serviceBrand!: ServiceIdentifier<any>;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private channel: IChannel;
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { IUpdateService, StateType } from 'vs/platform/update/common/update';
|
||||
import product from 'vs/platform/product/node/product';
|
||||
import { RunOnceScheduler } from 'vs/base/common/async';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { mnemonicMenuLabel as baseMnemonicLabel } from 'vs/base/common/labels';
|
||||
import { IWindowsMainService, IWindowsCountChangedEvent } from 'vs/platform/windows/electron-main/windows';
|
||||
import { IHistoryMainService } from 'vs/platform/history/common/history';
|
||||
@@ -62,14 +62,14 @@ export class Menubar {
|
||||
|
||||
constructor(
|
||||
@IUpdateService private readonly updateService: IUpdateService,
|
||||
@IInstantiationService instantiationService: IInstantiationService,
|
||||
@IConfigurationService private readonly configurationService: IConfigurationService,
|
||||
@IWindowsMainService private readonly windowsMainService: IWindowsMainService,
|
||||
@IEnvironmentService private readonly environmentService: IEnvironmentService,
|
||||
@ITelemetryService private readonly telemetryService: ITelemetryService,
|
||||
@IHistoryMainService private readonly historyMainService: IHistoryMainService,
|
||||
@IStateService private readonly stateService: IStateService,
|
||||
@ILifecycleService private readonly lifecycleService: ILifecycleService
|
||||
@ILifecycleService private readonly lifecycleService: ILifecycleService,
|
||||
@ILogService private readonly logService: ILogService
|
||||
) {
|
||||
this.menuUpdater = new RunOnceScheduler(() => this.doUpdateMenu(), 0);
|
||||
|
||||
@@ -118,36 +118,41 @@ export class Menubar {
|
||||
this.fallbackMenuHandlers['workbench.action.clearRecentFiles'] = () => this.historyMainService.clearRecentlyOpened();
|
||||
|
||||
// Help Menu Items
|
||||
if (product.twitterUrl) {
|
||||
this.fallbackMenuHandlers['workbench.action.openTwitterUrl'] = () => this.openUrl(product.twitterUrl, 'openTwitterUrl');
|
||||
const twitterUrl = product.twitterUrl;
|
||||
if (twitterUrl) {
|
||||
this.fallbackMenuHandlers['workbench.action.openTwitterUrl'] = () => this.openUrl(twitterUrl, 'openTwitterUrl');
|
||||
}
|
||||
|
||||
if (product.requestFeatureUrl) {
|
||||
this.fallbackMenuHandlers['workbench.action.openRequestFeatureUrl'] = () => this.openUrl(product.requestFeatureUrl, 'openUserVoiceUrl');
|
||||
const requestFeatureUrl = product.requestFeatureUrl;
|
||||
if (requestFeatureUrl) {
|
||||
this.fallbackMenuHandlers['workbench.action.openRequestFeatureUrl'] = () => this.openUrl(requestFeatureUrl, 'openUserVoiceUrl');
|
||||
}
|
||||
|
||||
if (product.reportIssueUrl) {
|
||||
this.fallbackMenuHandlers['workbench.action.openIssueReporter'] = () => this.openUrl(product.reportIssueUrl, 'openReportIssues');
|
||||
const reportIssueUrl = product.reportIssueUrl;
|
||||
if (reportIssueUrl) {
|
||||
this.fallbackMenuHandlers['workbench.action.openIssueReporter'] = () => this.openUrl(reportIssueUrl, 'openReportIssues');
|
||||
}
|
||||
|
||||
if (product.licenseUrl) {
|
||||
const licenseUrl = product.licenseUrl;
|
||||
if (licenseUrl) {
|
||||
this.fallbackMenuHandlers['workbench.action.openLicenseUrl'] = () => {
|
||||
if (language) {
|
||||
const queryArgChar = product.licenseUrl.indexOf('?') > 0 ? '&' : '?';
|
||||
this.openUrl(`${product.licenseUrl}${queryArgChar}lang=${language}`, 'openLicenseUrl');
|
||||
const queryArgChar = licenseUrl.indexOf('?') > 0 ? '&' : '?';
|
||||
this.openUrl(`${licenseUrl}${queryArgChar}lang=${language}`, 'openLicenseUrl');
|
||||
} else {
|
||||
this.openUrl(product.licenseUrl, 'openLicenseUrl');
|
||||
this.openUrl(licenseUrl, 'openLicenseUrl');
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
if (product.privacyStatementUrl) {
|
||||
const privacyStatementUrl = product.privacyStatementUrl;
|
||||
if (privacyStatementUrl && licenseUrl) {
|
||||
this.fallbackMenuHandlers['workbench.action.openPrivacyStatementUrl'] = () => {
|
||||
if (language) {
|
||||
const queryArgChar = product.licenseUrl.indexOf('?') > 0 ? '&' : '?';
|
||||
this.openUrl(`${product.privacyStatementUrl}${queryArgChar}lang=${language}`, 'openPrivacyStatement');
|
||||
const queryArgChar = licenseUrl.indexOf('?') > 0 ? '&' : '?';
|
||||
this.openUrl(`${privacyStatementUrl}${queryArgChar}lang=${language}`, 'openPrivacyStatement');
|
||||
} else {
|
||||
this.openUrl(product.privacyStatementUrl, 'openPrivacyStatement');
|
||||
this.openUrl(privacyStatementUrl, 'openPrivacyStatement');
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -723,6 +728,8 @@ export class Menubar {
|
||||
}
|
||||
|
||||
if (activeWindow) {
|
||||
this.logService.trace('menubar#runActionInRenderer', invocation);
|
||||
|
||||
if (isMacintosh && !this.environmentService.isBuilt && !activeWindow.isReady) {
|
||||
if ((invocation.type === 'commandId' && invocation.commandId === 'workbench.action.toggleDevTools') || (invocation.type !== 'commandId' && invocation.userSettingsLabel === 'alt+cmd+i')) {
|
||||
// prevent this action from running twice on macOS (https://github.com/Microsoft/vscode/issues/62719)
|
||||
@@ -733,10 +740,12 @@ export class Menubar {
|
||||
}
|
||||
|
||||
if (invocation.type === 'commandId') {
|
||||
this.windowsMainService.sendToFocused('vscode:runAction', { id: invocation.commandId, from: 'menu' } as IRunActionInWindowRequest);
|
||||
activeWindow.sendWhenReady('vscode:runAction', { id: invocation.commandId, from: 'menu' } as IRunActionInWindowRequest);
|
||||
} else {
|
||||
this.windowsMainService.sendToFocused('vscode:runKeybinding', { userSettingsLabel: invocation.userSettingsLabel } as IRunKeybindingInWindowRequest);
|
||||
activeWindow.sendWhenReady('vscode:runKeybinding', { userSettingsLabel: invocation.userSettingsLabel } as IRunKeybindingInWindowRequest);
|
||||
}
|
||||
} else {
|
||||
this.logService.trace('menubar#runActionInRenderer: no active window found', invocation);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
|
||||
export class MenubarService implements IMenubarService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private _menubar: Menubar;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import { URI } from 'vs/base/common/uri';
|
||||
export const IMenubarService = createDecorator<IMenubarService>('menubarService');
|
||||
|
||||
export interface IMenubarService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
updateMenubar(windowId: number, menuData: IMenubarData): Promise<void>;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import BaseSeverity from 'vs/base/common/severity';
|
||||
import { createDecorator, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IAction } from 'vs/base/common/actions';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
@@ -234,7 +234,7 @@ export interface IStatusMessageOptions {
|
||||
*/
|
||||
export interface INotificationService {
|
||||
|
||||
_serviceBrand: ServiceIdentifier<INotificationService>;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
/**
|
||||
* Show the provided notification to the user. The returned `INotificationHandle`
|
||||
|
||||
@@ -8,7 +8,7 @@ import { Disposable, IDisposable } from 'vs/base/common/lifecycle';
|
||||
|
||||
export class TestNotificationService implements INotificationService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private static readonly NO_OP: INotificationHandle = new NoOpNotification();
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ export interface IValidator {
|
||||
|
||||
export interface IOpenerService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
/**
|
||||
* Register a participant that can handle the open() call.
|
||||
|
||||
21
src/vs/platform/product/browser/product.ts
Normal file
21
src/vs/platform/product/browser/product.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { IProductConfiguration } from 'vs/platform/product/common/product';
|
||||
import { assign } from 'vs/base/common/objects';
|
||||
|
||||
// Built time configuration (do NOT modify)
|
||||
const product = { /*BUILD->INSERT_PRODUCT_CONFIGURATION*/ } as IProductConfiguration;
|
||||
|
||||
// Running out of sources
|
||||
if (Object.keys(product).length === 0) {
|
||||
assign(product, {
|
||||
version: '1.39.0-dev',
|
||||
nameLong: 'Visual Studio Code Web Dev',
|
||||
nameShort: 'VSCode Web Dev'
|
||||
});
|
||||
}
|
||||
|
||||
export default product;
|
||||
@@ -14,83 +14,100 @@ export interface IProductService extends Readonly<IProductConfiguration> {
|
||||
}
|
||||
|
||||
export interface IProductConfiguration {
|
||||
version: string;
|
||||
nameShort: string;
|
||||
nameLong: string;
|
||||
readonly applicationName: string;
|
||||
readonly win32AppId: string;
|
||||
readonly win32x64AppId: string;
|
||||
readonly win32UserAppId: string;
|
||||
readonly win32x64UserAppId: string;
|
||||
readonly win32AppUserModelId: string;
|
||||
readonly win32MutexName: string;
|
||||
readonly darwinBundleIdentifier: string;
|
||||
readonly urlProtocol: string;
|
||||
dataFolderName: string;
|
||||
readonly downloadUrl: string;
|
||||
readonly updateUrl?: string;
|
||||
readonly version: string;
|
||||
readonly date?: string;
|
||||
readonly quality?: string;
|
||||
readonly target?: string;
|
||||
readonly commit?: string;
|
||||
|
||||
readonly nameShort: string;
|
||||
readonly nameLong: string;
|
||||
|
||||
readonly win32AppUserModelId?: string;
|
||||
readonly win32MutexName?: string;
|
||||
readonly applicationName: string;
|
||||
|
||||
readonly urlProtocol: string;
|
||||
readonly dataFolderName: string;
|
||||
|
||||
readonly downloadUrl?: string;
|
||||
readonly updateUrl?: string;
|
||||
readonly target?: string;
|
||||
|
||||
readonly settingsSearchBuildId?: number;
|
||||
readonly settingsSearchUrl?: string;
|
||||
|
||||
readonly experimentsUrl?: string;
|
||||
readonly date: string;
|
||||
|
||||
readonly extensionsGallery?: {
|
||||
readonly serviceUrl: string;
|
||||
readonly itemUrl: string;
|
||||
readonly controlUrl: string;
|
||||
readonly recommendationsUrl: string;
|
||||
};
|
||||
readonly extensionTips: { [id: string]: string; };
|
||||
|
||||
readonly extensionTips?: { [id: string]: string; };
|
||||
readonly extensionImportantTips?: { [id: string]: { name: string; pattern: string; isExtensionPack?: boolean }; };
|
||||
readonly exeBasedExtensionTips?: { [id: string]: IExeBasedExtensionTip; };
|
||||
readonly extensionKeywords?: { [extension: string]: readonly string[]; };
|
||||
readonly keymapExtensionTips?: readonly string[];
|
||||
|
||||
readonly recommendedExtensions: string[]; // {{SQL CARBON EDIT}}
|
||||
readonly recommendedExtensionsByScenario: { [area: string]: Array<string> }; // {{SQL CARBON EDIT}}
|
||||
readonly vscodeVersion: string; // {{SQL CARBON EDIT}} add vscode version
|
||||
readonly gettingStartedUrl: string; // {SQL CARBON EDIT}
|
||||
readonly extensionImportantTips: { [id: string]: { name: string; pattern: string; isExtensionPack?: boolean }; };
|
||||
readonly exeBasedExtensionTips: { [id: string]: IExeBasedExtensionTip; };
|
||||
readonly extensionKeywords: { [extension: string]: readonly string[]; };
|
||||
readonly extensionAllowedProposedApi: readonly string[];
|
||||
readonly keymapExtensionTips: readonly string[];
|
||||
readonly crashReporter: {
|
||||
|
||||
readonly crashReporter?: {
|
||||
readonly companyName: string;
|
||||
readonly productName: string;
|
||||
};
|
||||
readonly welcomePage: string;
|
||||
readonly enableTelemetry: boolean;
|
||||
readonly aiConfig: {
|
||||
|
||||
readonly welcomePage?: string;
|
||||
|
||||
readonly enableTelemetry?: boolean;
|
||||
readonly aiConfig?: {
|
||||
readonly asimovKey: string;
|
||||
};
|
||||
readonly sendASmile: {
|
||||
|
||||
readonly sendASmile?: {
|
||||
readonly reportIssueUrl: string,
|
||||
readonly requestFeatureUrl: string
|
||||
};
|
||||
readonly documentationUrl: string;
|
||||
readonly releaseNotesUrl: string;
|
||||
readonly keyboardShortcutsUrlMac: string;
|
||||
readonly keyboardShortcutsUrlLinux: string;
|
||||
readonly keyboardShortcutsUrlWin: string;
|
||||
readonly introductoryVideosUrl: string;
|
||||
readonly tipsAndTricksUrl: string;
|
||||
readonly newsletterSignupUrl: string;
|
||||
readonly twitterUrl: string;
|
||||
readonly requestFeatureUrl: string;
|
||||
readonly reportIssueUrl: string;
|
||||
readonly licenseUrl: string;
|
||||
readonly privacyStatementUrl: string;
|
||||
readonly telemetryOptOutUrl: string;
|
||||
readonly npsSurveyUrl: string;
|
||||
readonly surveys: readonly ISurveyData[];
|
||||
readonly checksums: { [path: string]: string; };
|
||||
readonly checksumFailMoreInfoUrl: string;
|
||||
readonly hockeyApp: {
|
||||
|
||||
readonly documentationUrl?: string;
|
||||
readonly releaseNotesUrl?: string;
|
||||
readonly keyboardShortcutsUrlMac?: string;
|
||||
readonly keyboardShortcutsUrlLinux?: string;
|
||||
readonly keyboardShortcutsUrlWin?: string;
|
||||
readonly introductoryVideosUrl?: string;
|
||||
readonly tipsAndTricksUrl?: string;
|
||||
readonly newsletterSignupUrl?: string;
|
||||
readonly twitterUrl?: string;
|
||||
readonly requestFeatureUrl?: string;
|
||||
readonly reportIssueUrl?: string;
|
||||
readonly licenseUrl?: string;
|
||||
readonly privacyStatementUrl?: string;
|
||||
readonly telemetryOptOutUrl?: string;
|
||||
|
||||
readonly npsSurveyUrl?: string;
|
||||
readonly surveys?: readonly ISurveyData[];
|
||||
|
||||
readonly checksums?: { [path: string]: string; };
|
||||
readonly checksumFailMoreInfoUrl?: string;
|
||||
|
||||
readonly hockeyApp?: {
|
||||
readonly 'win32-ia32': string;
|
||||
readonly 'win32-x64': string;
|
||||
readonly 'linux-x64': string;
|
||||
readonly 'darwin': string;
|
||||
};
|
||||
|
||||
readonly portable?: string;
|
||||
|
||||
readonly uiExtensions?: readonly string[];
|
||||
readonly extensionAllowedProposedApi?: readonly string[];
|
||||
|
||||
readonly msftInternalDomains?: string[];
|
||||
readonly linkProtectionTrustedDomains?: readonly string[];
|
||||
}
|
||||
|
||||
export interface IExeBasedExtensionTip {
|
||||
|
||||
@@ -7,17 +7,22 @@ import * as path from 'vs/base/common/path';
|
||||
import { getPathFromAmdModule } from 'vs/base/common/amd';
|
||||
import { IProductConfiguration } from 'vs/platform/product/common/product';
|
||||
import pkg from 'vs/platform/product/node/package';
|
||||
import { assign } from 'vs/base/common/objects';
|
||||
|
||||
const rootPath = path.dirname(getPathFromAmdModule(require, ''));
|
||||
const productJsonPath = path.join(rootPath, 'product.json');
|
||||
const product = require.__$__nodeRequire(productJsonPath) as IProductConfiguration;
|
||||
|
||||
if (process.env['VSCODE_DEV']) {
|
||||
product.nameShort += ' Dev';
|
||||
product.nameLong += ' Dev';
|
||||
product.dataFolderName += '-dev';
|
||||
assign(product, {
|
||||
nameShort: `${product.nameShort} Dev`,
|
||||
nameLong: `${product.nameLong} Dev`,
|
||||
dataFolderName: `${product.dataFolderName}-dev`
|
||||
});
|
||||
}
|
||||
|
||||
product.version = pkg.version;
|
||||
assign(product, {
|
||||
version: pkg.version
|
||||
});
|
||||
|
||||
export default product;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { createDecorator, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation';
|
||||
import { toDisposable, DisposableStore, Disposable } from 'vs/base/common/lifecycle';
|
||||
import { IAction } from 'vs/base/common/actions';
|
||||
@@ -15,7 +15,7 @@ export const IProgressService = createDecorator<IProgressService>('progressServi
|
||||
*/
|
||||
export interface IProgressService {
|
||||
|
||||
_serviceBrand: ServiceIdentifier<IProgressService>;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
withProgress<R = any>(options: IProgressOptions | IProgressNotificationOptions | IProgressCompositeOptions, task: (progress: IProgress<IProgressStep>) => Promise<R>, onDidCancel?: () => void): Promise<R>;
|
||||
}
|
||||
@@ -174,5 +174,5 @@ export const IEditorProgressService = createDecorator<IEditorProgressService>('e
|
||||
*/
|
||||
export interface IEditorProgressService extends IProgressIndicator {
|
||||
|
||||
_serviceBrand: ServiceIdentifier<IEditorProgressService>;
|
||||
_serviceBrand: undefined;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ export const IQuickOpenService = createDecorator<IQuickOpenService>('quickOpenSe
|
||||
|
||||
export interface IQuickOpenService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
/**
|
||||
* Asks the container to show the quick open control with the optional prefix set. If the optional parameter
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user