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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"description": "codeblitzjs",
"main": "index.js",
"engines": {
"opensumi": "3.1.5-next-1722006339.0"
"opensumi": "3.2.2-next-1722848438.0"
},
"scripts": {
"prepare": "husky install",
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
"opensumi codeblitzjs"
],
"engines": {
"opensumi": "3.1.5-next-1722006339.0",
"opensumi": "3.2.2-next-1722848438.0",
"node": ">=10.0.0"
},
"dependencies": {
"@codeblitzjs/ide-common": "workspace:*",
"@opensumi/extension-installer": "^0.0.1",
"@opensumi/ide-extension": "3.1.5-next-1722006339.0",
"@opensumi/ide-extension": "3.2.2-next-1722848438.0",
"commander": "^7.2.0",
"fs-extra": "^9.0.1",
"lodash.pick": "^4.4.0",
Expand Down
84 changes: 42 additions & 42 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,48 +33,48 @@
"@codeblitzjs/ide-plugin": "workspace:*",
"@codeblitzjs/ide-registry": "workspace:*",
"@codeblitzjs/ide-sumi-core": "workspace:*",
"@opensumi/ide-addons": "3.1.5-next-1722006339.0",
"@opensumi/ide-ai-native": "3.1.5-next-1722006339.0",
"@opensumi/ide-comments": "3.1.5-next-1722006339.0",
"@opensumi/ide-core-browser": "3.1.5-next-1722006339.0",
"@opensumi/ide-core-common": "3.1.5-next-1722006339.0",
"@opensumi/ide-debug": "3.1.5-next-1722006339.0",
"@opensumi/ide-decoration": "3.1.5-next-1722006339.0",
"@opensumi/ide-design": "3.1.5-next-1722006339.0",
"@opensumi/ide-editor": "3.1.5-next-1722006339.0",
"@opensumi/ide-explorer": "3.1.5-next-1722006339.0",
"@opensumi/ide-express-file-server": "3.1.5-next-1722006339.0",
"@opensumi/ide-extension": "3.1.5-next-1722006339.0",
"@opensumi/ide-extension-storage": "3.1.5-next-1722006339.0",
"@opensumi/ide-file-scheme": "3.1.5-next-1722006339.0",
"@opensumi/ide-file-service": "3.1.5-next-1722006339.0",
"@opensumi/ide-file-tree-next": "3.1.5-next-1722006339.0",
"@opensumi/ide-i18n": "3.1.5-next-1722006339.0",
"@opensumi/ide-keymaps": "3.1.5-next-1722006339.0",
"@opensumi/ide-logs": "3.1.5-next-1722006339.0",
"@opensumi/ide-main-layout": "3.1.5-next-1722006339.0",
"@opensumi/ide-markdown": "3.1.5-next-1722006339.0",
"@opensumi/ide-markers": "3.1.5-next-1722006339.0",
"@opensumi/ide-menu-bar": "3.1.5-next-1722006339.0",
"@opensumi/ide-monaco": "3.1.5-next-1722006339.0",
"@opensumi/ide-monaco-enhance": "3.1.5-next-1722006339.0",
"@opensumi/ide-opened-editor": "3.1.5-next-1722006339.0",
"@opensumi/ide-outline": "3.1.5-next-1722006339.0",
"@opensumi/ide-output": "3.1.5-next-1722006339.0",
"@opensumi/ide-overlay": "3.1.5-next-1722006339.0",
"@opensumi/ide-preferences": "3.1.5-next-1722006339.0",
"@opensumi/ide-quick-open": "3.1.5-next-1722006339.0",
"@opensumi/ide-scm": "3.1.5-next-1722006339.0",
"@opensumi/ide-search": "3.1.5-next-1722006339.0",
"@opensumi/ide-status-bar": "3.1.5-next-1722006339.0",
"@opensumi/ide-storage": "3.1.5-next-1722006339.0",
"@opensumi/ide-testing": "3.1.5-next-1722006339.0",
"@opensumi/ide-theme": "3.1.5-next-1722006339.0",
"@opensumi/ide-toolbar": "3.1.5-next-1722006339.0",
"@opensumi/ide-variable": "3.1.5-next-1722006339.0",
"@opensumi/ide-webview": "3.1.5-next-1722006339.0",
"@opensumi/ide-workspace": "3.1.5-next-1722006339.0",
"@opensumi/ide-workspace-edit": "3.1.5-next-1722006339.0",
"@opensumi/ide-addons": "3.2.2-next-1722848438.0",
"@opensumi/ide-ai-native": "3.2.2-next-1722848438.0",
"@opensumi/ide-comments": "3.2.2-next-1722848438.0",
"@opensumi/ide-core-browser": "3.2.2-next-1722848438.0",
"@opensumi/ide-core-common": "3.2.2-next-1722848438.0",
"@opensumi/ide-debug": "3.2.2-next-1722848438.0",
"@opensumi/ide-decoration": "3.2.2-next-1722848438.0",
"@opensumi/ide-design": "3.2.2-next-1722848438.0",
"@opensumi/ide-editor": "3.2.2-next-1722848438.0",
"@opensumi/ide-explorer": "3.2.2-next-1722848438.0",
"@opensumi/ide-express-file-server": "3.2.2-next-1722848438.0",
"@opensumi/ide-extension": "3.2.2-next-1722848438.0",
"@opensumi/ide-extension-storage": "3.2.2-next-1722848438.0",
"@opensumi/ide-file-scheme": "3.2.2-next-1722848438.0",
"@opensumi/ide-file-service": "3.2.2-next-1722848438.0",
"@opensumi/ide-file-tree-next": "3.2.2-next-1722848438.0",
"@opensumi/ide-i18n": "3.2.2-next-1722848438.0",
"@opensumi/ide-keymaps": "3.2.2-next-1722848438.0",
"@opensumi/ide-logs": "3.2.2-next-1722848438.0",
"@opensumi/ide-main-layout": "3.2.2-next-1722848438.0",
"@opensumi/ide-markdown": "3.2.2-next-1722848438.0",
"@opensumi/ide-markers": "3.2.2-next-1722848438.0",
"@opensumi/ide-menu-bar": "3.2.2-next-1722848438.0",
"@opensumi/ide-monaco": "3.2.2-next-1722848438.0",
"@opensumi/ide-monaco-enhance": "3.2.2-next-1722848438.0",
"@opensumi/ide-opened-editor": "3.2.2-next-1722848438.0",
"@opensumi/ide-outline": "3.2.2-next-1722848438.0",
"@opensumi/ide-output": "3.2.2-next-1722848438.0",
"@opensumi/ide-overlay": "3.2.2-next-1722848438.0",
"@opensumi/ide-preferences": "3.2.2-next-1722848438.0",
"@opensumi/ide-quick-open": "3.2.2-next-1722848438.0",
"@opensumi/ide-scm": "3.2.2-next-1722848438.0",
"@opensumi/ide-search": "3.2.2-next-1722848438.0",
"@opensumi/ide-status-bar": "3.2.2-next-1722848438.0",
"@opensumi/ide-storage": "3.2.2-next-1722848438.0",
"@opensumi/ide-testing": "3.2.2-next-1722848438.0",
"@opensumi/ide-theme": "3.2.2-next-1722848438.0",
"@opensumi/ide-toolbar": "3.2.2-next-1722848438.0",
"@opensumi/ide-variable": "3.2.2-next-1722848438.0",
"@opensumi/ide-webview": "3.2.2-next-1722848438.0",
"@opensumi/ide-workspace": "3.2.2-next-1722848438.0",
"@opensumi/ide-workspace-edit": "3.2.2-next-1722848438.0",
"@opensumi/textmate-languages": "^2.7.0",
"tslib": "^2.2.0"
},
Expand Down
5 changes: 4 additions & 1 deletion packages/core/src/api/renderDiffViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import { DiffViewerModule } from '../core/diff-viewer/module';
import { BoxPanel, SplitPanel } from '../editor';
import { Injector } from '../modules/opensumi__common-di';
import { AppRenderer, IAppRendererProps } from './renderApp';
import '../core/diff-viewer/languages-patch';
import { extensionMetadata } from '../core/diff-viewer/extension-patch';

export {
IDiffViewerHandle,
Expand Down Expand Up @@ -89,8 +91,9 @@ export const DiffViewerRenderer = (_props: IDiffViewerProps) => {
layoutComponent,
layoutConfig,
disableRestoreEditorGroupState: true,
extensionMetadata,
defaultPreferences: {
'general.theme': 'opensumi-design-light-theme',
'general.theme': 'opensumi-light',
'editor.minimap': false,
'ai.native.inlineDiff.preview.mode': 'inlineLive',
'editor.autoSave': 'afterDelay',
Expand Down
24 changes: 24 additions & 0 deletions packages/core/src/core/diff-viewer/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { IAppOpts, RuntimeConfig } from '@codeblitzjs/ide-sumi-core';
import { IPartialEditEvent } from '@opensumi/ide-ai-native/lib/browser/widget/inline-stream-diff/live-preview.decoration';
import { Event, URI } from '@opensumi/ide-core-common';
import { IResourceOpenOptions } from '@opensumi/ide-editor';
import { ITheme } from '@opensumi/ide-theme';
import { IAppInstance } from '../../editor';
import { LandingProps } from '../types';

Expand All @@ -19,6 +20,20 @@ export interface IDiffViewerTab {
filePath: string;
}

export interface ITabChangedEvent {
/**
* 为空则表示当前没有标签页
* 否则为当前标签页的路径
*/
newPath?: string;
/**
* zero-based index
* 0 为第一个标签页
* -1 为没有标签页
*/
currentIndex: number;
}

export interface IDiffViewerHandle {
openFileInTab: (filePath: string, content: string, options?: IResourceOpenOptions) => Promise<URI>;
/**
Expand Down Expand Up @@ -49,6 +64,7 @@ export interface IDiffViewerHandle {
* 监听采纳、拒绝部分编辑事件
*/
onPartialEditEvent: Event<IExtendPartialEditEvent>;
onDidTabChange: Event<ITabChangedEvent>;

getCurrentTab: () => IDiffViewerTab | undefined;
getTabAtIndex: (index: number) => IDiffViewerTab | undefined;
Expand Down Expand Up @@ -89,7 +105,15 @@ export interface IOverrideAppRendererProps extends IOverrideAppRendererConfig {
Landing?: React.ComponentType<LandingProps>;
}

export interface IExtraContent {
component?: React.ComponentType<any>;
initialProps?: any;
}

export const IDiffViewerProps = Symbol('IDiffViewerProps');
export interface IDiffViewerProps extends Partial<IOverrideAppRendererProps> {
onRef: (handle: IDiffViewerHandle) => void;

onWillApplyTheme?: (theme: ITheme) => Record<string, string | undefined>;
tabBarRightExtraContent?: IExtraContent;
}
22 changes: 22 additions & 0 deletions packages/core/src/core/diff-viewer/extension-patch.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import anycode from '../../../extensions/codeblitz.anycode';
// import anycodeCSharp from '../../../extensions/codeblitz.anycode-c-sharp';
// import anycodeCpp from '../../../extensions/codeblitz.anycode-cpp';
import anycodeGo from '../../../extensions/codeblitz.anycode-go';
import anycodeJava from '../../../extensions/codeblitz.anycode-java';
// import anycodePhp from '../../../extensions/codeblitz.anycode-php';
import anycodePython from '../../../extensions/codeblitz.anycode-python';
import anycodeRust from '../../../extensions/codeblitz.anycode-rust';
import anycodeTypescript from '../../../extensions/codeblitz.anycode-typescript';


export const extensionMetadata = [
anycode,
// anycodeCSharp,
// anycodeCpp,
anycodeGo,
anycodeJava,
// anycodePhp,
anycodePython,
anycodeRust,
anycodeTypescript,
]
Loading