From c7266b352dbd54fef111747a739e94379f06f101 Mon Sep 17 00:00:00 2001 From: erha19 Date: Fri, 10 May 2024 03:31:02 +0000 Subject: [PATCH] deploy: a4151cfdd8faa75cab04d199d62436301c70f5ea --- .../opensumi-devtools/index.html | 2 +- .../shortcuts-guard/index.html | 2 +- .../language-for-java/index.html | 2 +- .../3-way-merge-editor/index.html | 2 +- .../module-usage/ai-native-module/index.html | 675 ++++++++++++++++ .../module-usage/collaboration/index.html | 2 +- .../terminal-basic-usage/index.html | 2 +- en/docs/integrate/overview/index.html | 2 +- .../integrate/quick-start/electron/index.html | 2 +- en/docs/integrate/quick-start/lite/index.html | 2 +- en/docs/integrate/quick-start/web/index.html | 2 +- .../custom-command/index.html | 2 +- .../custom-config/index.html | 2 +- .../custom-keybinding/index.html | 2 +- .../custom-marketplace-entrypoint/index.html | 2 +- .../custom-menu/index.html | 2 +- .../custom-readonly-mode/index.html | 2 +- .../custom-reporter/index.html | 2 +- .../custom-view/index.html | 2 +- .../offline-deployment/index.html | 2 +- .../basic-design/connection/page-data.json | 2 +- .../contribution-point/page-data.json | 2 +- .../basic-design/core-idea/page-data.json | 2 +- .../basic-design/core-modules/page-data.json | 2 +- .../dependence-injector/page-data.json | 2 +- .../extension-mechanism/page-data.json | 2 +- .../basic-design/lifecycle/page-data.json | 2 +- .../develop/how-to-contribute/page-data.json | 2 +- .../how-to-design-module/page-data.json | 2 +- .../module-apis/decoration/page-data.json | 2 +- .../develop/module-apis/editor/page-data.json | 2 +- .../develop/module-apis/layout/page-data.json | 2 +- .../module-apis/overlay/page-data.json | 2 +- .../module-apis/preference/page-data.json | 2 +- .../develop/module-samples/page-data.json | 2 +- .../page-data.json | 2 +- .../sample/create-module/page-data.json | 2 +- .../sample/display-list/page-data.json | 2 +- .../develop/sample/overview/page-data.json | 2 +- .../use-contribution-point/page-data.json | 2 +- .../sample/use-service-by-di/page-data.json | 2 +- .../contributes/menubars/page-data.json | 2 +- .../contributes/submenus/page-data.json | 2 +- .../contributes/toolbar/page-data.json | 2 +- .../develop/built-in-command/page-data.json | 2 +- .../develop/built-in-component/page-data.json | 2 +- .../develop/built-in-icon/page-data.json | 2 +- .../develop/connection-mode/page-data.json | 2 +- .../develop/view-isolate/page-data.json | 2 +- .../custom-editor-component/page-data.json | 2 +- .../extension/interface/i18n/page-data.json | 2 +- .../extension/interface/layout/page-data.json | 2 +- .../interface/terminal/page-data.json | 2 +- .../interface/toolbar/page-data.json | 2 +- .../use-builtin-component/page-data.json | 2 +- .../interface/use-event/page-data.json | 2 +- .../en/docs/extension/overview/page-data.json | 2 +- .../docs/extension/quick-start/page-data.json | 2 +- .../extension/vscode/overview/page-data.json | 2 +- .../extension/web-extension/page-data.json | 2 +- .../opensumi-devtools/page-data.json | 2 +- .../shortcuts-guard/page-data.json | 2 +- .../language-for-java/page-data.json | 2 +- .../3-way-merge-editor/page-data.json | 2 +- .../ai-native-module/page-data.json | 1 + .../module-usage/collaboration/page-data.json | 2 +- .../terminal-basic-usage/page-data.json | 2 +- .../en/docs/integrate/overview/page-data.json | 2 +- .../quick-start/electron/page-data.json | 2 +- .../integrate/quick-start/lite/page-data.json | 2 +- .../integrate/quick-start/web/page-data.json | 2 +- .../custom-command/page-data.json | 2 +- .../custom-config/page-data.json | 2 +- .../custom-keybinding/page-data.json | 2 +- .../page-data.json | 2 +- .../custom-menu/page-data.json | 2 +- .../custom-readonly-mode/page-data.json | 2 +- .../custom-reporter/page-data.json | 2 +- .../custom-view/page-data.json | 2 +- .../offline-deployment/page-data.json | 2 +- .../basic-design/connection/page-data.json | 2 +- .../contribution-point/page-data.json | 2 +- .../basic-design/core-idea/page-data.json | 2 +- .../basic-design/core-modules/page-data.json | 2 +- .../dependence-injector/page-data.json | 2 +- .../extension-mechanism/page-data.json | 2 +- .../basic-design/lifecycle/page-data.json | 2 +- .../develop/how-to-contribute/page-data.json | 2 +- .../how-to-design-module/page-data.json | 2 +- .../module-apis/decoration/page-data.json | 2 +- .../develop/module-apis/editor/page-data.json | 2 +- .../develop/module-apis/layout/page-data.json | 2 +- .../module-apis/overlay/page-data.json | 2 +- .../module-apis/preference/page-data.json | 2 +- .../develop/module-samples/page-data.json | 2 +- .../page-data.json | 2 +- .../sample/create-module/page-data.json | 2 +- .../sample/display-list/page-data.json | 2 +- .../develop/sample/overview/page-data.json | 2 +- .../use-contribution-point/page-data.json | 2 +- .../sample/use-service-by-di/page-data.json | 2 +- .../contributes/menubars/page-data.json | 2 +- .../contributes/submenus/page-data.json | 2 +- .../contributes/toolbar/page-data.json | 2 +- .../develop/built-in-command/page-data.json | 2 +- .../develop/built-in-component/page-data.json | 2 +- .../develop/built-in-icon/page-data.json | 2 +- .../develop/connection-mode/page-data.json | 2 +- .../develop/view-isolate/page-data.json | 2 +- .../custom-editor-component/page-data.json | 2 +- .../extension/interface/i18n/page-data.json | 2 +- .../extension/interface/layout/page-data.json | 2 +- .../interface/terminal/page-data.json | 2 +- .../interface/toolbar/page-data.json | 2 +- .../use-builtin-component/page-data.json | 2 +- .../interface/use-event/page-data.json | 2 +- .../zh/docs/extension/overview/page-data.json | 2 +- .../docs/extension/quick-start/page-data.json | 2 +- .../extension/vscode/overview/page-data.json | 2 +- .../extension/web-extension/page-data.json | 2 +- .../opensumi-devtools/page-data.json | 2 +- .../shortcuts-guard/page-data.json | 2 +- .../language-for-java/page-data.json | 2 +- .../3-way-merge-editor/page-data.json | 2 +- .../ai-native-module/page-data.json | 1 + .../module-usage/collaboration/page-data.json | 2 +- .../terminal-basic-usage/page-data.json | 2 +- .../zh/docs/integrate/overview/page-data.json | 2 +- .../quick-start/electron/page-data.json | 2 +- .../integrate/quick-start/lite/page-data.json | 2 +- .../integrate/quick-start/web/page-data.json | 2 +- .../custom-command/page-data.json | 2 +- .../custom-config/page-data.json | 2 +- .../custom-keybinding/page-data.json | 2 +- .../page-data.json | 2 +- .../custom-menu/page-data.json | 2 +- .../custom-readonly-mode/page-data.json | 2 +- .../custom-reporter/page-data.json | 2 +- .../custom-view/page-data.json | 2 +- .../offline-deployment/page-data.json | 2 +- sitemap/sitemap-0.xml | 2 +- .../basic-design/connection/index.html | 2 +- .../contribution-point/index.html | 2 +- .../develop/basic-design/core-idea/index.html | 2 +- .../basic-design/core-modules/index.html | 2 +- .../dependence-injector/index.html | 2 +- .../extension-mechanism/index.html | 2 +- .../develop/basic-design/lifecycle/index.html | 2 +- zh/docs/develop/how-to-contribute/index.html | 2 +- .../develop/how-to-design-module/index.html | 2 +- .../develop/module-apis/decoration/index.html | 2 +- zh/docs/develop/module-apis/editor/index.html | 2 +- zh/docs/develop/module-apis/layout/index.html | 2 +- .../develop/module-apis/overlay/index.html | 2 +- .../develop/module-apis/preference/index.html | 2 +- zh/docs/develop/module-samples/index.html | 2 +- .../index.html | 2 +- .../develop/sample/create-module/index.html | 2 +- .../develop/sample/display-list/index.html | 2 +- zh/docs/develop/sample/overview/index.html | 2 +- .../sample/use-contribution-point/index.html | 2 +- .../sample/use-service-by-di/index.html | 2 +- .../opensumi-devtools/index.html | 4 +- .../shortcuts-guard/index.html | 2 +- .../language-for-java/index.html | 2 +- .../3-way-merge-editor/index.html | 4 +- .../module-usage/ai-native-module/index.html | 745 ++++++++++++++++++ .../module-usage/collaboration/index.html | 2 +- .../terminal-basic-usage/index.html | 2 +- zh/docs/integrate/overview/index.html | 4 +- .../integrate/quick-start/electron/index.html | 2 +- zh/docs/integrate/quick-start/lite/index.html | 14 +- zh/docs/integrate/quick-start/web/index.html | 6 +- .../custom-command/index.html | 6 +- .../custom-config/index.html | 12 +- .../custom-keybinding/index.html | 4 +- .../custom-marketplace-entrypoint/index.html | 4 +- .../custom-menu/index.html | 6 +- .../custom-readonly-mode/index.html | 4 +- .../custom-reporter/index.html | 2 +- .../custom-view/index.html | 4 +- .../offline-deployment/index.html | 2 +- 182 files changed, 1624 insertions(+), 202 deletions(-) create mode 100644 en/docs/integrate/module-usage/ai-native-module/index.html create mode 100644 page-data/en/docs/integrate/module-usage/ai-native-module/page-data.json create mode 100644 page-data/zh/docs/integrate/module-usage/ai-native-module/page-data.json create mode 100644 zh/docs/integrate/module-usage/ai-native-module/index.html diff --git a/en/docs/integrate/browser-extension/opensumi-devtools/index.html b/en/docs/integrate/browser-extension/opensumi-devtools/index.html index 55b94f6f..5f73c80c 100644 --- a/en/docs/integrate/browser-extension/opensumi-devtools/index.html +++ b/en/docs/integrate/browser-extension/opensumi-devtools/index.html @@ -52,7 +52,7 @@ } } }) -

OpenSumi DevTools

A Chrome DevTools Extension for any OpenSumi based IDE, with support for both Web clients and Electron clients.

+

OpenSumi DevTools

A Chrome DevTools Extension for any OpenSumi based IDE, with support for both Web clients and Electron clients.

OpenSumi DevTools Gif

GitHub:https://github.com/opensumi/devtools

Features

diff --git a/en/docs/integrate/browser-extension/shortcuts-guard/index.html b/en/docs/integrate/browser-extension/shortcuts-guard/index.html index c5a8060a..294a0f54 100644 --- a/en/docs/integrate/browser-extension/shortcuts-guard/index.html +++ b/en/docs/integrate/browser-extension/shortcuts-guard/index.html @@ -52,7 +52,7 @@ } } }) -

Shortcuts Guard

The shortcuts of IDEs developed based on OpenSumi conflict with those of Chrome, which makes the corresponding actions of IDEs unable to take effect. For example, the Ctrl/Cmd + W shortcut will close the current browser tab, making IDEs unable to handle this shortcut event. Shortcuts Guard solve the most common used shortcuts conflict.

+

Shortcuts Guard

The shortcuts of IDEs developed based on OpenSumi conflict with those of Chrome, which makes the corresponding actions of IDEs unable to take effect. For example, the Ctrl/Cmd + W shortcut will close the current browser tab, making IDEs unable to handle this shortcut event. Shortcuts Guard solve the most common used shortcuts conflict.

popup page

Usage

    diff --git a/en/docs/integrate/extensions-usage/language-for-java/index.html b/en/docs/integrate/extensions-usage/language-for-java/index.html index 0318a730..b69ad27c 100644 --- a/en/docs/integrate/extensions-usage/language-for-java/index.html +++ b/en/docs/integrate/extensions-usage/language-for-java/index.html @@ -52,7 +52,7 @@ } } }) -

    Java Project Supporting Extensions

    With the support of a powerful extension system and complete implementation of LSP, DAP, and Testing protocols, OpenSumi can also develop Java projects, such as Spring Boot or SOFA. It can use the Maven build tool to compile and run projects, and supports the full development, debugging, and testing of Java projects.

    +

    Java Project Supporting Extensions

    With the support of a powerful extension system and complete implementation of LSP, DAP, and Testing protocols, OpenSumi can also develop Java projects, such as Spring Boot or SOFA. It can use the Maven build tool to compile and run projects, and supports the full development, debugging, and testing of Java projects.

    To use Java projects, you need to install the following extensions, which can be searched, installed, and downloaded directly from the extension marketplace:

    Language Support for Java: 1.4.0 版本
     Debugger for Java: 0.38.0 版本
    diff --git a/en/docs/integrate/module-usage/3-way-merge-editor/index.html b/en/docs/integrate/module-usage/3-way-merge-editor/index.html
    index 21ca811c..8c0c4bba 100644
    --- a/en/docs/integrate/module-usage/3-way-merge-editor/index.html
    +++ b/en/docs/integrate/module-usage/3-way-merge-editor/index.html
    @@ -52,7 +52,7 @@
             }
           }
         })
    -  

    Using 3-way view new interaction

    Integration Method

    +

    Using 3-way view new interaction

    Integration Method

    Just install the Git plugin.

    If you are installing version 1.68.1, you need to configure the setting git.experimental.mergeEditor to true. If you are installing version 1.69.0 or later, you need to configure the setting git.mergeEditor to true.

    diff --git a/en/docs/integrate/module-usage/ai-native-module/index.html b/en/docs/integrate/module-usage/ai-native-module/index.html new file mode 100644 index 00000000..ee6b12ef --- /dev/null +++ b/en/docs/integrate/module-usage/ai-native-module/index.html @@ -0,0 +1,675 @@ +AI Native Module | OpenSumi

    AI Native Module

    Overview

    +

    Starting from OpenSumi 3.0, it supports customizing AI capabilities through the integration of AI Native Module, including but not limited to:

    +
      +
    • Built-in AI Chat assistant
    • +
    • Providing Agent open capabilities and quick command capabilities registration and expansion
    • +
    • Inline Chat capability is open, allowing for rich interaction and AI capabilities to generate or understand code within the editor
    • +
    • Code completion capability is open, including block completion, inline completion, and other basic capabilities
    • +
    • Problem diagnosis capability is open, providing detection capabilities for program runtime errors or static syntax issues
    • +
    • Intelligent terminal capability is open
    • +
    • Intelligent conflict resolution capability is open
    • +
    • Intelligent renaming capability is open
    • +
    • ...
    • +
    +

    More IDE functionalities' AI capabilities will continue to be opened up in the future.

    +

    How to Use

    +

    Step 1: Import the Module

    +

    Firstly, import the AI Native module in both the browser and server layers. It is recommended to use it together with the DesignModule!

    +
    // Browser layer
    +import { AINativeModule } from '@opensumi/ide-ai-native/lib/browser';
    +import { DesignModule } from '@opensumi/ide-design/lib/browser';
    +
    +renderApp({
    +  modules: [...CommonBrowserModules, DesignModule, AINativeModule]
    +});
    +
    +// Server layer
    +import { AINativeModule } from '@opensumi/ide-ai-native/lib/node';
    +
    +startServer({
    +  modules: [...CommonNodeModules, AINativeModule]
    +});
    +

    Step 2: Contribution

    +

    The purpose of this step is to register various AI capabilities.

    +
      +
    1. Create a new contribution file and implement the AiNativeCoreContribution interface.
    2. +
    +
    import { AiNativeCoreContribution } from '@opensumi/ide-ai-native/lib/browser/types';
    +
    +@Domain(AiNativeCoreContribution)
    +export class AiNativeContribution implements AiNativeCoreContribution {
    +  // Register various AI capabilities here
    +}
    +
      +
    1. Inject it into the DI's Providers list or the providers configuration of a custom module.
    2. +
    +
    const injector = new Injector();
    +injector.addProviders(AiNativeContribution);
    +
    +opts.injector = injector;
    +const app = new ClientApp(opts);
    +

    Step 3: Register Backend Service

    +

    The purpose of this step is to enable the front-end AI interactions to request services from the backend interface.

    +

    Complete example code can be found in ai.back.service.ts.

    +
      +
    1. Create a new backend service file and inherit from the BaseAIBackService service.
    2. +
    +
    @Injectable()
    +export class AiBackService extends BaseAIBackService implements IAIBackService {
    +  // Here you can interact with any large model API interface
    +}
    +
      +
    1. Dependency injection of AIBackSerivceToken.
    2. +
    +

    Provide the newly created AiBackService file to the Provider through dependency injection.

    +
    import { AIBackSerivceToken } from '@opensumi/ide-core-common';
    +
    +const injector = new Injector();
    +injector.addProviders({
    +  token: AIBackSerivceToken,
    +  useClass: AiBackService
    +});
    +
    +opts.injector = injector;
    +const serverApp = new ServerApp(opts);
    +

    Now that the module introduction phase is complete, the AI capabilities are missing (for example, inline chat is not triggered, etc.).

    +

    So, it is necessary to provide various provider capabilities in AiNativeContribution.

    +

    Contribution

    +

    Taking inline chat as an example, implement the registerInlineChatFeature method in AiNativeContribution.

    +
    @Domain(AiNativeCoreContribution)
    +export class AiNativeContribution implements AiNativeCoreContribution {
    +  // Obtain the registered backend service through AIBackSerivcePath
    +  // At this point, you can directly RPC call the functions provided by the backend service
    +  @Autowired(AIBackSerivcePath)
    +  private readonly aiBackService: IAIBackService;
    +
    +  registerInlineChatFeature(registry: IInlineChatFeatureRegistry) {
    +    registry.registerEditorInlineChat(
    +      {
    +        id: 'ai-comments',
    +        name: 'Comments',
    +        title: 'add comments',
    +        renderType: 'button',
    +        codeAction: {}
    +      },
    +      {
    +        execute: async (editor: IEditor) => {
    +          // Handle any interaction after the inline chat button is clicked here
    +        }
    +      }
    +    );
    +  }
    +}
    +

    At this point, selecting a piece of code in the editor will display the just registered inline chat button in the appropriate area.

    +

    Other capabilities' Provider API documentation is as follows:

    +
    +

    For more detailed and complete interface definitions, see: types.ts

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Method NameDescriptionParameter TypeReturn Type
    middlewareProvides middleware to extend some AI capabilitiesIAIMiddlewarevoid
    registerInlineChatFeatureRegisters inline chat related featuresIInlineChatFeatureRegistryvoid
    registerChatFeatureRegisters chat panel related featuresIChatFeatureRegistryvoid
    registerChatRenderRegisters chat panel related rendering layers, can customize renderIChatRenderRegistryvoid
    registerResolveConflictFeatureRegisters intelligent conflict resolution related featuresIResolveConflictRegistryvoid
    registerRenameProviderRegisters intelligent renaming related featuresIRenameCandidatesProviderRegistryvoid
    +

    IAIMiddleware

    + + + + + + + + + + + + + + + + + +
    Method NameDescriptionParameter TypeReturn Type
    language.provideInlineCompletionsExtends inline completion capabilities(model: ITextModel, position: Position, token: CancellationToken, next: (reqBean: CompletionRequestBean) => MaybePromise, completionRequestBean: CompletionRequestBean) => MaybePromisevoid
    +

    Example:

    +
    middleware: IAIMiddleware = {
    +  language: {
    +    provideInlineCompletions: async (
    +      model: ITextModel,
    +      position: Position,
    +      token: CancellationToken,
    +      next: (reqBean: CompletionRequestBean) => MaybePromise,
    +      completionRequestBean: CompletionRequestBean
    +    ) => {
    +      // Custom logic based on parameter information to alter the code completion results
    +      // For example
    +      return {
    +        sessionId: completionRequestBean.sessionId,
    +        codeModelList: [
    +          {
    +            content: 'Hello OpenSumi!'
    +          }
    +        ]
    +      };
    +    }
    +  }
    +};
    +

    IInlineChatFeatureRegistry

    + + + + + + + + + + + + + + + + + + + + + + + +
    Method NameDescriptionParameter TypeReturn Type
    registerEditorInlineChatRegisters inline chat functionality in the editorAIActionItem, IEditorInlineChatHandlerIDisposable
    registerTerminalInlineChatRegisters inline chat functionality in the terminalAIActionItem, ITerminalInlineChatHandlerIDisposable
    +

    IEditorInlineChatHandler

    + + + + + + + + + + + + + + + + + + + + + + + +
    Method NameDescriptionParameter TypeReturn Type
    executeDirectly executes the action's operation, and the inline chat disappears after clickingICodeEditor, ...any[]void
    providerDiffPreviewStrategyProvides a preview strategy for the diff editorICodeEditor, CancellationTokenMaybePromise
    +

    ITerminalInlineChatHandler

    + + + + + + + + + + + + + + + + + + + + + + + +
    Method NameDescriptionParameter TypeReturn Type
    triggerRulesDefines trigger rules'selection' or BaseTerminalDetectionLineMatcher[]void
    executeExecutes the action's operationstring (stdout), string (stdin), BaseTerminalDetectionLineMatcher? (rule)void
    +
    +

    MaybePromise is a type alias indicating that the method may return a Promise or directly return a value of the corresponding type.

    +
    +
    +

    ChatResponse is a union type, indicating that the response can be any of ReplyResponse, ErrorResponse, or CancelResponse.

    +
    +
    export class ReplyResponse {
    +  constructor(readonly message: string) {}
    +
    +  static is(response: any): boolean {
    +    return (
    +      response instanceof ReplyResponse ||
    +      (typeof response === 'object' && response.message !== undefined)
    +    );
    +  }
    +}
    +
    +export class ErrorResponse {
    +  constructor(readonly error: any, readonly message?: string) {}
    +
    +  static is(response: any): boolean {
    +    return (
    +      response instanceof ErrorResponse ||
    +      (typeof response === 'object' && response.error !== undefined)
    +    );
    +  }
    +}
    +
    +export class CancelResponse {
    +  readonly cancellation: boolean = true;
    +
    +  constructor(readonly message?: string) {}
    +
    +  static is(response: any): boolean {
    +    return (
    +      response instanceof CancelResponse ||
    +      (typeof response === 'object' && response.cancellation !== undefined)
    +    );
    +  }
    +}
    +
    +export type ChatResponse = ReplyResponse | ErrorResponse | CancelResponse;
    +

    Example:

    +
    // Register inline chat in the editor
    +registerInlineChatFeature(registry: IInlineChatFeatureRegistry) {
    +  registry.registerEditorInlineChat(
    +    {
    +      id: 'comments',
    +      name: 'Comments',
    +    },
    +    {
    +      providerDiffPreviewStrategy: async (editor: ICodeEditor, token) => {
    +        const crossCode = this.getCrossCode(editor);
    +        const prompt = `Comment the code: \`\`\`${crossCode}\`\`\`. It is required to return only the code results without explanation.`;
    +      },
    +    },
    +  );
    +}
    +
    +// Register inline chat in the terminal area
    +registry.registerTerminalInlineChat(
    +  {
    +    id: 'terminal',
    +    name: 'terminal',
    +  },
    +  {
    +    triggerRules: 'selection',
    +    execute: async (stdout: string) => {},
    +  },
    +);
    +

    IChatFeatureRegistry

    + + + + + + + + + + + + + + + + + + + + + + + +
    Method NameDescriptionParameter TypeReturn Type
    registerWelcomeRegisters the welcome message for the Chat panelIChatWelcomeMessageContent or React.ReactNode, ISampleQuestionsvoid
    registerSlashCommandRegisters the quick command for the Chat panelIChatSlashCommandItem, IChatSlashCommandHandlervoid
    +

    Example:

    +
    registerChatFeature(registry: IChatFeatureRegistry): void {
    +  registry.registerWelcome(
    +    new MarkdownString(`Hello, I am your dedicated AI assistant, here to answer questions about code and help you think. You can ask me some questions about code.`),
    +    [
    +      {
    +        icon: getIcon('send-hollow'),
    +        title: 'Generate a Java Quicksort Algorithm',
    +        message: 'Generate a Java Quicksort Algorithm',
    +      },
    +    ],
    +  );
    +
    +  registry.registerSlashCommand(
    +    {
    +      name: 'Explain',
    +      description: 'Explain',
    +      isShortcut: true,
    +      tooltip: 'Explain',
    +    },
    +    {
    +      providerRender: CustomSlashCommand,
    +      providerInputPlaceholder(value, editor) {
    +        return 'Please enter or paste the code.';
    +      },
    +      providerPrompt(value, editor) {
    +        return `Explain code: \`\`\`\n ${value}\`\`\``;
    +      },
    +      execute: (value: string, send: TChatSlashCommandSend, editor: ICodeEditor) => {
    +        send(value);
    +      },
    +    },
    +  );
    +}
    +

    IChatRenderRegistry

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Method NameDescriptionParameter TypeReturn Type
    registerWelcomeRenderCustomizes the rendering of the welcome message viewChatWelcomeRendervoid
    registerAIRoleRenderCustomizes the rendering of the AI session viewChatAIRoleRendervoid
    registerUserRoleRenderCustomizes the rendering of the user session viewChatUserRoleRendervoid
    registerThinkingRenderCustomizes the rendering of the loading viewChatThinkingRendervoid
    registerInputRenderCustomizes the rendering of the input box viewChatInputRendervoid
    +

    Example:

    +
    registerChatRender(registry: IChatRenderRegistry): void {
    +  // Directly inject React components
    +  registry.registerWelcomeRender(CustomWelcomeComponents);
    +}
    +

    IResolveConflictRegistry

    + + + + + + + + + + + + + + + + + +
    Method NameDescriptionParameter TypeReturn Type
    registerResolveConflictProviderRegisters the model-问答 service for resolving conflictskeyof typeof MergeConflictEditorMode, IResolveConflictHandlervoid
    +

    Example:

    +
    registerResolveConflictFeature(registry: IResolveConflictRegistry): void {
    +  registry.registerResolveConflictProvider('traditional', {
    +    providerRequest: async (contentMetadata, options, token) => {
    +      return new ReplyResponse('Resolved successfully!');
    +    },
    +  });
    +}
    +

    IRenameCandidatesProviderRegistry

    + + + + + + + + + + + + + + + + + +
    Method NameDescriptionParameter TypeReturn Type
    registerRenameSuggestionsProviderRegisters the provider for renaming suggestionsNewSymbolNamesProviderFnvoid
    +

    Example:

    +
    registerRenameProvider(registry: IRenameCandidatesProviderRegistry): void {
    +  registry.registerRenameSuggestionsProvider(async (model, range, token): Promise<NewSymbolName[] | undefined> => {
    +    return {
    +      newSymbolName: 'ai rename',
    +      tags: [NewSymbolNameTag.AIGenerated],
    +    };
    +  });
    +}
    +

    Complete example code can be found in ai-native.contribution.ts.

    + +

    The AI Native Config-related configuration parameters can control the on/off state of all AI capabilities.

    +

    IAINativeConfig

    + + + + + + + + + + + + + + + + + + + + +
    Property NameTypeDescription
    capabilitiesIAINativeCapabilitiesConfiguration items for AI functionalities
    layoutIDesignLayoutConfigConfiguration items for layout design
    +

    IAINativeCapabilities

    +
    +

    All the following capabilities are enabled by default.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Property NameTypeDescription
    supportsMarkersbooleanWhether to enable AI capabilities to handle the problem panel
    supportsChatAssistantbooleanWhether to enable the AI chat assistant feature
    supportsInlineChatbooleanWhether to enable the Inline Chat feature
    supportsInlineCompletionbooleanWhether to enable the code intelligent completion feature
    supportsConflictResolvebooleanWhether to enable the AI intelligent conflict resolution feature
    supportsRenameSuggestionsbooleanWhether to enable the AI to provide renaming suggestions feature
    supportsTerminalDetectionbooleanWhether to enable the AI terminal detection feature
    supportsTerminalCommandSuggestbooleanWhether to enable the AI terminal command suggestion feature
    +

    IDesignLayoutConfig

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    Property NameTypeDescription
    useMergeRightWithLeftPanelbooleanWhether to merge the right panel with the left panel
    useMenubarViewbooleanWhether to use the new menu bar view
    menubarLogostringSets the icon for the menu bar, which can be a path to an image
    \ No newline at end of file diff --git a/en/docs/integrate/module-usage/collaboration/index.html b/en/docs/integrate/module-usage/collaboration/index.html index d65c43e4..57006aff 100644 --- a/en/docs/integrate/module-usage/collaboration/index.html +++ b/en/docs/integrate/module-usage/collaboration/index.html @@ -52,7 +52,7 @@ } } }) -

    Collaboration Module

    Overview

    +

    Collaboration Module

    Overview

    You can use the hot-pluggable module @opensumi/ide-collaboration to implement real-time multi-person collaborative editing for the editor part of your IDE.

    -

    注:我们提供了直接 Require 和动态 import 两种方式来引入语法声明文件,前者会使得 bundleSize 变大,后者部署成本会更高,集成时可自行选择

    +

    注:我们提供了直接 Require 和动态 import 两种方式来引入语法声明文件,前者会使得 bundleSize 变大,后者部署成本会更高,集成时可自行选择

    单文件语法服务

    OpenSumi 基于纯前端插件(worker 版)能力,提供了常见语法的基础提示。由于没有文件服务,worker 版本语法提示插件只支持单文件的代码提示,不支持跨文件分析,对于纯前端的轻量编辑场景而言,基本上是够用的。目前可选的语法提示插件有:

    @@ -139,7 +139,7 @@

    definition(params: ILsifPayload): Promise<vscode.Location[]>; reference(params: ILsifPayload): Promise<vscode.Location[]>; }

    -

    搜索能力

    +

    搜索能力

    搜索功能属于可选实现,默认不开启搜索功能。实现搜索能力的核心在于实现 file-search 和 search 模块的后端部分。

    文件搜索

    要实现文件搜索功能(通过 cmd+p 触发),需要实现以下方法:

    diff --git a/zh/docs/integrate/quick-start/web/index.html b/zh/docs/integrate/quick-start/web/index.html index 141efa45..5893f660 100644 --- a/zh/docs/integrate/quick-start/web/index.html +++ b/zh/docs/integrate/quick-start/web/index.html @@ -52,11 +52,11 @@ } } }) -

    快速开始(Web)

    OpenSumi 基于 Node.js 12.x + 版本开发,需要确保你本地已经安装上正确的 Node.js 版本。同时 OpenSumi 依赖一些 Node.js Addon,为了确保这些 Addon 能够被正常编译运行,建议参考 node-gyp 中的安装指南来搭建本地环境。

    +

    快速开始(Web)

    OpenSumi 基于 Node.js 12.x + 版本开发,需要确保你本地已经安装上正确的 Node.js 版本。同时 OpenSumi 依赖一些 Node.js Addon,为了确保这些 Addon 能够被正常编译运行,建议参考 node-gyp 中的安装指南来搭建本地环境。

    preview

    本地启动

    -

    注意:由于编译过程中需要下载大量的包,并且部分包需要访问 GitHub 下载源码,请保持 GitHub 的访问畅通。很多 404 Not Found 的问题都是网络访问失败引起的。

    +

    注意:由于编译过程中需要下载大量的包,并且部分包需要访问 GitHub 下载源码,请保持 GitHub 的访问畅通。很多 404 Not Found 的问题都是网络访问失败引起的。

    依次运行下面的命令:

    $ git clone git@github.com:opensumi/ide-startup.git
    @@ -75,7 +75,7 @@ 

    ClientApp  和 ServerApp ,传入相应的参数并启动。

    详细启动参数可查看 自定义配置 文档。

    定制 IDE

    -

    OpenSumi 支持通过模块的方式对界面主题、内置命令、菜单等基础能力进行定制,更多详细的定制内容可以查看:

    +

    OpenSumi 支持通过模块的方式对界面主题、内置命令、菜单等基础能力进行定制,更多详细的定制内容可以查看:

    通过模块注册

    -

    在模块中,我们通常采用 CommandContribution 进行注册,详细可见文档:命令注册

    自定义配置

    使用自定义配置

    +

    自定义配置

    使用自定义配置

    在 OpenSumi 中,常见的配置项一般分为如下两种:

    1. 集成配置
    2. 运行时配置
    -

    集成配置 一般为静态配置,随用户 IDE 服务的启动生效,即便修改后也需要 “刷新/重启服务” 后才能生效,常用的配置可以查看下面的 集成配置 查看。

    +

    集成配置 一般为静态配置,随用户 IDE 服务的启动生效,即便修改后也需要 “刷新/重启服务” 后才能生效,常用的配置可以查看下面的 集成配置 查看。

    运行时配置 一般为动态配置,支持在用户使用过程中通过一些界面操作,或用户自定义的方式去动态改变,常用于一些具有 “开关属性” 或 “多场景配置” 的场景,用户可以通过框架中的配置界面进行动态修改。 settings

    集成配置 不同的是,运行时配置 在框架内可以通过具体的配置文件去进行自定义,如 launch.jsontask.jsonsettings.json 等文件。

    运行时配置

    如何使用

    -

    在模块内,我们可以通过 PreferenceService 服务直接获取相关配置的值,如下面我们可以通过该服务去获取我们注册的 debugModel.enable 配置项:

    +

    在模块内,我们可以通过 PreferenceService 服务直接获取相关配置的值,如下面我们可以通过该服务去获取我们注册的 debugModel.enable 配置项:

    @Autowired(PreferenceService)
     protected readonly preferenceService: PreferenceService;
     
    @@ -135,7 +135,7 @@ 

    renderApp({
       // 追加配置
       appName: 'OpenSumi',
    -  // 原有内容
    +  // 原有内容
       ...
     })

    而在 WebIDE 示例 项目中, 你也可以找到类似配置,见 src/browser/index.ts#L12

    @@ -330,7 +330,7 @@

    *.sumi-workspace 的工作区文件,当传入值为空时,编辑器左侧文件树将会展示打开文件夹的按钮。无didRendered当 DOM 首次渲染完成后调用,此时表示 IDE 界面已经完成渲染并可以操作,可以在此处传入函数处理界面 Loading,参考:DidRendered无extensionDir插件目录路径无extensionCandidate额外指定的插件路径,一般用于内置插件无storageDirName设置全局存储的文件夹名称,主要针对使用了 Storage 模块相关存储服务时进行文件夹名称配置.sumipreferenceDirName设置工作区配置文件的文件夹名称,对于集成环境,我们更推荐使用 workspacePreferenceDirNameuserPreferenceDirName 进行更加精细的配置存储文件夹名称配置.sumiworkspacePreferenceDirName更精细的项目工作区配置存储位置,即当 preferenceDirName = '.sumi' , workspacePreferenceDirName = '.kt'时,对应全局配置为 ~/.sumi/settings.json , 工作区配置为 {workspaceDir}/.kt/settings.json.sumiuserPreferenceDirName更精细的项目用户配置存储位置,即当 preferenceDirName = '.sumi' , userPreferenceDirName = '.kt'时,对应全局配置为 ~/.sumi/settings.json , 工作区配置为 {userDir}/.kt/settings.json.sumiextensionStorageDirName全局插件数据存储目录名称,默认 .sumi,存储数据位置在 {userDir}/.sumi.sumidefaultPreferences对客户端的整体配置进行初始化定义,常见的自定义参数如:颜色主题:general.theme、图标主题:general.icon、语言:general.language、排除文件选项:filesExclude、排除文件监听选项:watchExclude 等等,理论上可针对所有 IDE 中定义的配置进行默认值设置无injector初始化的 DI 实例,一般可在外部进行 DI 初始化之后传入,便于提前进行一些依赖的初始化无wsPath默认 WebScoket 通信路径无layoutConfig定义 IDE 各个布局区块默认加载的模块,可针对性对模块进行增删改。见:default-config.tsxlayoutConponent定义 IDE 的整体布局,可以通过传入自定义布局的方式定义各个区块的默认大小及缩放选项等见:default-layout.tsxpanelSizes可基于 layoutComponent 配置的基础上,定义面板大小,宽度/高度无defaultPanels定义各个区块的默认面板如 defaultPanels: { [SlotLocation.bottom]: '@opensumi/ide-terminal-next' }无webviewEndpoint用于挂载 webview 的 iframe 地址http://${deviceIp}:${port}/webviewextWorkerHostWorker 插件的默认启动路径https://dev.g.alicdn.com/tao-ide/ide-lite/${version}/worker-host.jsstaticServicePath定义静态资源路径,框架内默认加载路径为 http://127.0.0.1:8000/assets/${path}http://127.0.0.1:8000/assets/${path}extensionDevelopmentHost定义是否以插件开发模式启动falseeditorBackgroundImage定义编辑器界面的背景图片useExperimentalShadowDom定义是否在插件环境中启用 ShadowDom 模式,建议打开,打开后,视图插件的样式将会与全局环境隔离falseuseIframeWrapWorkerHost加载 workerHost 时使用 iframe 包装,对于跨域的场景,加载 workerHost 时会使用 base64 编码后通过 importScripts 引入(importScripts 不受跨域限制),但这会导致 workerHost 的 origin 为 null,使某些请求失败falseclientId自定义客户端 id,是 websocket 服务的唯一标识,也是传给声明了 backServices 的后端 Service 的唯一标识,注意保持这个 id 的唯一性无noExtHost是否禁用插件进程falseextraContextProvider额外的 ConfigProvider,可以让 OpenSumi 内部的 ReactDOM.render 调用时,都被其包裹一层,以达到额外的 Context 传递效果无allowSetDocumentTitleFollowWorkspaceDir允许按照工作区路径去动态设置 document#title,trueremoteHostname远程访问地址,可以通过该地址访问当容器服务window.location.hostnameenableDebugExtensionHost开启插件进程的调试能力falseinspectExtensionHost调试插件进程时的 ip 地址无extensionFetchCredentials加载插件前端资源时的 fetch credentials 选项,可选项为 "include""omit"extensionConnectOption参考:ExtensionConnectOption无 +
    参数参数说明默认值
    appName客户端的唯一名称,一般在客户端启动时的标题展示使用,同时也作为插件进程输出的客户端名称OpenSumi
    uriScheme主要用于注册 Electron 版本中的客户端协议,便于实现协议唤起sumi
    workspaceDir工作区路径,一般为一个文件夹或是 *.sumi-workspace 的工作区文件,当传入值为空时,编辑器左侧文件树将会展示打开文件夹的按钮。
    didRendered当 DOM 首次渲染完成后调用,此时表示 IDE 界面已经完成渲染并可以操作,可以在此处传入函数处理界面 Loading,参考:DidRendered
    extensionDir插件目录路径
    extensionCandidate额外指定的插件路径,一般用于内置插件
    storageDirName设置全局存储的文件夹名称,主要针对使用了 Storage 模块相关存储服务时进行文件夹名称配置.sumi
    preferenceDirName设置工作区配置文件的文件夹名称,对于集成环境,我们更推荐使用 workspacePreferenceDirNameuserPreferenceDirName 进行更加精细的配置存储文件夹名称配置.sumi
    workspacePreferenceDirName更精细的项目工作区配置存储位置,即当 preferenceDirName = '.sumi' , workspacePreferenceDirName = '.kt'时,对应全局配置为 ~/.sumi/settings.json , 工作区配置为 {workspaceDir}/.kt/settings.json.sumi
    userPreferenceDirName更精细的项目用户配置存储位置,即当 preferenceDirName = '.sumi' , userPreferenceDirName = '.kt'时,对应全局配置为 ~/.sumi/settings.json , 工作区配置为 {userDir}/.kt/settings.json.sumi
    extensionStorageDirName全局插件数据存储目录名称,默认 .sumi,存储数据位置在 {userDir}/.sumi.sumi
    defaultPreferences对客户端的整体配置进行初始化定义,常见的自定义参数如:颜色主题:general.theme、图标主题:general.icon、语言:general.language、排除文件选项:filesExclude、排除文件监听选项:watchExclude 等等,理论上可针对所有 IDE 中定义的配置进行默认值设置
    injector初始化的 DI 实例,一般可在外部进行 DI 初始化之后传入,便于提前进行一些依赖的初始化
    wsPath默认 WebScoket 通信路径
    layoutConfig定义 IDE 各个布局区块默认加载的模块,可针对性对模块进行增删改。见:default-config.tsx
    layoutConponent定义 IDE 的整体布局,可以通过传入自定义布局的方式定义各个区块的默认大小及缩放选项等见:default-layout.tsx
    panelSizes可基于 layoutComponent 配置的基础上,定义面板大小,宽度/高度
    defaultPanels定义各个区块的默认面板如 defaultPanels: { [SlotLocation.bottom]: '@opensumi/ide-terminal-next' }
    webviewEndpoint用于挂载 webview 的 iframe 地址http://${deviceIp}:${port}/webview
    extWorkerHostWorker 插件的默认启动路径https://dev.g.alicdn.com/tao-ide/ide-lite/${version}/worker-host.js
    staticServicePath定义静态资源路径,框架内默认加载路径为 http://127.0.0.1:8000/assets/${path}http://127.0.0.1:8000/assets/${path}
    extensionDevelopmentHost定义是否以插件开发模式启动false
    editorBackgroundImage定义编辑器界面的背景图片
    useExperimentalShadowDom定义是否在插件环境中启用 ShadowDom 模式,建议打开,打开后,视图插件的样式将会与全局环境隔离false
    useIframeWrapWorkerHost加载 workerHost 时使用 iframe 包装,对于跨域的场景,加载 workerHost 时会使用 base64 编码后通过 importScripts 引入(importScripts 不受跨域限制),但这会导致 workerHost 的 origin 为 null,使某些请求失败false
    clientId自定义客户端 id,是 websocket 服务的唯一标识,也是传给声明了 backServices 的后端 Service 的唯一标识,注意保持这个 id 的唯一性
    noExtHost是否禁用插件进程false
    extraContextProvider额外的 ConfigProvider,可以让 OpenSumi 内部的 ReactDOM.render 调用时,都被其包裹一层,以达到额外的 Context 传递效果
    allowSetDocumentTitleFollowWorkspaceDir允许按照工作区路径去动态设置 document#title,true
    remoteHostname远程访问地址,可以通过该地址访问当容器服务window.location.hostname
    enableDebugExtensionHost开启插件进程的调试能力false
    inspectExtensionHost调试插件进程时的 ip 地址
    extensionFetchCredentials加载插件前端资源时的 fetch credentials 选项,可选项为 "include""omit"
    extensionConnectOption参考:ExtensionConnectOption

    服务端配置

    定义可见 @opensumi/ide-core-node 中的 AppConfig 定义。

    示例项目中修改配置的参考位置如下:

    @@ -424,7 +424,7 @@

    MarketplaceConfiglogLevel设置落盘日志级别,默认为 Info 级别的 log 落盘LogLevel.InfologDir定义日志落盘路径~/.sumi/logsLogServiceClass待废弃,外部设置的 ILogService,替换默认的 logService,可通过在传入的 injector 初始化 ILogService 进行实现替换无maxExtProcessCount定义启用插件进程的最大个数无extLogServiceClassPath定义插件日志自定义实现路径无processCloseExitThreshold定义插件进程关闭时间无terminalPtyCloseThreshold定义终端 pty 进程退出时间无staticAllowOrigin访问静态资源允许的 origin无staticAllowPath访问静态资源允许的路径,用于配置静态资源的白名单规则无blockPatterns文件服务禁止访问的路径,使用 glob 匹配无extHost插件 Node 进程入口文件无extHostIPCSockPath插件进程存放用于通信的 sock 地址/tmpextHostForkOptions插件进程 fork 配置无 +
    参数参数说明默认值
    injector初始化的 DI 实例,一般可在外部进行 DI 初始化之后传入,便于提前进行一些依赖的初始化
    marketplace参考:MarketplaceConfig
    logLevel设置落盘日志级别,默认为 Info 级别的 log 落盘LogLevel.Info
    logDir定义日志落盘路径~/.sumi/logs
    LogServiceClass待废弃,外部设置的 ILogService,替换默认的 logService,可通过在传入的 injector 初始化 ILogService 进行实现替换
    maxExtProcessCount定义启用插件进程的最大个数
    extLogServiceClassPath定义插件日志自定义实现路径
    processCloseExitThreshold定义插件进程关闭时间
    terminalPtyCloseThreshold定义终端 pty 进程退出时间
    staticAllowOrigin访问静态资源允许的 origin
    staticAllowPath访问静态资源允许的路径,用于配置静态资源的白名单规则
    blockPatterns文件服务禁止访问的路径,使用 glob 匹配
    extHost插件 Node 进程入口文件
    extHostIPCSockPath插件进程存放用于通信的 sock 地址/tmp
    extHostForkOptions插件进程 fork 配置

    更多配置,可查看 OpenSumi 源码 opensumi/core

    自定义快捷键

    概览

    +

    自定义快捷键

    概览

    作为一款富交互的 IDE,良好的快捷键设计能很大程度上解放使用者对于界面操作的依赖,提高工作/操作效率,而在 OpenSumi 框架中,除了支持通过插件的形式注册插件外,也支持通过模块的方式进行拓展,本文重点讲解如何在集成阶段为你的应用预设更多的快捷键。

    -

    注册快捷键

    +

    注册快捷键

    在模块中,我们通常采用 KeybindingContribution 的方式进行注册,详细可参见:快捷键注册

    支持的快捷键字符

    特定平台下支持的修饰符如下:

    diff --git a/zh/docs/integrate/universal-integrate-case/custom-marketplace-entrypoint/index.html b/zh/docs/integrate/universal-integrate-case/custom-marketplace-entrypoint/index.html index 7141c2c8..b770ef4b 100644 --- a/zh/docs/integrate/universal-integrate-case/custom-marketplace-entrypoint/index.html +++ b/zh/docs/integrate/universal-integrate-case/custom-marketplace-entrypoint/index.html @@ -52,8 +52,8 @@ } } }) -

    自定义插件市场镜像源

    概览

    -

    OpenSumi 同时支持 支付宝小程序云 CloudIDE 插件市场Eclipse Open VSX ,两个插件市场可以通过配置相互切换,目前默认使用的是支付宝小程序云 CloudIDE 插件市场

    +

    自定义插件市场镜像源

    概览

    +

    OpenSumi 同时支持 支付宝小程序云 CloudIDE 插件市场Eclipse Open VSX ,两个插件市场可以通过配置相互切换,目前默认使用的是支付宝小程序云 CloudIDE 插件市场

    配置方式

    一般框架的初始项目会在两个地方使用插件市场相关的配置,一个为安装默认插件的下载脚本,另一个则是框架启动时的插件市场配置。

    如何修改下载脚本

    diff --git a/zh/docs/integrate/universal-integrate-case/custom-menu/index.html b/zh/docs/integrate/universal-integrate-case/custom-menu/index.html index 5f52f5b0..a2bfe7da 100644 --- a/zh/docs/integrate/universal-integrate-case/custom-menu/index.html +++ b/zh/docs/integrate/universal-integrate-case/custom-menu/index.html @@ -52,7 +52,7 @@ } } }) -

    自定义菜单

    注册自定义菜单

    +

    自定义菜单

    注册自定义菜单

    注册自定义菜单,常见的有两种模式:

    • 注册新的菜单项
    • @@ -75,7 +75,7 @@ item: IMenuItem | ISubmenuItem | IInternalComponentMenuItem ): IDisposable; }
    -

    注册新的菜单项

    +

    注册新的菜单项

    例如我们希望注册一个新的 终端 菜单项,并希望它展示在第一项,调用 registry.registerMenuBarItem, 同时传入 order: 0 表示其定位在第一项。

    import {
       MenuContribution,
    @@ -179,7 +179,7 @@ 

    反注册菜单或者菜单项

    OpenSumi 也提供了反注册菜单或者菜单项的功能,如果你不需要界面上的某些按钮,可以反注册掉它们。

    -

    core 内部会预先注册了一些菜单,如:帮助;也为这些菜单预先配置了菜单项,如: 帮助 > 切换开发人员工具。

    +

    core 内部会预先注册了一些菜单,如:帮助;也为这些菜单预先配置了菜单项,如: 帮助 > 切换开发人员工具。

    我们在 IMenuRegistry 中提供了两个方法: unregisterMenuIdunregisterMenuItem; 前者用来删除某个菜单,后者用来删除某个菜单的菜单项:

    export abstract class IMenuRegistry {
       ...
    diff --git a/zh/docs/integrate/universal-integrate-case/custom-readonly-mode/index.html b/zh/docs/integrate/universal-integrate-case/custom-readonly-mode/index.html
    index db945c74..a37d12db 100644
    --- a/zh/docs/integrate/universal-integrate-case/custom-readonly-mode/index.html
    +++ b/zh/docs/integrate/universal-integrate-case/custom-readonly-mode/index.html
    @@ -52,9 +52,9 @@
             }
           }
         })
    -  

    自定义只读模式

    概览

    +

    自定义只读模式

    概览

    在一些特殊场景中,集成方希望可以在只读的模式下运行,例如 分享 功能,被分享的人只能看而不能写、不能使用某些命令、不能进行文件的创建和删除等这类需求。

    -

    那么我们可以利用 OpenSumi 的自定义模块能力,通过在模块当中禁用掉某些功能和 Command 命令来达到只读模式的效果。

    +

    那么我们可以利用 OpenSumi 的自定义模块能力,通过在模块当中禁用掉某些功能和 Command 命令来达到只读模式的效果。

    自定义一个 readonly module

    首先自定义一个 ReadonlyModule 模块:

    @Injectable()
    diff --git a/zh/docs/integrate/universal-integrate-case/custom-reporter/index.html b/zh/docs/integrate/universal-integrate-case/custom-reporter/index.html
    index 91381b06..885ec76d 100644
    --- a/zh/docs/integrate/universal-integrate-case/custom-reporter/index.html
    +++ b/zh/docs/integrate/universal-integrate-case/custom-reporter/index.html
    @@ -52,7 +52,7 @@
             }
           }
         })
    -  

    自定义埋点上报

    概览

    +

    自定义埋点上报

    概览

    OpenSumi 内置提供了埋点上报,给集成方提供一些关键 IDE 数据的指标、一方核心插件的一些关键性能等数据。集成方可自行将这些数据上报到自己的平台。

    前端模块使用

    import { IReporterService } from '@opensumi/ide-core-browser';
    diff --git a/zh/docs/integrate/universal-integrate-case/custom-view/index.html b/zh/docs/integrate/universal-integrate-case/custom-view/index.html
    index 767b9b1a..3db5f185 100644
    --- a/zh/docs/integrate/universal-integrate-case/custom-view/index.html
    +++ b/zh/docs/integrate/universal-integrate-case/custom-view/index.html
    @@ -52,7 +52,7 @@
             }
           }
         })
    -  

    增加插槽位置

    -

    增加插槽位置非常简单,只需要将 SlotRenderer 组件放入视图即可,Layout 设计的很灵活,你可以在任意位置插入这个渲染器。在本例中,可以选择在布局组件中增加该位置,或在 MenuBar 视图内增加该位置:

    +

    增加插槽位置非常简单,只需要将 SlotRenderer 组件放入视图即可,Layout 设计的很灵活,你可以在任意位置插入这个渲染器。在本例中,可以选择在布局组件中增加该位置,或在 MenuBar 视图内增加该位置:

    export function LayoutComponent() {
       return (
         <BoxPanel direction="top-to-bottom">
    diff --git a/zh/docs/integrate/universal-integrate-case/offline-deployment/index.html b/zh/docs/integrate/universal-integrate-case/offline-deployment/index.html
    index 35cff071..e4575c5a 100644
    --- a/zh/docs/integrate/universal-integrate-case/offline-deployment/index.html
    +++ b/zh/docs/integrate/universal-integrate-case/offline-deployment/index.html
    @@ -52,7 +52,7 @@
             }
           }
         })
    -