Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/core/src/api/createEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { IAppInstance, IConfig } from './types';

export { BoxPanel, SlotLocation, SlotRenderer, SplitPanel };

const getDefaultAppConfig = (): IAppOpts => ({
const getDefaultEditorAppConfig = (): IAppOpts => ({
modules: getModules(),
useCdnIcon: true,
noExtHost: true,
Expand Down Expand Up @@ -62,7 +62,7 @@ const getDefaultAppConfig = (): IAppOpts => ({
});

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

if (!opts.workspaceDir) {
throw new Error(
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/core/editor/modules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { WorkspaceModule } from '@opensumi/ide-workspace/lib/browser';
* alex
*/
import { PluginModule } from '@codeblitzjs/ide-plugin';
import { ClientModule, ServerModuleCollection } from '@codeblitzjs/ide-sumi-core';
import { ClientModule, EditorServerModuleCollection } from '@codeblitzjs/ide-sumi-core';

/**
* editor special
Expand Down Expand Up @@ -66,7 +66,7 @@ export const getModules: () => ModuleConstructor[] = () => [
// CodeBlitz
ClientModule,
PluginModule,
...ServerModuleCollection,
...EditorServerModuleCollection,

// Editor Special
EditorSpecialModule,
Expand Down
18 changes: 9 additions & 9 deletions packages/sumi-core/src/server/core/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export class ServerApp implements IServerApp {

public rootFS: RootFS;

private disposeCollection = new DisposableCollection();
private _disposables = new DisposableCollection();

constructor(
opts: IServerAppOpts & {
Expand Down Expand Up @@ -149,7 +149,7 @@ export class ServerApp implements IServerApp {
};
window.addEventListener('unload', handleUnload);

this.disposeCollection.push({
this._disposables.push({
dispose: () => {
window.removeEventListener('unload', handleUnload);
},
Expand Down Expand Up @@ -191,7 +191,7 @@ export class ServerApp implements IServerApp {
try {
const runtimeConfig: RuntimeConfig = this.injector.get(RuntimeConfig);
this.rootFS = await initializeRootFileSystem();
this.disposeCollection.push(
this._disposables.push(
await initializeHomeFileSystem(this.rootFS, runtimeConfig.scenario),
);

Expand Down Expand Up @@ -223,8 +223,8 @@ export class ServerApp implements IServerApp {
async start() {
await this.launch();
await this.initializeContribution();
const commonChannelPathHandler = this.injector.get(CommonChannelPathHandler);
const handler = new CodeblitzCommonChannelHandler('codeblitz-server', commonChannelPathHandler);
const pathHandler = this.injector.get(CommonChannelPathHandler);
const handler = new CodeblitzCommonChannelHandler('codeblitz-server', pathHandler);

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

commonChannelPathHandler.register(RPCServiceChannelPath, channelHandler);
pathHandler.register(RPCServiceChannelPath, channelHandler);

this.disposeCollection.push({
this._disposables.push({
dispose: () => {
commonChannelPathHandler.removeHandler(RPCServiceChannelPath, channelHandler);
pathHandler.removeHandler(RPCServiceChannelPath, channelHandler);
},
});

Expand All @@ -252,7 +252,7 @@ export class ServerApp implements IServerApp {
}

dispose() {
this.disposeCollection.dispose();
this._disposables.dispose();
}
}

Expand Down
9 changes: 8 additions & 1 deletion packages/sumi-core/src/server/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { ModuleConstructor } from '@opensumi/ide-core-browser';
import { ServerCommonModule } from './core/common.module';
import { ExtensionManagerModule } from './extension-manager';
import { FileSchemeNodeModule } from './file-scheme';
Expand Down Expand Up @@ -33,4 +34,10 @@ export const ServerModuleCollection = [
FileSearchModule,
SearchModule,
ExtensionManagerModule,
];
] as ModuleConstructor[];

const editorDisabledModules = new Set([SearchModule] as ModuleConstructor[]);

export const EditorServerModuleCollection = ServerModuleCollection.filter((m) => {
return !editorDisabledModules.has(m);
});
2 changes: 1 addition & 1 deletion packages/sumi-core/src/server/search/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export {
SendClientResult,
} from '@opensumi/ide-search/lib/common';

export const IContentSearchServer = Symbol('ContentSearchService');
export const IContentSearchServer = Symbol('IContentSearchServer');

export interface IContentSearchServer extends _IContentSearchServer {}

Expand Down