Skip to content

Commit 9158d87

Browse files
committed
Fixes missing service dependency
1 parent 62c54d3 commit 9158d87

3 files changed

Lines changed: 16 additions & 14 deletions

File tree

src/vs/editor/standalone/browser/standaloneServices.ts

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ import { ResourceMap } from '../../../base/common/map.js';
100100
import { IWebWorkerDescriptor } from '../../../base/browser/webWorkerFactory.js';
101101
import { ITreeSitterLibraryService } from '../../common/services/treeSitter/treeSitterLibraryService.js';
102102
import { StandaloneTreeSitterLibraryService } from './standaloneTreeSitterLibraryService.js';
103-
import { CoreDataChannel, IDataChannelEvent, IDataChannelService } from '../../../platform/dataChannel/common/dataChannel.js';
103+
import { IDataChannelService, NullDataChannelService } from '../../../platform/dataChannel/common/dataChannel.js';
104104

105105
class SimpleModel implements IResolvedTextEditorModel {
106106

@@ -1127,18 +1127,6 @@ class StandaloneAccessbilitySignalService implements IAccessibilitySignalService
11271127
}
11281128
}
11291129

1130-
class StandaloneDataChannelService implements IDataChannelService {
1131-
_serviceBrand: undefined;
1132-
get onDidSendData(): Event<IDataChannelEvent<unknown>> {
1133-
return Event.None;
1134-
}
1135-
getDataChannel<T>(_channelId: string): CoreDataChannel<T> {
1136-
return {
1137-
sendData: () => { },
1138-
};
1139-
}
1140-
}
1141-
11421130
export interface IEditorOverrideServices {
11431131
[index: string]: any;
11441132
}
@@ -1180,7 +1168,7 @@ registerSingleton(IMenuService, MenuService, InstantiationType.Eager);
11801168
registerSingleton(IAccessibilitySignalService, StandaloneAccessbilitySignalService, InstantiationType.Eager);
11811169
registerSingleton(ITreeSitterLibraryService, StandaloneTreeSitterLibraryService, InstantiationType.Eager);
11821170
registerSingleton(ILoggerService, NullLoggerService, InstantiationType.Eager);
1183-
registerSingleton(IDataChannelService, StandaloneDataChannelService, InstantiationType.Eager);
1171+
registerSingleton(IDataChannelService, NullDataChannelService, InstantiationType.Eager);
11841172

11851173
/**
11861174
* We don't want to eagerly instantiate services because embedders get a one time chance

src/vs/editor/test/browser/testCodeEditor.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ import { ITreeSitterLibraryService } from '../../common/services/treeSitter/tree
6363
import { TestTreeSitterLibraryService } from '../common/services/testTreeSitterLibraryService.js';
6464
import { IInlineCompletionsService, InlineCompletionsService } from '../../browser/services/inlineCompletionsService.js';
6565
import { EditorCommand } from '../../browser/editorExtensions.js';
66+
import { IDataChannelService, NullDataChannelService } from '../../../platform/dataChannel/common/dataChannel.js';
6667

6768
export interface ITestCodeEditor extends IActiveCodeEditor {
6869
getViewModel(): ViewModel | undefined;
@@ -236,6 +237,7 @@ export function createCodeEditorServices(disposables: Pick<DisposableStore, 'add
236237
define(ICommandService, TestCommandService);
237238
define(ITelemetryService, NullTelemetryServiceShape);
238239
define(ILoggerService, NullLoggerService);
240+
define(IDataChannelService, NullDataChannelService);
239241
define(IEnvironmentService, class extends mock<IEnvironmentService>() {
240242
declare readonly _serviceBrand: undefined;
241243
override isBuilt: boolean = true;

src/vs/platform/dataChannel/common/dataChannel.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,15 @@ export interface IDataChannelEvent<T = unknown> {
2424
channelId: string;
2525
data: T;
2626
}
27+
28+
export class NullDataChannelService implements IDataChannelService {
29+
_serviceBrand: undefined;
30+
get onDidSendData(): Event<IDataChannelEvent<unknown>> {
31+
return Event.None;
32+
}
33+
getDataChannel<T>(_channelId: string): CoreDataChannel<T> {
34+
return {
35+
sendData: () => { },
36+
};
37+
}
38+
}

0 commit comments

Comments
 (0)