Skip to content

Commit 1d724fa

Browse files
authored
fix: editor renderer not work (#189)
1 parent 2f687f3 commit 1d724fa

5 files changed

Lines changed: 22 additions & 15 deletions

File tree

packages/core/src/api/createEditor.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import { IAppInstance, IConfig } from './types';
3030

3131
export { BoxPanel, SlotLocation, SlotRenderer, SplitPanel };
3232

33-
const getDefaultAppConfig = (): IAppOpts => ({
33+
const getDefaultEditorAppConfig = (): IAppOpts => ({
3434
modules: getModules(),
3535
useCdnIcon: true,
3636
noExtHost: true,
@@ -62,7 +62,7 @@ const getDefaultAppConfig = (): IAppOpts => ({
6262
});
6363

6464
export function createEditor({ appConfig, runtimeConfig }: IConfig): IAppInstance {
65-
const opts = interceptAppOpts(mergeConfig(getDefaultAppConfig(), appConfig), runtimeConfig);
65+
const opts = interceptAppOpts(mergeConfig(getDefaultEditorAppConfig(), appConfig), runtimeConfig);
6666

6767
if (!opts.workspaceDir) {
6868
throw new Error(

packages/core/src/core/editor/modules.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import { WorkspaceModule } from '@opensumi/ide-workspace/lib/browser';
2626
* alex
2727
*/
2828
import { PluginModule } from '@codeblitzjs/ide-plugin';
29-
import { ClientModule, ServerModuleCollection } from '@codeblitzjs/ide-sumi-core';
29+
import { ClientModule, EditorServerModuleCollection } from '@codeblitzjs/ide-sumi-core';
3030

3131
/**
3232
* editor special
@@ -66,7 +66,7 @@ export const getModules: () => ModuleConstructor[] = () => [
6666
// CodeBlitz
6767
ClientModule,
6868
PluginModule,
69-
...ServerModuleCollection,
69+
...EditorServerModuleCollection,
7070

7171
// Editor Special
7272
EditorSpecialModule,

packages/sumi-core/src/server/core/app.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export class ServerApp implements IServerApp {
111111

112112
public rootFS: RootFS;
113113

114-
private disposeCollection = new DisposableCollection();
114+
private _disposables = new DisposableCollection();
115115

116116
constructor(
117117
opts: IServerAppOpts & {
@@ -149,7 +149,7 @@ export class ServerApp implements IServerApp {
149149
};
150150
window.addEventListener('unload', handleUnload);
151151

152-
this.disposeCollection.push({
152+
this._disposables.push({
153153
dispose: () => {
154154
window.removeEventListener('unload', handleUnload);
155155
},
@@ -191,7 +191,7 @@ export class ServerApp implements IServerApp {
191191
try {
192192
const runtimeConfig: RuntimeConfig = this.injector.get(RuntimeConfig);
193193
this.rootFS = await initializeRootFileSystem();
194-
this.disposeCollection.push(
194+
this._disposables.push(
195195
await initializeHomeFileSystem(this.rootFS, runtimeConfig.scenario),
196196
);
197197

@@ -223,8 +223,8 @@ export class ServerApp implements IServerApp {
223223
async start() {
224224
await this.launch();
225225
await this.initializeContribution();
226-
const commonChannelPathHandler = this.injector.get(CommonChannelPathHandler);
227-
const handler = new CodeblitzCommonChannelHandler('codeblitz-server', commonChannelPathHandler);
226+
const pathHandler = this.injector.get(CommonChannelPathHandler);
227+
const handler = new CodeblitzCommonChannelHandler('codeblitz-server', pathHandler);
228228

229229
const channel = this.injector.get(InMemoryMessageChannel) as InMemoryMessageChannel;
230230
handler.receiveConnection(new CodeBlitzConnection(channel.port2));
@@ -236,11 +236,11 @@ export class ServerApp implements IServerApp {
236236
dispose: () => {},
237237
};
238238

239-
commonChannelPathHandler.register(RPCServiceChannelPath, channelHandler);
239+
pathHandler.register(RPCServiceChannelPath, channelHandler);
240240

241-
this.disposeCollection.push({
241+
this._disposables.push({
242242
dispose: () => {
243-
commonChannelPathHandler.removeHandler(RPCServiceChannelPath, channelHandler);
243+
pathHandler.removeHandler(RPCServiceChannelPath, channelHandler);
244244
},
245245
});
246246

@@ -252,7 +252,7 @@ export class ServerApp implements IServerApp {
252252
}
253253

254254
dispose() {
255-
this.disposeCollection.dispose();
255+
this._disposables.dispose();
256256
}
257257
}
258258

packages/sumi-core/src/server/index.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { ModuleConstructor } from '@opensumi/ide-core-browser';
12
import { ServerCommonModule } from './core/common.module';
23
import { ExtensionManagerModule } from './extension-manager';
34
import { FileSchemeNodeModule } from './file-scheme';
@@ -33,4 +34,10 @@ export const ServerModuleCollection = [
3334
FileSearchModule,
3435
SearchModule,
3536
ExtensionManagerModule,
36-
];
37+
] as ModuleConstructor[];
38+
39+
const editorDisabledModules = new Set([SearchModule] as ModuleConstructor[]);
40+
41+
export const EditorServerModuleCollection = ServerModuleCollection.filter((m) => {
42+
return !editorDisabledModules.has(m);
43+
});

packages/sumi-core/src/server/search/base.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export {
77
SendClientResult,
88
} from '@opensumi/ide-search/lib/common';
99

10-
export const IContentSearchServer = Symbol('ContentSearchService');
10+
export const IContentSearchServer = Symbol('IContentSearchServer');
1111

1212
export interface IContentSearchServer extends _IContentSearchServer {}
1313

0 commit comments

Comments
 (0)