From 36a0800b176d577d1af4be5a1426e73c32d1d29e Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Tue, 28 Dec 2021 22:33:44 +0100 Subject: [PATCH] Better names --- build/monaco/monaco.d.ts.recipe | 2 +- src/vs/editor/common/standaloneStrings.ts | 2 +- .../browser/standaloneCodeEditor.ts | 2 +- .../standalone/browser/standaloneEditor.ts | 48 +++++++------- .../standalone/browser/standaloneLanguages.ts | 22 +++---- .../browser/standaloneLayoutService.ts | 6 +- ...impleServices.ts => standaloneServices.ts} | 66 +++++++++---------- ...ces.test.ts => standaloneServices.test.ts} | 6 +- 8 files changed, 77 insertions(+), 77 deletions(-) rename src/vs/editor/standalone/browser/{simpleServices.ts => standaloneServices.ts} (93%) rename src/vs/editor/standalone/test/browser/{simpleServices.test.ts => standaloneServices.test.ts} (88%) diff --git a/build/monaco/monaco.d.ts.recipe b/build/monaco/monaco.d.ts.recipe index af945e9911e..13814c908f7 100644 --- a/build/monaco/monaco.d.ts.recipe +++ b/build/monaco/monaco.d.ts.recipe @@ -64,7 +64,7 @@ export interface ICommandHandler { (...args: any[]): void; } #include(vs/platform/contextkey/common/contextkey): IContextKey -#include(vs/editor/standalone/browser/simpleServices): IEditorOverrideServices +#include(vs/editor/standalone/browser/standaloneServices): IEditorOverrideServices #include(vs/platform/markers/common/markers): IMarker, IMarkerData, IRelatedInformation #include(vs/editor/standalone/browser/colorizer): IColorizerOptions, IColorizerElementOptions #include(vs/base/common/scrollable): ScrollbarVisibility diff --git a/src/vs/editor/common/standaloneStrings.ts b/src/vs/editor/common/standaloneStrings.ts index 88104a63373..b24c8b7e6a3 100644 --- a/src/vs/editor/common/standaloneStrings.ts +++ b/src/vs/editor/common/standaloneStrings.ts @@ -62,6 +62,6 @@ export namespace ToggleHighContrastNLS { export const toggleHighContrast = nls.localize('toggleHighContrast', "Toggle High Contrast Theme"); } -export namespace SimpleServicesNLS { +export namespace StandaloneServicesNLS { export const bulkEditServiceSummary = nls.localize('bulkEditServiceSummary', "Made {0} edits in {1} files"); } diff --git a/src/vs/editor/standalone/browser/standaloneCodeEditor.ts b/src/vs/editor/standalone/browser/standaloneCodeEditor.ts index 358f89e7861..aad81efdbe4 100644 --- a/src/vs/editor/standalone/browser/standaloneCodeEditor.ts +++ b/src/vs/editor/standalone/browser/standaloneCodeEditor.ts @@ -14,7 +14,7 @@ import { InternalEditorAction } from 'vs/editor/common/editorAction'; import { IModelChangedEvent } from 'vs/editor/common/editorCommon'; import { ITextModel } from 'vs/editor/common/model'; import { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerService'; -import { StandaloneKeybindingService, updateConfigurationService } from 'vs/editor/standalone/browser/simpleServices'; +import { StandaloneKeybindingService, updateConfigurationService } from 'vs/editor/standalone/browser/standaloneServices'; import { IStandaloneThemeService } from 'vs/editor/standalone/common/standaloneThemeService'; import { IMenuItem, MenuId, MenuRegistry } from 'vs/platform/actions/common/actions'; import { CommandsRegistry, ICommandHandler, ICommandService } from 'vs/platform/commands/common/commands'; diff --git a/src/vs/editor/standalone/browser/standaloneEditor.ts b/src/vs/editor/standalone/browser/standaloneEditor.ts index 236b2b94bc8..79a55100754 100644 --- a/src/vs/editor/standalone/browser/standaloneEditor.ts +++ b/src/vs/editor/standalone/browser/standaloneEditor.ts @@ -21,7 +21,7 @@ import { IWebWorkerOptions, MonacoWebWorker, createWebWorker as actualCreateWebW import * as standaloneEnums from 'vs/editor/common/standalone/standaloneEnums'; import { Colorizer, IColorizerElementOptions, IColorizerOptions } from 'vs/editor/standalone/browser/colorizer'; import { IStandaloneEditorConstructionOptions, IStandaloneCodeEditor, IStandaloneDiffEditor, StandaloneDiffEditor, StandaloneEditor, createTextModel, IStandaloneDiffEditorConstructionOptions } from 'vs/editor/standalone/browser/standaloneCodeEditor'; -import { IEditorOverrideServices, StaticServices } from 'vs/editor/standalone/browser/simpleServices'; +import { IEditorOverrideServices, StandaloneServices } from 'vs/editor/standalone/browser/standaloneServices'; import { IStandaloneThemeData, IStandaloneThemeService } from 'vs/editor/standalone/common/standaloneThemeService'; import { CommandsRegistry } from 'vs/platform/commands/common/commands'; import { IMarker, IMarkerData, IMarkerService } from 'vs/platform/markers/common/markers'; @@ -37,7 +37,7 @@ import { ILanguageConfigurationService } from 'vs/editor/common/modes/languageCo * The editor will read the size of `domElement`. */ export function create(domElement: HTMLElement, options?: IStandaloneEditorConstructionOptions, override?: IEditorOverrideServices): IStandaloneCodeEditor { - const instantiationService = StaticServices.initialize(override || {}); + const instantiationService = StandaloneServices.initialize(override || {}); return instantiationService.createInstance(StandaloneEditor, domElement, options); } @@ -47,7 +47,7 @@ export function create(domElement: HTMLElement, options?: IStandaloneEditorConst * @event */ export function onDidCreateEditor(listener: (codeEditor: ICodeEditor) => void): IDisposable { - const codeEditorService = StaticServices.get(ICodeEditorService); + const codeEditorService = StandaloneServices.get(ICodeEditorService); return codeEditorService.onCodeEditorAdd((editor) => { listener(editor); }); @@ -59,7 +59,7 @@ export function onDidCreateEditor(listener: (codeEditor: ICodeEditor) => void): * The editor will read the size of `domElement`. */ export function createDiffEditor(domElement: HTMLElement, options?: IStandaloneDiffEditorConstructionOptions, override?: IEditorOverrideServices): IStandaloneDiffEditor { - const instantiationService = StaticServices.initialize(override || {}); + const instantiationService = StandaloneServices.initialize(override || {}); return instantiationService.createInstance(StandaloneDiffEditor, domElement, options); } @@ -78,10 +78,10 @@ export function createDiffNavigator(diffEditor: IStandaloneDiffEditor, opts?: ID * You can specify the language that should be set for this model or let the language be inferred from the `uri`. */ export function createModel(value: string, language?: string, uri?: URI): ITextModel { - const languageService = StaticServices.get(ILanguageService); + const languageService = StandaloneServices.get(ILanguageService); const languageId = languageService.getLanguageIdByMimeType(language) || language; return createTextModel( - StaticServices.get(IModelService), + StandaloneServices.get(IModelService), languageService, value, languageId, @@ -93,8 +93,8 @@ export function createModel(value: string, language?: string, uri?: URI): ITextM * Change the language for a model. */ export function setModelLanguage(model: ITextModel, languageId: string): void { - const languageService = StaticServices.get(ILanguageService); - const modelService = StaticServices.get(IModelService); + const languageService = StandaloneServices.get(ILanguageService); + const modelService = StandaloneServices.get(IModelService); modelService.setMode(model, languageService.createById(languageId)); } @@ -103,7 +103,7 @@ export function setModelLanguage(model: ITextModel, languageId: string): void { */ export function setModelMarkers(model: ITextModel, owner: string, markers: IMarkerData[]): void { if (model) { - const markerService = StaticServices.get(IMarkerService); + const markerService = StandaloneServices.get(IMarkerService); markerService.changeOne(owner, model.uri, markers); } } @@ -114,7 +114,7 @@ export function setModelMarkers(model: ITextModel, owner: string, markers: IMark * @returns list of markers */ export function getModelMarkers(filter: { owner?: string, resource?: URI, take?: number }): IMarker[] { - const markerService = StaticServices.get(IMarkerService); + const markerService = StandaloneServices.get(IMarkerService); return markerService.read(filter); } @@ -123,7 +123,7 @@ export function getModelMarkers(filter: { owner?: string, resource?: URI, take?: * @event */ export function onDidChangeMarkers(listener: (e: readonly URI[]) => void): IDisposable { - const markerService = StaticServices.get(IMarkerService); + const markerService = StandaloneServices.get(IMarkerService); return markerService.onMarkerChanged(listener); } @@ -131,7 +131,7 @@ export function onDidChangeMarkers(listener: (e: readonly URI[]) => void): IDisp * Get the model that has `uri` if it exists. */ export function getModel(uri: URI): ITextModel | null { - const modelService = StaticServices.get(IModelService); + const modelService = StandaloneServices.get(IModelService); return modelService.getModel(uri); } @@ -139,7 +139,7 @@ export function getModel(uri: URI): ITextModel | null { * Get all the created models. */ export function getModels(): ITextModel[] { - const modelService = StaticServices.get(IModelService); + const modelService = StandaloneServices.get(IModelService); return modelService.getModels(); } @@ -148,7 +148,7 @@ export function getModels(): ITextModel[] { * @event */ export function onDidCreateModel(listener: (model: ITextModel) => void): IDisposable { - const modelService = StaticServices.get(IModelService); + const modelService = StandaloneServices.get(IModelService); return modelService.onModelAdded(listener); } @@ -157,7 +157,7 @@ export function onDidCreateModel(listener: (model: ITextModel) => void): IDispos * @event */ export function onWillDisposeModel(listener: (model: ITextModel) => void): IDisposable { - const modelService = StaticServices.get(IModelService); + const modelService = StandaloneServices.get(IModelService); return modelService.onModelRemoved(listener); } @@ -166,7 +166,7 @@ export function onWillDisposeModel(listener: (model: ITextModel) => void): IDisp * @event */ export function onDidChangeModelLanguage(listener: (e: { readonly model: ITextModel; readonly oldLanguage: string; }) => void): IDisposable { - const modelService = StaticServices.get(IModelService); + const modelService = StandaloneServices.get(IModelService); return modelService.onModelLanguageChanged((e) => { listener({ model: e.model, @@ -180,15 +180,15 @@ export function onDidChangeModelLanguage(listener: (e: { readonly model: ITextMo * Specify an AMD module to load that will `create` an object that will be proxied. */ export function createWebWorker(opts: IWebWorkerOptions): MonacoWebWorker { - return actualCreateWebWorker(StaticServices.get(IModelService), StaticServices.get(ILanguageConfigurationService), opts); + return actualCreateWebWorker(StandaloneServices.get(IModelService), StandaloneServices.get(ILanguageConfigurationService), opts); } /** * Colorize the contents of `domNode` using attribute `data-lang`. */ export function colorizeElement(domNode: HTMLElement, options: IColorizerElementOptions): Promise { - const languageService = StaticServices.get(ILanguageService); - const themeService = StaticServices.get(IStandaloneThemeService); + const languageService = StandaloneServices.get(ILanguageService); + const themeService = StandaloneServices.get(IStandaloneThemeService); themeService.registerEditorContainer(domNode); return Colorizer.colorizeElement(themeService, languageService, domNode, options); } @@ -197,8 +197,8 @@ export function colorizeElement(domNode: HTMLElement, options: IColorizerElement * Colorize `text` using language `languageId`. */ export function colorize(text: string, languageId: string, options: IColorizerOptions): Promise { - const languageService = StaticServices.get(ILanguageService); - const themeService = StaticServices.get(IStandaloneThemeService); + const languageService = StandaloneServices.get(ILanguageService); + const themeService = StandaloneServices.get(IStandaloneThemeService); themeService.registerEditorContainer(document.body); return Colorizer.colorize(languageService, text, languageId, options); } @@ -207,7 +207,7 @@ export function colorize(text: string, languageId: string, options: IColorizerOp * Colorize a line in a model. */ export function colorizeModelLine(model: ITextModel, lineNumber: number, tabSize: number = 4): string { - const themeService = StaticServices.get(IStandaloneThemeService); + const themeService = StandaloneServices.get(IStandaloneThemeService); themeService.registerEditorContainer(document.body); return Colorizer.colorizeModelLine(model, lineNumber, tabSize); } @@ -251,7 +251,7 @@ export function tokenize(text: string, languageId: string): Token[][] { * Define a new theme or update an existing theme. */ export function defineTheme(themeName: string, themeData: IStandaloneThemeData): void { - const standaloneThemeService = StaticServices.get(IStandaloneThemeService); + const standaloneThemeService = StandaloneServices.get(IStandaloneThemeService); standaloneThemeService.defineTheme(themeName, themeData); } @@ -259,7 +259,7 @@ export function defineTheme(themeName: string, themeData: IStandaloneThemeData): * Switches to a theme. */ export function setTheme(themeName: string): void { - const standaloneThemeService = StaticServices.get(IStandaloneThemeService); + const standaloneThemeService = StandaloneServices.get(IStandaloneThemeService); standaloneThemeService.setTheme(themeName); } diff --git a/src/vs/editor/standalone/browser/standaloneLanguages.ts b/src/vs/editor/standalone/browser/standaloneLanguages.ts index 54ac5be5e36..bf0418695c0 100644 --- a/src/vs/editor/standalone/browser/standaloneLanguages.ts +++ b/src/vs/editor/standalone/browser/standaloneLanguages.ts @@ -16,7 +16,7 @@ import { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageCo import { ModesRegistry } from 'vs/editor/common/modes/modesRegistry'; import { ILanguageExtensionPoint, ILanguageService } from 'vs/editor/common/services/languageService'; import * as standaloneEnums from 'vs/editor/common/standalone/standaloneEnums'; -import { StaticServices } from 'vs/editor/standalone/browser/simpleServices'; +import { StandaloneServices } from 'vs/editor/standalone/browser/standaloneServices'; import { compile } from 'vs/editor/standalone/common/monarch/monarchCompile'; import { MonarchTokenizer } from 'vs/editor/standalone/common/monarch/monarchLexer'; import { IMonarchLanguage } from 'vs/editor/standalone/common/monarch/monarchTypes'; @@ -40,7 +40,7 @@ export function getLanguages(): ILanguageExtensionPoint[] { } export function getEncodedLanguageId(languageId: string): number { - const languageService = StaticServices.get(ILanguageService); + const languageService = StandaloneServices.get(ILanguageService); return languageService.languageIdCodec.encodeLanguageId(languageId); } @@ -49,7 +49,7 @@ export function getEncodedLanguageId(languageId: string): number { * @event */ export function onLanguage(languageId: string, callback: () => void): IDisposable { - const languageService = StaticServices.get(ILanguageService); + const languageService = StandaloneServices.get(ILanguageService); const disposable = languageService.onDidEncounterLanguage((encounteredLanguageId) => { if (encounteredLanguageId === languageId) { // stop listening @@ -65,7 +65,7 @@ export function onLanguage(languageId: string, callback: () => void): IDisposabl * Set the editing configuration for a language. */ export function setLanguageConfiguration(languageId: string, configuration: LanguageConfiguration): IDisposable { - const languageService = StaticServices.get(ILanguageService); + const languageService = StandaloneServices.get(ILanguageService); if (!languageService.isRegisteredLanguageId(languageId)) { throw new Error(`Cannot set configuration for unknown language ${languageId}`); } @@ -326,7 +326,7 @@ function isThenable(obj: any): obj is Thenable { * Supported formats (hex): #RRGGBB, $RRGGBBAA, #RGB, #RGBA */ export function setColorMap(colorMap: string[] | null): void { - const standaloneThemeService = StaticServices.get(IStandaloneThemeService); + const standaloneThemeService = StandaloneServices.get(IStandaloneThemeService); if (colorMap) { const result: Color[] = [null!]; for (let i = 1, len = colorMap.length; i < len; i++) { @@ -348,8 +348,8 @@ function createTokenizationSupportAdapter(languageId: string, provider: TokensPr return new TokenizationSupportAdapter( languageId, provider, - StaticServices.get(ILanguageService), - StaticServices.get(IStandaloneThemeService), + StandaloneServices.get(ILanguageService), + StandaloneServices.get(IStandaloneThemeService), ); } } @@ -369,7 +369,7 @@ export function registerTokensProviderFactory(languageId: string, factory: Token if (isATokensProvider(result)) { return createTokenizationSupportAdapter(languageId, result); } - return new MonarchTokenizer(StaticServices.get(ILanguageService), StaticServices.get(IStandaloneThemeService), languageId, compile(languageId, result)); + return new MonarchTokenizer(StandaloneServices.get(ILanguageService), StandaloneServices.get(IStandaloneThemeService), languageId, compile(languageId, result)); } }; return modes.TokenizationRegistry.registerFactory(languageId, adaptedFactory); @@ -382,7 +382,7 @@ export function registerTokensProviderFactory(languageId: string, factory: Token * or `registerDocumentRangeSemanticTokensProvider`. */ export function setTokensProvider(languageId: string, provider: TokensProvider | EncodedTokensProvider | Thenable): IDisposable { - const languageService = StaticServices.get(ILanguageService); + const languageService = StandaloneServices.get(ILanguageService); if (!languageService.isRegisteredLanguageId(languageId)) { throw new Error(`Cannot set tokens provider for unknown language ${languageId}`); } @@ -400,7 +400,7 @@ export function setTokensProvider(languageId: string, provider: TokensProvider | */ export function setMonarchTokensProvider(languageId: string, languageDef: IMonarchLanguage | Thenable): IDisposable { const create = (languageDef: IMonarchLanguage) => { - return new MonarchTokenizer(StaticServices.get(ILanguageService), StaticServices.get(IStandaloneThemeService), languageId, compile(languageId, languageDef)); + return new MonarchTokenizer(StandaloneServices.get(ILanguageService), StandaloneServices.get(IStandaloneThemeService), languageId, compile(languageId, languageDef)); }; if (isThenable(languageDef)) { return registerTokensProviderFactory(languageId, { create: () => languageDef }); @@ -509,7 +509,7 @@ export function registerCodeActionProvider(languageId: string, provider: CodeAct return modes.CodeActionProviderRegistry.register(languageId, { providedCodeActionKinds: metadata?.providedCodeActionKinds, provideCodeActions: (model: model.ITextModel, range: Range, context: modes.CodeActionContext, token: CancellationToken): modes.ProviderResult => { - const markerService = StaticServices.get(IMarkerService); + const markerService = StandaloneServices.get(IMarkerService); const markers = markerService.read({ resource: model.uri }).filter(m => { return Range.areIntersectingOrTouching(m, range); }); diff --git a/src/vs/editor/standalone/browser/standaloneLayoutService.ts b/src/vs/editor/standalone/browser/standaloneLayoutService.ts index c0c0c0925a6..6ded16a8be7 100644 --- a/src/vs/editor/standalone/browser/standaloneLayoutService.ts +++ b/src/vs/editor/standalone/browser/standaloneLayoutService.ts @@ -9,7 +9,7 @@ import { ILayoutService } from 'vs/platform/layout/browser/layoutService'; import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; -class SimpleLayoutService implements ILayoutService { +class StandaloneLayoutService implements ILayoutService { declare readonly _serviceBrand: undefined; public onDidLayout = Event.None; @@ -45,7 +45,7 @@ class SimpleLayoutService implements ILayoutService { ) { } } -export class EditorScopedLayoutService extends SimpleLayoutService { +export class EditorScopedLayoutService extends StandaloneLayoutService { override get hasContainer(): boolean { return false; } @@ -60,4 +60,4 @@ export class EditorScopedLayoutService extends SimpleLayoutService { } } -registerSingleton(ILayoutService, SimpleLayoutService); +registerSingleton(ILayoutService, StandaloneLayoutService); diff --git a/src/vs/editor/standalone/browser/simpleServices.ts b/src/vs/editor/standalone/browser/standaloneServices.ts similarity index 93% rename from src/vs/editor/standalone/browser/simpleServices.ts rename to src/vs/editor/standalone/browser/standaloneServices.ts index b1fc66c993e..583cba551dc 100644 --- a/src/vs/editor/standalone/browser/simpleServices.ts +++ b/src/vs/editor/standalone/browser/standaloneServices.ts @@ -40,7 +40,7 @@ import { ITelemetryInfo, ITelemetryService, TelemetryLevel } from 'vs/platform/t import { IWorkspace, IWorkspaceContextService, IWorkspaceFolder, IWorkspaceFoldersChangeEvent, IWorkspaceFoldersWillChangeEvent, WorkbenchState, WorkspaceFolder } from 'vs/platform/workspace/common/workspace'; import { ISingleFolderWorkspaceIdentifier, IWorkspaceIdentifier } from 'vs/platform/workspaces/common/workspaces'; import { ILayoutService } from 'vs/platform/layout/browser/layoutService'; -import { SimpleServicesNLS } from 'vs/editor/common/standaloneStrings'; +import { StandaloneServicesNLS } from 'vs/editor/common/standaloneStrings'; import { ClassifiedEvent, StrictPropertyCheck, GDPRClassification } from 'vs/platform/telemetry/common/gdprTypings'; import { basename } from 'vs/base/common/resources'; import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; @@ -132,7 +132,7 @@ class SimpleModel implements IResolvedTextEditorModel { } } -class SimpleTextModelService implements ITextModelService { +class StandaloneTextModelService implements ITextModelService { public _serviceBrand: undefined; constructor( @@ -160,7 +160,7 @@ class SimpleTextModelService implements ITextModelService { } } -class SimpleEditorProgressService implements IEditorProgressService { +class StandaloneEditorProgressService implements IEditorProgressService { declare readonly _serviceBrand: undefined; private static NULL_PROGRESS_RUNNER: IProgressRunner = { @@ -172,7 +172,7 @@ class SimpleEditorProgressService implements IEditorProgressService { show(infinite: true, delay?: number): IProgressRunner; show(total: number, delay?: number): IProgressRunner; show(): IProgressRunner { - return SimpleEditorProgressService.NULL_PROGRESS_RUNNER; + return StandaloneEditorProgressService.NULL_PROGRESS_RUNNER; } async showWhile(promise: Promise, delay?: number): Promise { @@ -180,7 +180,7 @@ class SimpleEditorProgressService implements IEditorProgressService { } } -class SimpleDialogService implements IDialogService { +class StandaloneDialogService implements IDialogService { public _serviceBrand: undefined; @@ -218,7 +218,7 @@ class SimpleDialogService implements IDialogService { } } -export class SimpleNotificationService implements INotificationService { +export class StandaloneNotificationService implements INotificationService { readonly onDidAddNotification: Event = Event.None; @@ -253,11 +253,11 @@ export class SimpleNotificationService implements INotificationService { break; } - return SimpleNotificationService.NO_OP; + return StandaloneNotificationService.NO_OP; } public prompt(severity: Severity, message: string, choices: IPromptChoice[], options?: IPromptOptions): INotificationHandle { - return SimpleNotificationService.NO_OP; + return StandaloneNotificationService.NO_OP; } public status(message: string | Error, options?: IStatusMessageOptions): IDisposable { @@ -503,7 +503,7 @@ function isConfigurationOverrides(thing: any): thing is IConfigurationOverrides && (!thing.resource || thing.resource instanceof URI); } -export class SimpleConfigurationService implements IConfigurationService { +export class StandaloneConfigurationService implements IConfigurationService { declare readonly _serviceBrand: undefined; @@ -581,7 +581,7 @@ export class SimpleConfigurationService implements IConfigurationService { } } -class SimpleResourceConfigurationService implements ITextResourceConfigurationService { +class StandaloneResourceConfigurationService implements ITextResourceConfigurationService { declare readonly _serviceBrand: undefined; @@ -589,7 +589,7 @@ class SimpleResourceConfigurationService implements ITextResourceConfigurationSe public readonly onDidChangeConfiguration = this._onDidChangeConfiguration.event; constructor( - @IConfigurationService private readonly configurationService: SimpleConfigurationService + @IConfigurationService private readonly configurationService: StandaloneConfigurationService ) { this.configurationService.onDidChangeConfiguration((e) => { this._onDidChangeConfiguration.fire({ affectedKeys: e.affectedKeys, affectsConfiguration: (resource: URI, configuration: string) => e.affectsConfiguration(configuration) }); @@ -612,7 +612,7 @@ class SimpleResourceConfigurationService implements ITextResourceConfigurationSe } } -class SimpleResourcePropertiesService implements ITextResourcePropertiesService { +class StandaloneResourcePropertiesService implements ITextResourcePropertiesService { declare readonly _serviceBrand: undefined; @@ -663,7 +663,7 @@ class StandaloneTelemetryService implements ITelemetryService { } } -class SimpleWorkspaceContextService implements IWorkspaceContextService { +class StandaloneWorkspaceContextService implements IWorkspaceContextService { public _serviceBrand: undefined; @@ -684,7 +684,7 @@ class SimpleWorkspaceContextService implements IWorkspaceContextService { private readonly workspace: IWorkspace; constructor() { - const resource = URI.from({ scheme: SimpleWorkspaceContextService.SCHEME, authority: 'model', path: '/' }); + const resource = URI.from({ scheme: StandaloneWorkspaceContextService.SCHEME, authority: 'model', path: '/' }); this.workspace = { id: '4064f6ec-cb38-4ad0-af64-ee6467e63c82', folders: [new WorkspaceFolder({ uri: resource, name: '', index: 0 })] }; } @@ -707,11 +707,11 @@ class SimpleWorkspaceContextService implements IWorkspaceContextService { } public getWorkspaceFolder(resource: URI): IWorkspaceFolder | null { - return resource && resource.scheme === SimpleWorkspaceContextService.SCHEME ? this.workspace.folders[0] : null; + return resource && resource.scheme === StandaloneWorkspaceContextService.SCHEME ? this.workspace.folders[0] : null; } public isInsideWorkspace(resource: URI): boolean { - return resource && resource.scheme === SimpleWorkspaceContextService.SCHEME; + return resource && resource.scheme === StandaloneWorkspaceContextService.SCHEME; } public isCurrentWorkspace(workspaceIdOrFolder: IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier | URI): boolean { @@ -723,7 +723,7 @@ export function updateConfigurationService(configurationService: IConfigurationS if (!source) { return; } - if (!(configurationService instanceof SimpleConfigurationService)) { + if (!(configurationService instanceof StandaloneConfigurationService)) { return; } let toUpdate: [string, any][] = []; @@ -740,7 +740,7 @@ export function updateConfigurationService(configurationService: IConfigurationS } } -class SimpleBulkEditService implements IBulkEditService { +class StandaloneBulkEditService implements IBulkEditService { declare readonly _serviceBrand: undefined; constructor( @@ -792,12 +792,12 @@ class SimpleBulkEditService implements IBulkEditService { } return { - ariaSummary: strings.format(SimpleServicesNLS.bulkEditServiceSummary, totalEdits, totalFiles) + ariaSummary: strings.format(StandaloneServicesNLS.bulkEditServiceSummary, totalEdits, totalFiles) }; } } -class SimpleUriLabelService implements ILabelService { +class StandaloneUriLabelService implements ILabelService { declare readonly _serviceBrand: undefined; @@ -856,7 +856,7 @@ class StandaloneContextViewService extends ContextViewService { } } -class SimpleWorkspaceTrustManagementService implements IWorkspaceTrustManagementService { +class StandaloneWorkspaceTrustManagementService implements IWorkspaceTrustManagementService { _serviceBrand: undefined; private _neverEmitter = new Emitter(); @@ -935,14 +935,14 @@ import 'vs/platform/undoRedo/common/undoRedoService'; import 'vs/editor/common/modes/languageConfigurationRegistry'; import 'vs/editor/standalone/browser/standaloneLayoutService'; -registerSingleton(IConfigurationService, SimpleConfigurationService); -registerSingleton(ITextResourceConfigurationService, SimpleResourceConfigurationService); -registerSingleton(ITextResourcePropertiesService, SimpleResourcePropertiesService); -registerSingleton(IWorkspaceContextService, SimpleWorkspaceContextService); -registerSingleton(ILabelService, SimpleUriLabelService); +registerSingleton(IConfigurationService, StandaloneConfigurationService); +registerSingleton(ITextResourceConfigurationService, StandaloneResourceConfigurationService); +registerSingleton(ITextResourcePropertiesService, StandaloneResourcePropertiesService); +registerSingleton(IWorkspaceContextService, StandaloneWorkspaceContextService); +registerSingleton(ILabelService, StandaloneUriLabelService); registerSingleton(ITelemetryService, StandaloneTelemetryService); -registerSingleton(IDialogService, SimpleDialogService); -registerSingleton(INotificationService, SimpleNotificationService); +registerSingleton(IDialogService, StandaloneDialogService); +registerSingleton(INotificationService, StandaloneNotificationService); registerSingleton(IMarkerService, MarkerService); registerSingleton(ILanguageService, StandaloneLanguageService); registerSingleton(IStandaloneThemeService, StandaloneThemeServiceImpl); @@ -951,12 +951,12 @@ registerSingleton(IModelService, ModelServiceImpl); registerSingleton(IMarkerDecorationsService, MarkerDecorationsService); registerSingleton(IContextKeyService, ContextKeyService); registerSingleton(ICodeEditorService, StandaloneCodeEditorServiceImpl); -registerSingleton(IEditorProgressService, SimpleEditorProgressService); +registerSingleton(IEditorProgressService, StandaloneEditorProgressService); registerSingleton(IStorageService, InMemoryStorageService); registerSingleton(IEditorWorkerService, EditorWorkerServiceImpl); -registerSingleton(IBulkEditService, SimpleBulkEditService); -registerSingleton(IWorkspaceTrustManagementService, SimpleWorkspaceTrustManagementService); -registerSingleton(ITextModelService, SimpleTextModelService); +registerSingleton(IBulkEditService, StandaloneBulkEditService); +registerSingleton(IWorkspaceTrustManagementService, StandaloneWorkspaceTrustManagementService); +registerSingleton(ITextModelService, StandaloneTextModelService); registerSingleton(IAccessibilityService, AccessibilityService); registerSingleton(IListService, ListService); registerSingleton(ICommandService, StandaloneCommandService); @@ -972,7 +972,7 @@ registerSingleton(IMenuService, MenuService); * We don't want to eagerly instantiate services because embedders get a one time chance * to override services when they create the first editor. */ -export module StaticServices { +export module StandaloneServices { const serviceCollection = new ServiceCollection(); for (const [id, descriptor] of getSingletonServiceDescriptors()) { diff --git a/src/vs/editor/standalone/test/browser/simpleServices.test.ts b/src/vs/editor/standalone/test/browser/standaloneServices.test.ts similarity index 88% rename from src/vs/editor/standalone/test/browser/simpleServices.test.ts rename to src/vs/editor/standalone/test/browser/standaloneServices.test.ts index ca45f7f5865..53f6305ab5d 100644 --- a/src/vs/editor/standalone/test/browser/simpleServices.test.ts +++ b/src/vs/editor/standalone/test/browser/standaloneServices.test.ts @@ -5,7 +5,7 @@ import * as assert from 'assert'; import { KeyCode } from 'vs/base/common/keyCodes'; -import { SimpleConfigurationService, SimpleNotificationService, StandaloneCommandService, StandaloneKeybindingService } from 'vs/editor/standalone/browser/simpleServices'; +import { StandaloneConfigurationService, StandaloneNotificationService, StandaloneCommandService, StandaloneKeybindingService } from 'vs/editor/standalone/browser/standaloneServices'; import { StandaloneCodeEditorServiceImpl } from 'vs/editor/standalone/browser/standaloneCodeServiceImpl'; import { StandaloneThemeServiceImpl } from 'vs/editor/standalone/browser/standaloneThemeServiceImpl'; import { ContextKeyService } from 'vs/platform/contextkey/browser/contextKeyService'; @@ -27,10 +27,10 @@ suite('StandaloneKeybindingService', () => { const serviceCollection = new ServiceCollection(); const instantiationService = new InstantiationService(serviceCollection, true); - const configurationService = new SimpleConfigurationService(); + const configurationService = new StandaloneConfigurationService(); const contextKeyService = new ContextKeyService(configurationService); const commandService = new StandaloneCommandService(instantiationService); - const notificationService = new SimpleNotificationService(); + const notificationService = new StandaloneNotificationService(); const standaloneThemeService = new StandaloneThemeServiceImpl(); const codeEditorService = new StandaloneCodeEditorServiceImpl(contextKeyService, standaloneThemeService); const keybindingService = new TestStandaloneKeybindingService(contextKeyService, commandService, NullTelemetryService, notificationService, new NullLogService(), codeEditorService);