-
Notifications
You must be signed in to change notification settings - Fork 404
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support NES render in code edits (#4403)
* feat: support NES render in code edits * chore: use enum
- Loading branch information
Showing
13 changed files
with
489 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
packages/ai-native/src/browser/contrib/intelligent-completions/view/base.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { Injector } from '@opensumi/di'; | ||
import { Disposable } from '@opensumi/ide-core-common'; | ||
import { ICodeEditor } from '@opensumi/ide-monaco'; | ||
import { | ||
ObservableCodeEditor, | ||
observableCodeEditor, | ||
} from '@opensumi/monaco-editor-core/esm/vs/editor/browser/observableCodeEditor'; | ||
|
||
import { CodeEditsResultValue } from '../index'; | ||
|
||
export abstract class BaseCodeEditsView extends Disposable { | ||
protected editorObs: ObservableCodeEditor; | ||
|
||
public modelId: string; | ||
|
||
constructor(protected readonly monacoEditor: ICodeEditor, protected readonly injector: Injector) { | ||
super(); | ||
|
||
this.editorObs = observableCodeEditor(this.monacoEditor); | ||
this.mount(); | ||
|
||
this.addDispose({ dispose: () => this.hide() }); | ||
} | ||
|
||
protected mount(): void {} | ||
|
||
abstract render(completionModel: CodeEditsResultValue): void; | ||
abstract hide(): void; | ||
abstract accept(): void; | ||
abstract discard(): void; | ||
} |
Oops, something went wrong.