Mark _serviceBrand properties using declare (#99312)

_serviceBrand is only used for typing and should not result in emit

Also adds readonly
This commit is contained in:
Matt Bierner
2020-06-05 11:04:15 -07:00
committed by GitHub
parent 96ce46b217
commit cadabab73f
338 changed files with 459 additions and 459 deletions
@@ -95,7 +95,7 @@ class MainProcessService implements IMainProcessService {
private mainRouter: StaticRouter
) { }
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
getChannel(channelName: string): IChannel {
return this.server.getChannel(channelName, this.mainRouter);
+1 -1
View File
@@ -23,7 +23,7 @@ type Credentials = {
export class ProxyAuthHandler extends Disposable {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
private retryCount = 0;
@@ -17,7 +17,7 @@ import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
const IEditorCancellationTokens = createDecorator<IEditorCancellationTokens>('IEditorCancelService');
interface IEditorCancellationTokens {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
add(editor: ICodeEditor, cts: CancellationTokenSource): () => void;
cancel(editor: ICodeEditor): void;
}
@@ -26,7 +26,7 @@ const ctxCancellableOperation = new RawContextKey('cancellableOperation', false)
registerSingleton(IEditorCancellationTokens, class implements IEditorCancellationTokens {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
private readonly _tokens = new WeakMap<ICodeEditor, { key: IContextKey<boolean>, tokens: LinkedList<CancellationTokenSource> }>();
@@ -14,7 +14,7 @@ import { URI } from 'vs/base/common/uri';
export abstract class AbstractCodeEditorService extends Disposable implements ICodeEditorService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
private readonly _onCodeEditorAdd: Emitter<ICodeEditor> = this._register(new Emitter<ICodeEditor>());
public readonly onCodeEditorAdd: Event<ICodeEditor> = this._onCodeEditorAdd.event;
@@ -26,7 +26,7 @@ export interface IBulkEditResult {
export type IBulkEditPreviewHandler = (edit: WorkspaceEdit, options?: IBulkEditOptions) => Promise<WorkspaceEdit>;
export interface IBulkEditService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
hasPreviewHandler(): boolean;
@@ -14,7 +14,7 @@ import { URI } from 'vs/base/common/uri';
export const ICodeEditorService = createDecorator<ICodeEditorService>('codeEditorService');
export interface ICodeEditorService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
readonly onCodeEditorAdd: Event<ICodeEditor>;
readonly onCodeEditorRemove: Event<ICodeEditor>;
@@ -85,7 +85,7 @@ class EditorOpener implements IOpener {
export class OpenerService implements IOpenerService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
private readonly _openers = new LinkedList<IOpener>();
private readonly _validators = new LinkedList<IValidator>();
@@ -19,7 +19,7 @@ export interface IDiffComputationResult {
}
export interface IEditorWorkerService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
canComputeDiff(original: URI, modified: URI): boolean;
computeDiff(original: URI, modified: URI, ignoreTrimWhitespace: boolean, maxComputationTime: number): Promise<IDiffComputationResult | null>;
@@ -46,7 +46,7 @@ function canSyncModel(modelService: IModelService, resource: URI): boolean {
export class EditorWorkerServiceImpl extends Disposable implements IEditorWorkerService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
private readonly _modelService: IModelService;
private readonly _workerManager: WorkerManager;
@@ -70,7 +70,7 @@ class MarkerDecorations extends Disposable {
export class MarkerDecorationsService extends Disposable implements IMarkerDecorationsService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
private readonly _onDidChangeMarker = this._register(new Emitter<ITextModel>());
readonly onDidChangeMarker: Event<ITextModel> = this._onDidChangeMarker.event;
@@ -12,7 +12,7 @@ import { Range } from 'vs/editor/common/core/range';
export const IMarkerDecorationsService = createDecorator<IMarkerDecorationsService>('markerDecorationsService');
export interface IMarkerDecorationsService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
onDidChangeMarker: Event<ITextModel>;
+1 -1
View File
@@ -28,7 +28,7 @@ export interface ILanguageSelection extends IDisposable {
}
export interface IModeService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
onDidCreateMode: Event<IMode>;
onLanguagesMaybeChanged: Event<void>;
@@ -16,7 +16,7 @@ export const IModelService = createDecorator<IModelService>('modelService');
export type DocumentTokensProvider = DocumentSemanticTokensProvider | DocumentRangeSemanticTokensProvider;
export interface IModelService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
createModel(value: string | ITextBufferFactory, languageSelection: ILanguageSelection | null, resource?: URI, isForSimpleWidget?: boolean): ITextModel;
@@ -12,7 +12,7 @@ import { createDecorator } from 'vs/platform/instantiation/common/instantiation'
export const ITextModelService = createDecorator<ITextModelService>('textModelService');
export interface ITextModelService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
/**
* Provided a resource URI, it will return a model reference
@@ -31,7 +31,7 @@ export interface ITextResourceConfigurationChangeEvent {
export interface ITextResourceConfigurationService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
/**
* Event that fires when the configuration changes.
@@ -70,7 +70,7 @@ export const ITextResourcePropertiesService = createDecorator<ITextResourcePrope
export interface ITextResourcePropertiesService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
/**
* Returns the End of Line characters for the given resource
@@ -17,7 +17,7 @@ import { once } from 'vs/base/common/functional';
export const ICodeLensCache = createDecorator<ICodeLensCache>('ICodeLensCache');
export interface ICodeLensCache {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
put(model: ITextModel, data: CodeLensModel): void;
get(model: ITextModel): CodeLensModel | undefined;
delete(model: ITextModel): void;
@@ -38,7 +38,7 @@ class CacheItem {
export class CodeLensCache implements ICodeLensCache {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
private readonly _fakeProvider = new class implements CodeLensProvider {
provideCodeLenses(): CodeLensList {
@@ -26,7 +26,7 @@ export const ctxHasSymbols = new RawContextKey('hasSymbols', false);
export const ISymbolNavigationService = createDecorator<ISymbolNavigationService>('ISymbolNavigationService');
export interface ISymbolNavigationService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
reset(): void;
put(anchor: OneReference): void;
revealNext(source: ICodeEditor): Promise<any>;
@@ -34,7 +34,7 @@ export interface ISymbolNavigationService {
class SymbolNavigationService implements ISymbolNavigationService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
private readonly _ctxHasSymbols: IContextKey<boolean>;
+3 -3
View File
@@ -30,12 +30,12 @@ import { Codicon } from 'vs/base/common/codicons';
export const IPeekViewService = createDecorator<IPeekViewService>('IPeekViewService');
export interface IPeekViewService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
addExclusiveWidget(editor: ICodeEditor, widget: PeekViewWidget): void;
}
registerSingleton(IPeekViewService, class implements IPeekViewService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
private readonly _widgets = new Map<ICodeEditor, { widget: PeekViewWidget, listener: IDisposable; }>();
@@ -103,7 +103,7 @@ const defaultOptions: IPeekViewOptions = {
export abstract class PeekViewWidget extends ZoneWidget {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
private readonly _onDidClose = new Emitter<PeekViewWidget>();
readonly onDidClose = this._onDidClose.event;
@@ -302,7 +302,7 @@ suite('Snippet Variables Resolver', function () {
let workspace: IWorkspace;
let resolver: VariableResolver;
const workspaceService = new class implements IWorkspaceContextService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
_throw = () => { throw new Error(); };
onDidChangeWorkbenchState = this._throw;
onDidChangeWorkspaceName = this._throw;
@@ -308,7 +308,7 @@ export class SuggestMemoryService implements ISuggestMemoryService {
export const ISuggestMemoryService = createDecorator<ISuggestMemoryService>('ISuggestMemories');
export interface ISuggestMemoryService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
memorize(model: ITextModel, pos: IPosition, item: CompletionItem): void;
select(model: ITextModel, pos: IPosition, items: CompletionItem[]): number;
}
@@ -51,7 +51,7 @@ function createMockEditor(model: TextModel): ITestCodeEditor {
[IStorageService, new InMemoryStorageService()],
[IKeybindingService, new MockKeybindingService()],
[ISuggestMemoryService, new class implements ISuggestMemoryService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
memorize(): void {
}
select(): number {
@@ -52,7 +52,7 @@ export class EditorScopedQuickInputServiceImpl extends QuickInputService {
export class StandaloneQuickInputServiceImpl implements IQuickInputService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
private mapEditorToService = new Map<ICodeEditor, EditorScopedQuickInputServiceImpl>();
private get activeService(): IQuickInputService {
@@ -155,7 +155,7 @@ export class SimpleEditorModelResolverService implements ITextModelService {
}
export class SimpleEditorProgressService implements IEditorProgressService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
private static NULL_PROGRESS_RUNNER: IProgressRunner = {
done: () => { },
@@ -251,7 +251,7 @@ export class SimpleNotificationService implements INotificationService {
}
export class StandaloneCommandService implements ICommandService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
private readonly _instantiationService: IInstantiationService;
@@ -420,7 +420,7 @@ function isConfigurationOverrides(thing: any): thing is IConfigurationOverrides
export class SimpleConfigurationService implements IConfigurationService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
private readonly _onDidChangeConfiguration = new Emitter<IConfigurationChangeEvent>();
public readonly onDidChangeConfiguration: Event<IConfigurationChangeEvent> = this._onDidChangeConfiguration.event;
@@ -498,7 +498,7 @@ export class SimpleConfigurationService implements IConfigurationService {
export class SimpleResourceConfigurationService implements ITextResourceConfigurationService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
private readonly _onDidChangeConfiguration = new Emitter<ITextResourceConfigurationChangeEvent>();
public readonly onDidChangeConfiguration = this._onDidChangeConfiguration.event;
@@ -527,7 +527,7 @@ export class SimpleResourceConfigurationService implements ITextResourceConfigur
export class SimpleResourcePropertiesService implements ITextResourcePropertiesService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
constructor(
@IConfigurationService private readonly configurationService: IConfigurationService,
@@ -544,7 +544,7 @@ export class SimpleResourcePropertiesService implements ITextResourcePropertiesS
}
export class StandaloneTelemetryService implements ITelemetryService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
public isOptedIn = false;
public sendErrorTelemetry = false;
@@ -648,7 +648,7 @@ export function applyConfigurationValues(configurationService: IConfigurationSer
}
export class SimpleBulkEditService implements IBulkEditService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
constructor(private readonly _modelService: IModelService) {
//
@@ -703,7 +703,7 @@ export class SimpleBulkEditService implements IBulkEditService {
export class SimpleUriLabelService implements ILabelService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
public readonly onDidChangeFormatters: Event<IFormatterChangeEvent> = Event.None;
@@ -736,7 +736,7 @@ export class SimpleUriLabelService implements ILabelService {
}
export class SimpleLayoutService implements ILayoutService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
public onLayout = Event.None;
@@ -172,7 +172,7 @@ function newBuiltInTheme(builtinTheme: BuiltinTheme): StandaloneTheme {
export class StandaloneThemeServiceImpl extends Disposable implements IStandaloneThemeService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
private readonly _onColorThemeChange = this._register(new Emitter<IStandaloneTheme>());
public readonly onDidColorThemeChange = this._onColorThemeChange.event;
@@ -26,7 +26,7 @@ export interface IStandaloneTheme extends IColorTheme {
}
export interface IStandaloneThemeService extends IThemeService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
setTheme(themeName: string): string;
@@ -33,7 +33,7 @@ suite('TokenizationSupport2Adapter', () => {
}
class MockThemeService implements IStandaloneThemeService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
public setTheme(themeName: string): string {
throw new Error('Not implemented');
}
@@ -25,7 +25,7 @@ export class TestCodeEditorService extends AbstractCodeEditorService {
}
export class TestCommandService implements ICommandService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
private readonly _instantiationService: IInstantiationService;
@@ -16,7 +16,7 @@ suite('OpenerService', function () {
let lastCommand: { id: string; args: any[] } | undefined;
const commandService = new (class implements ICommandService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
onWillExecuteCommand = () => Disposable.None;
onDidExecuteCommand = () => Disposable.None;
executeCommand(id: string, ...args: any[]): Promise<any> {
@@ -442,7 +442,7 @@ assertComputeEdits(file1, file2);
export class TestTextResourcePropertiesService implements ITextResourcePropertiesService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
constructor(
@IConfigurationService private readonly configurationService: IConfigurationService,
@@ -10,7 +10,7 @@ import { RawContextKey } from 'vs/platform/contextkey/common/contextkey';
export const IAccessibilityService = createDecorator<IAccessibilityService>('accessibilityService');
export interface IAccessibilityService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
readonly onDidChangeScreenReaderOptimized: Event<void>;
@@ -10,7 +10,7 @@ import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/c
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
export class AccessibilityService extends Disposable implements IAccessibilityService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
private _accessibilityModeEnabledContext: IContextKey<boolean>;
protected _accessibilitySupport = AccessibilitySupport.Unknown;
+1 -1
View File
@@ -149,7 +149,7 @@ export const IMenuService = createDecorator<IMenuService>('menuService');
export interface IMenuService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
createMenu(id: MenuId, scopedKeybindingService: IContextKeyService): IMenu;
}
@@ -11,7 +11,7 @@ import { IContextKeyService, IContextKeyChangeEvent, ContextKeyExpression } from
export class MenuService implements IMenuService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
constructor(
@ICommandService private readonly _commandService: ICommandService
@@ -15,7 +15,7 @@ export interface IUserDataSyncAuthToken {
}
export interface IAuthenticationTokenService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
readonly token: IUserDataSyncAuthToken | undefined;
readonly onDidChangeToken: Event<IUserDataSyncAuthToken | undefined>;
@@ -22,7 +22,7 @@ export function isWorkspaceBackupInfo(obj: unknown): obj is IWorkspaceBackupInfo
}
export interface IBackupMainService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
isHotExitEnabled(): boolean;
@@ -23,7 +23,7 @@ import { Schemas } from 'vs/base/common/network';
export class BackupMainService implements IBackupMainService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
protected backupHome: string;
protected workspacesJsonPath: string;
@@ -9,7 +9,7 @@ import { $ } from 'vs/base/browser/dom';
export class BrowserClipboardService implements IClipboardService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
private readonly mapTextToType = new Map<string, string>(); // unsupported in web (only in-memory)
@@ -10,7 +10,7 @@ export const IClipboardService = createDecorator<IClipboardService>('clipboardSe
export interface IClipboardService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
/**
* Writes text to the system clipboard.
+1 -1
View File
@@ -19,7 +19,7 @@ export interface ICommandEvent {
}
export interface ICommandService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
onWillExecuteCommand: Event<ICommandEvent>;
onDidExecuteCommand: Event<ICommandEvent>;
executeCommand<T = any>(commandId: string, ...args: any[]): Promise<T | undefined>;
@@ -88,7 +88,7 @@ export interface IConfigurationValue<T> {
}
export interface IConfigurationService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
onDidChangeConfiguration: Event<IConfigurationChangeEvent>;
@@ -15,7 +15,7 @@ import { RunOnceScheduler } from 'vs/base/common/async';
export class ConfigurationService extends Disposable implements IConfigurationService, IDisposable {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
private configuration: Configuration;
private userConfiguration: UserSettings;
@@ -974,7 +974,7 @@ export interface IContextKeyChangeEvent {
}
export interface IContextKeyService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
dispose(): void;
onDidChangeContext: Event<IContextKeyChangeEvent>;
@@ -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: undefined;
declare readonly _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 extends IContextViewProvider {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
showContextView(delegate: IContextViewDelegate, container?: HTMLElement): void;
hideContextView(data?: any): void;
@@ -37,7 +37,7 @@ export const IContextMenuService = createDecorator<IContextMenuService>('context
export interface IContextMenuService {
_serviceBrand: undefined;
readonly _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: undefined;
declare readonly _serviceBrand: undefined;
private contextView: ContextView;
private container: HTMLElement;
@@ -9,7 +9,7 @@ export const ICredentialsService = createDecorator<ICredentialsService>('ICreden
export interface ICredentialsService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
getPassword(service: string, account: string): Promise<string | null>;
setPassword(service: string, account: string, password: string): Promise<void>;
@@ -9,7 +9,7 @@ import { IdleValue } from 'vs/base/common/async';
type KeytarModule = typeof import('keytar');
export class KeytarCredentialsService implements ICredentialsService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
private readonly _keytar = new IdleValue<Promise<KeytarModule>>(() => import('keytar'));
@@ -35,7 +35,7 @@ export interface ICloseSessionEvent {
}
export interface IExtensionHostDebugService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
reload(sessionId: string): void;
readonly onReload: Event<IReloadSessionEvent>;
@@ -55,7 +55,7 @@ export class ExtensionHostDebugBroadcastChannel<TContext> implements IServerChan
export class ExtensionHostDebugChannelClient extends Disposable implements IExtensionHostDebugService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
constructor(private channel: IChannel) {
super();
@@ -36,7 +36,7 @@ export class DiagnosticsChannel implements IServerChannel {
export class DiagnosticsService implements IDiagnosticsService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
constructor(private channel: IChannel) { }
@@ -23,7 +23,7 @@ export const ID = 'diagnosticsService';
export const IDiagnosticsService = createDecorator<IDiagnosticsService>(ID);
export interface IDiagnosticsService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
getPerformanceInfo(mainProcessInfo: IMainProcessInfo, remoteInfo: (IRemoteDiagnosticInfo | IRemoteDiagnosticError)[]): Promise<PerformanceInfo>;
getSystemInfo(mainProcessInfo: IMainProcessInfo, remoteInfo: (IRemoteDiagnosticInfo | IRemoteDiagnosticError)[]): Promise<SystemInfo>;
@@ -223,7 +223,7 @@ export function collectLaunchConfigs(folder: string): Promise<WorkspaceStatItem[
export class DiagnosticsService implements IDiagnosticsService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
constructor(@ITelemetryService private readonly telemetryService: ITelemetryService) { }
+2 -2
View File
@@ -160,7 +160,7 @@ export interface IDialogOptions {
*/
export interface IDialogService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
/**
* Ask the user for confirmation with a modal dialog.
@@ -189,7 +189,7 @@ export const IFileDialogService = createDecorator<IFileDialogService>('fileDialo
*/
export interface IFileDialogService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
/**
* The default path for a new file based on previously used files.
@@ -21,7 +21,7 @@ export const IDialogMainService = createDecorator<IDialogMainService>('dialogMai
export interface IDialogMainService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
pickFileFolder(options: INativeOpenDialogOptions, window?: BrowserWindow): Promise<string[] | undefined>;
pickFolder(options: INativeOpenDialogOptions, window?: BrowserWindow): Promise<string[] | undefined>;
@@ -44,7 +44,7 @@ interface IInternalNativeOpenDialogOptions extends INativeOpenDialogOptions {
export class DialogMainService implements IDialogMainService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
private static readonly workingDirPickerStorageKey = 'pickerWorkingDir';
@@ -8,7 +8,7 @@ import { IConfirmation, IConfirmationResult, IDialogService, IDialogOptions, ISh
export class TestDialogService implements IDialogService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
confirm(_confirmation: IConfirmation): Promise<IConfirmationResult> { return Promise.resolve({ confirmed: false }); }
show(_severity: Severity, _message: string, _buttons: string[], _options?: IDialogOptions): Promise<IShowResult> { return Promise.resolve({ choice: 0 }); }
+1 -1
View File
@@ -11,7 +11,7 @@ export const IDownloadService = createDecorator<IDownloadService>('downloadServi
export interface IDownloadService {
_serviceBrand: undefined;
readonly _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: undefined;
declare readonly _serviceBrand: undefined;
constructor(private channel: IChannel, private getUriTransformer: () => IURITransformer | null) { }
@@ -39,4 +39,4 @@ export class DownloadServiceChannelClient implements IDownloadService {
}
await this.channel.call('download', [from, to]);
}
}
}
@@ -12,7 +12,7 @@ import { Schemas } from 'vs/base/common/network';
export class DownloadService implements IDownloadService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
constructor(
@IRequestService private readonly requestService: IRequestService,
+1 -1
View File
@@ -19,7 +19,7 @@ export interface IElement {
}
export interface IDriver {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
getWindowIds(): Promise<number[]>;
capturePage(windowId: number): Promise<string>;
@@ -27,7 +27,7 @@ function isSilentKeyCode(keyCode: KeyCode) {
export class Driver implements IDriver, IWindowDriverRegistry {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
private registeredWindowIds = new Set<number>();
private reloadingWindowIds = new Set<number>();
+3 -3
View File
@@ -42,7 +42,7 @@ export class DriverChannel implements IServerChannel {
export class DriverChannelClient implements IDriver {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
constructor(private channel: IChannel) { }
@@ -136,7 +136,7 @@ export class WindowDriverRegistryChannel implements IServerChannel {
export class WindowDriverRegistryChannelClient implements IWindowDriverRegistry {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
constructor(private channel: IChannel) { }
@@ -177,7 +177,7 @@ export class WindowDriverChannel implements IServerChannel {
export class WindowDriverChannelClient implements IWindowDriver {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
constructor(private channel: IChannel) { }
+1 -1
View File
@@ -11,7 +11,7 @@ import { ISerializableCommandAction } from 'vs/platform/actions/common/actions';
export interface ICommonElectronService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
// Properties
readonly windowId: number;
@@ -29,7 +29,7 @@ export const IElectronMainService = createDecorator<IElectronMainService>('elect
export class ElectronMainService implements IElectronMainService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
constructor(
@IWindowsMainService private readonly windowsMainService: IWindowsMainService,
@@ -14,7 +14,7 @@ export interface IElectronService extends ICommonElectronService { }
export class ElectronService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
constructor(
readonly windowId: number,
@@ -26,7 +26,7 @@ export interface IEnvironmentService {
// UNLESS THIS PROPERTY IS SUPPORTED BOTH IN WEB AND DESKTOP!!!!
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
// --- user roaming data
userRoamingDataHome: URI;
@@ -50,7 +50,7 @@ export interface INativeEnvironmentService extends IEnvironmentService {
export class EnvironmentService implements INativeEnvironmentService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
get args(): ParsedArgs { return this._args; }
@@ -12,7 +12,7 @@ import { isUndefinedOrNull } from 'vs/base/common/types';
export class GlobalExtensionEnablementService extends Disposable implements IGlobalExtensionEnablementService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
private _onDidChangeEnablement = new Emitter<{ readonly extensions: IExtensionIdentifier[], readonly source?: string }>();
readonly onDidChangeEnablement: Event<{ readonly extensions: IExtensionIdentifier[], readonly source?: string }> = this._onDidChangeEnablement.event;
@@ -325,7 +325,7 @@ interface IRawExtensionsReport {
export class ExtensionGalleryService implements IExtensionGalleryService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
private extensionsGalleryUrl: string | undefined;
private extensionsControlUrl: string | undefined;
@@ -149,7 +149,7 @@ export interface ITranslation {
}
export interface IExtensionGalleryService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
isEnabled(): boolean;
query(token: CancellationToken): Promise<IPager<IGalleryExtension>>;
query(options: IQueryOptions, token: CancellationToken): Promise<IPager<IGalleryExtension>>;
@@ -196,7 +196,7 @@ export class ExtensionManagementError extends Error {
}
export interface IExtensionManagementService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
onInstallExtension: Event<InstallExtensionEvent>;
onDidInstallExtension: Event<DidInstallExtensionEvent>;
@@ -221,7 +221,7 @@ export const ENABLED_EXTENSIONS_STORAGE_PATH = 'extensionsIdentifiers/enabled';
export const IGlobalExtensionEnablementService = createDecorator<IGlobalExtensionEnablementService>('IGlobalExtensionEnablementService');
export interface IGlobalExtensionEnablementService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
readonly onDidChangeEnablement: Event<{ readonly extensions: IExtensionIdentifier[], readonly source?: string }>;
getDisabledExtensions(): IExtensionIdentifier[];
@@ -242,7 +242,7 @@ export type IWorkspaceTips = { readonly remoteSet: string[]; readonly recommenda
export const IExtensionTipsService = createDecorator<IExtensionTipsService>('IExtensionTipsService');
export interface IExtensionTipsService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
getConfigBasedTips(folder: URI): Promise<IConfigBasedExtensionTip[]>;
getImportantExecutableBasedTips(): Promise<IExecutableBasedExtensionTip[]>;
@@ -77,7 +77,7 @@ export class ExtensionManagementChannel implements IServerChannel {
export class ExtensionManagementChannelClient implements IExtensionManagementService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
constructor(
private readonly channel: IChannel,
@@ -62,7 +62,7 @@ interface InstallableExtension {
export class ExtensionManagementService extends Disposable implements IExtensionManagementService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
private readonly extensionsScanner: ExtensionsScanner;
private reportedExtensions: Promise<IReportedExtension[]> | undefined;
+1 -1
View File
@@ -22,7 +22,7 @@ import { createReadStream } from 'vs/platform/files/common/io';
export class FileService extends Disposable implements IFileService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
private readonly BUFFER_SIZE = 64 * 1024;
+1 -1
View File
@@ -21,7 +21,7 @@ export const IFileService = createDecorator<IFileService>('fileService');
export interface IFileService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
/**
* An event that is fired when a file system provider is added or removed
@@ -85,7 +85,7 @@ type GetLeadingNonServiceArgs<Args> =
export interface IInstantiationService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
/**
* Synchronously creates an instance that is denoted by
@@ -22,7 +22,7 @@ class CyclicDependencyError extends Error {
export class InstantiationService implements IInstantiationService {
_serviceBrand: undefined;
declare readonly _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: undefined;
readonly _serviceBrand: undefined;
c: number;
}
class Service1 implements IService1 {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
c = 1;
}
let IService2 = createDecorator<IService2>('service2');
interface IService2 {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
d: boolean;
}
class Service2 implements IService2 {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
d = true;
}
let IService3 = createDecorator<IService3>('service3');
interface IService3 {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
s: string;
}
class Service3 implements IService3 {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
s = 'farboo';
}
let IDependentService = createDecorator<IDependentService>('dependentService');
interface IDependentService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
name: string;
}
class DependentService implements IDependentService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
constructor(@IService1 service: IService1) {
assert.equal(service.c, 1);
}
@@ -116,7 +116,7 @@ class DependentServiceTarget2 {
class ServiceLoop1 implements IService1 {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
c = 1;
constructor(@IService2 s: IService2) {
@@ -125,7 +125,7 @@ class ServiceLoop1 implements IService1 {
}
class ServiceLoop2 implements IService2 {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
d = true;
constructor(@IService1 s: IService1) {
@@ -364,7 +364,7 @@ suite('Instantiation Service', () => {
let serviceInstanceCount = 0;
const CtorCounter = class implements Service1 {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
c = 1;
constructor() {
serviceInstanceCount += 1;
@@ -10,7 +10,7 @@ export const ISharedProcessService = createDecorator<ISharedProcessService>('sha
export interface ISharedProcessService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
getChannel(channelName: string): IChannel;
registerChannel(channelName: string, channel: IServerChannel<string>): void;
@@ -9,7 +9,7 @@ export const ISharedProcessMainService = createDecorator<ISharedProcessMainServi
export interface ISharedProcessMainService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
whenSharedProcessReady(): Promise<void>;
toggleSharedProcessWindow(): Promise<void>;
@@ -22,7 +22,7 @@ export interface ISharedProcess {
export class SharedProcessMainService implements ISharedProcessMainService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
constructor(private sharedProcess: ISharedProcess) { }
@@ -12,7 +12,7 @@ export const IMainProcessService = createDecorator<IMainProcessService>('mainPro
export interface IMainProcessService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
getChannel(channelName: string): IChannel;
@@ -21,7 +21,7 @@ export interface IMainProcessService {
export class MainProcessService extends Disposable implements IMainProcessService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
private mainProcessConnection: Client;
+1 -1
View File
@@ -88,7 +88,7 @@ export interface ProcessExplorerData extends WindowData {
}
export interface ICommonIssueService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
openReporter(data: IssueReporterData): Promise<void>;
openProcessExplorer(data: ProcessExplorerData): Promise<void>;
getSystemStatus(): Promise<string>;
@@ -28,7 +28,7 @@ export const IIssueMainService = createDecorator<IIssueMainService>('issueMainSe
export interface IIssueMainService extends ICommonIssueService { }
export class IssueMainService implements ICommonIssueService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
_issueWindow: BrowserWindow | null = null;
_issueParentWindow: BrowserWindow | null = null;
_processExplorerWindow: BrowserWindow | null = null;
@@ -48,7 +48,7 @@ export interface KeybindingsSchemaContribution {
export const IKeybindingService = createDecorator<IKeybindingService>('keybindingService');
export interface IKeybindingService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
readonly inChordMode: boolean;
+1 -1
View File
@@ -16,7 +16,7 @@ export const ILabelService = createDecorator<ILabelService>('labelService');
export interface ILabelService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
/**
* Gets the human readable label for a uri.
@@ -51,7 +51,7 @@ function parseOpenUrl(args: ParsedArgs): URI[] {
}
export interface ILaunchMainService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
start(args: ParsedArgs, userEnv: IProcessEnvironment): Promise<void>;
getMainProcessId(): Promise<number>;
getMainProcessInfo(): Promise<IMainProcessInfo>;
@@ -60,7 +60,7 @@ export interface ILaunchMainService {
export class LaunchMainService implements ILaunchMainService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
constructor(
@ILogService private readonly logService: ILogService,
@@ -11,7 +11,7 @@ export const ILayoutService = createDecorator<ILayoutService>('layoutService');
export interface ILayoutService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
/**
* The dimensions of the container.
@@ -123,7 +123,7 @@ export function LifecyclePhaseToString(phase: LifecyclePhase) {
*/
export interface ILifecycleService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
/**
* Value indicates how this window got loaded.
@@ -12,7 +12,7 @@ import { mark } from 'vs/base/common/performance';
export abstract class AbstractLifecycleService extends Disposable implements ILifecycleService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
protected readonly _onBeforeShutdown = this._register(new Emitter<BeforeShutdownEvent>());
readonly onBeforeShutdown = this._onBeforeShutdown.event;
@@ -41,7 +41,7 @@ export interface ShutdownEvent {
export interface ILifecycleMainService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
/**
* Will be true if the program was restarted (e.g. due to explicit request or update).
@@ -137,7 +137,7 @@ export const enum LifecycleMainPhase {
export class LifecycleMainService extends Disposable implements ILifecycleMainService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
private static readonly QUIT_FROM_RESTART_MARKER = 'quit.from.restart'; // use a marker to find out if the session was restarted
+2 -2
View File
@@ -33,7 +33,7 @@ export const IListService = createDecorator<IListService>('listService');
export interface IListService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
/**
* Returns the currently focused list widget if any.
@@ -48,7 +48,7 @@ interface IRegisteredList {
export class ListService implements IListService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
private disposables = new DisposableStore();
private lists: IRegisteredList[] = [];
@@ -26,7 +26,7 @@ export const enum LanguageType {
export const ILocalizationsService = createDecorator<ILocalizationsService>('localizationsService');
export interface ILocalizationsService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
readonly onDidLanguagesChange: Event<void>;
getLanguageIds(type?: LanguageType): Promise<string[]>;
@@ -54,4 +54,4 @@ export function isValidLocalization(localization: ILocalization): boolean {
return false;
}
return true;
}
}
@@ -35,7 +35,7 @@ if (product.quality !== 'stable') {
export class LocalizationsService extends Disposable implements ILocalizationsService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
private readonly cache: LanguagePacksCache;
+1 -1
View File
@@ -18,7 +18,7 @@ export class ConsoleLogInAutomationService extends LogServiceAdapter implements
declare codeAutomationLog: any;
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
constructor(logLevel: LogLevel = DEFAULT_LOG_LEVEL) {
super({ consoleLog: (type, args) => this.consoleLog(type, args) }, logLevel);
+1 -1
View File
@@ -24,7 +24,7 @@ function getLogFunction(logger: ILogService, level: LogLevel): Function {
export class BufferLogService extends AbstractLogService implements ILogService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
private buffer: ILog[] = [];
private _logger: ILogService | undefined = undefined;
+2 -2
View File
@@ -17,7 +17,7 @@ const MAX_FILE_SIZE = 1024 * 1024 * 5;
export class FileLogService extends AbstractLogService implements ILogService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
private readonly initializePromise: Promise<void>;
private readonly queue: Queue<void>;
@@ -157,7 +157,7 @@ export class FileLogService extends AbstractLogService implements ILogService {
export class FileLoggerService extends Disposable implements ILoggerService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
private readonly loggers = new Map<string, ILogger>();
+9 -9
View File
@@ -50,11 +50,11 @@ export interface ILogger extends IDisposable {
}
export interface ILogService extends ILogger {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
}
export interface ILoggerService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
getLogger(file: URI): ILogger;
}
@@ -80,7 +80,7 @@ export abstract class AbstractLogService extends Disposable {
export class ConsoleLogMainService extends AbstractLogService implements ILogService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
private useColors: boolean;
constructor(logLevel: LogLevel = DEFAULT_LOG_LEVEL) {
@@ -161,7 +161,7 @@ export class ConsoleLogMainService extends AbstractLogService implements ILogSer
export class ConsoleLogService extends AbstractLogService implements ILogService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
constructor(logLevel: LogLevel = DEFAULT_LOG_LEVEL) {
super();
@@ -215,7 +215,7 @@ export class ConsoleLogService extends AbstractLogService implements ILogService
export class LogServiceAdapter extends AbstractLogService implements ILogService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
constructor(private readonly adapter: { consoleLog: (type: string, args: any[]) => void }, logLevel: LogLevel = DEFAULT_LOG_LEVEL) {
super();
@@ -277,7 +277,7 @@ export class LogServiceAdapter extends AbstractLogService implements ILogService
export class ConsoleLogInMainService extends LogServiceAdapter implements ILogService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
constructor(client: LoggerChannelClient, logLevel: LogLevel = DEFAULT_LOG_LEVEL) {
super({ consoleLog: (type, args) => client.consoleLog(type, args) }, logLevel);
@@ -285,7 +285,7 @@ export class ConsoleLogInMainService extends LogServiceAdapter implements ILogSe
}
export class MultiplexLogService extends AbstractLogService implements ILogService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
constructor(private readonly logServices: ReadonlyArray<ILogService>) {
super();
@@ -351,7 +351,7 @@ export class MultiplexLogService extends AbstractLogService implements ILogServi
}
export class DelegatedLogService extends Disposable implements ILogService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
constructor(private logService: ILogService) {
super();
@@ -400,7 +400,7 @@ export class DelegatedLogService extends Disposable implements ILogService {
}
export class NullLogService implements ILogService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
readonly onDidChangeLogLevel: Event<LogLevel> = new Emitter<LogLevel>().event;
setLevel(level: LogLevel): void { }
getLevel(): LogLevel { return LogLevel.Info; }
+1 -1
View File
@@ -73,7 +73,7 @@ export class LoggerChannelClient {
}
export class FollowerLogService extends DelegatedLogService implements ILogService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
constructor(private master: LoggerChannelClient, logService: ILogService) {
super(logService);
+1 -1
View File
@@ -14,7 +14,7 @@ import { SpdLogService } from 'vs/platform/log/node/spdlogService';
export class LoggerService extends Disposable implements ILoggerService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
private readonly loggers = new Map<string, ILogger>();
+1 -1
View File
@@ -44,7 +44,7 @@ function log(logger: spdlog.RotatingLogger, level: LogLevel, message: string): v
export class SpdLogService extends AbstractLogService implements ILogService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
private buffer: ILog[] = [];
private _loggerCreationPromise: Promise<void> | undefined = undefined;
@@ -139,7 +139,7 @@ class MarkerStats implements MarkerStatistics {
export class MarkerService implements IMarkerService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
private readonly _onMarkerChanged = new Emitter<readonly URI[]>();
readonly onMarkerChanged: Event<readonly URI[]> = Event.debounce(this._onMarkerChanged.event, MarkerService._debouncer, 0);
+1 -1
View File
@@ -10,7 +10,7 @@ import { localize } from 'vs/nls';
import Severity from 'vs/base/common/severity';
export interface IMarkerService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
getStatistics(): MarkerStatistics;
@@ -12,12 +12,12 @@ import { ILifecycleMainService, LifecycleMainPhase } from 'vs/platform/lifecycle
export const IMenubarMainService = createDecorator<IMenubarMainService>('menubarMainService');
export interface IMenubarMainService extends ICommonMenubarService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
}
export class MenubarMainService implements IMenubarMainService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
private menubar: Promise<Menubar>;

Some files were not shown because too many files have changed in this diff Show More