未验证 提交 0aba6731 编写于 作者: A Alex Dima

Use `ConsoleLogService` as `ILogService` in standalone editor

上级 761b3455
......@@ -46,7 +46,7 @@ import { SimpleServicesNLS } 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';
import { NullLogService } from 'vs/platform/log/common/log';
import { ILogService } from 'vs/platform/log/common/log';
export class SimpleModel implements IResolvedTextEditorModel {
......@@ -298,9 +298,10 @@ export class StandaloneKeybindingService extends AbstractKeybindingService {
commandService: ICommandService,
telemetryService: ITelemetryService,
notificationService: INotificationService,
logService: ILogService,
domNode: HTMLElement
) {
super(contextKeyService, commandService, telemetryService, notificationService, new NullLogService());
super(contextKeyService, commandService, telemetryService, notificationService, logService);
this._cachedResolver = null;
this._dynamicKeybindings = [];
......
......@@ -32,7 +32,7 @@ import { ServiceCollection } from 'vs/platform/instantiation/common/serviceColle
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { ILabelService } from 'vs/platform/label/common/label';
import { IListService, ListService } from 'vs/platform/list/browser/listService';
import { ILogService, NullLogService } from 'vs/platform/log/common/log';
import { ConsoleLogService, ILogService } from 'vs/platform/log/common/log';
import { MarkerService } from 'vs/platform/markers/common/markerService';
import { IMarkerService } from 'vs/platform/markers/common/markers';
import { INotificationService } from 'vs/platform/notification/common/notification';
......@@ -153,7 +153,7 @@ export module StaticServices {
export const standaloneThemeService = define(IStandaloneThemeService, () => new StandaloneThemeServiceImpl());
export const logService = define(ILogService, () => new NullLogService());
export const logService = define(ILogService, () => new ConsoleLogService());
export const undoRedoService = define(IUndoRedoService, (o) => new UndoRedoService(dialogService.get(o), notificationService.get(o)));
......@@ -188,6 +188,7 @@ export class DynamicStandaloneServices extends Disposable {
const notificationService = this.get(INotificationService);
const telemetryService = this.get(ITelemetryService);
const themeService = this.get(IThemeService);
const logService = this.get(ILogService);
let ensure = <T>(serviceId: ServiceIdentifier<T>, factory: () => T): T => {
let value: T | null = null;
......@@ -209,7 +210,7 @@ export class DynamicStandaloneServices extends Disposable {
let commandService = ensure(ICommandService, () => new StandaloneCommandService(this._instantiationService));
let keybindingService = ensure(IKeybindingService, () => this._register(new StandaloneKeybindingService(contextKeyService, commandService, telemetryService, notificationService, domElement)));
let keybindingService = ensure(IKeybindingService, () => this._register(new StandaloneKeybindingService(contextKeyService, commandService, telemetryService, notificationService, logService, domElement)));
let layoutService = ensure(ILayoutService, () => new SimpleLayoutService(StaticServices.codeEditorService.get(ICodeEditorService), domElement));
......
......@@ -9,6 +9,7 @@ import { ContextKeyService } from 'vs/platform/contextkey/browser/contextKeyServ
import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService';
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
import { IKeyboardEvent } from 'vs/platform/keybinding/common/keybinding';
import { NullLogService } from 'vs/platform/log/common/log';
import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils';
suite('StandaloneKeybindingService', () => {
......@@ -34,7 +35,7 @@ suite('StandaloneKeybindingService', () => {
let domElement = document.createElement('div');
let keybindingService = new TestStandaloneKeybindingService(contextKeyService, commandService, NullTelemetryService, notificationService, domElement);
let keybindingService = new TestStandaloneKeybindingService(contextKeyService, commandService, NullTelemetryService, notificationService, new NullLogService(), domElement);
let commandInvoked = false;
keybindingService.addDynamicKeybinding('testCommand', KeyCode.F9, () => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册