mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-02 22:41:31 +01:00
use better file create mode for lightweight mode, fix issue with hidden/visible extra button bar (#199151)
This commit is contained in:
@@ -607,6 +607,7 @@ export class LiveStrategy3 extends EditModeStrategy {
|
||||
|
||||
private readonly _store: DisposableStore = new DisposableStore();
|
||||
private readonly _sessionStore: DisposableStore = new DisposableStore();
|
||||
private readonly _previewZone: Lazy<InlineChatFileCreatePreviewWidget>;
|
||||
|
||||
private readonly _ctxCurrentChangeHasDiff: IContextKey<boolean>;
|
||||
private readonly _ctxCurrentChangeShowsDiff: IContextKey<boolean>;
|
||||
@@ -631,6 +632,8 @@ export class LiveStrategy3 extends EditModeStrategy {
|
||||
this._ctxCurrentChangeShowsDiff = CTX_INLINE_CHAT_CHANGE_SHOWS_DIFF.bindTo(contextKeyService);
|
||||
|
||||
this._modifiedRangesDecorations = this._editor.createDecorationsCollection();
|
||||
this._previewZone = new Lazy(() => _instaService.createInstance(InlineChatFileCreatePreviewWidget, _editor));
|
||||
|
||||
}
|
||||
|
||||
override dispose(): void {
|
||||
@@ -939,10 +942,10 @@ export class LiveStrategy3 extends EditModeStrategy {
|
||||
|
||||
override async renderChanges(response: ReplyResponse) {
|
||||
|
||||
if (response.untitledTextModel) {
|
||||
this._zone.widget.showCreatePreview(response.untitledTextModel);
|
||||
if (response.untitledTextModel && !response.untitledTextModel.isDisposed()) {
|
||||
this._previewZone.value.showCreation(this._session.wholeRange.value.getStartPosition().delta(-1), response.untitledTextModel);
|
||||
} else {
|
||||
this._zone.widget.hideCreatePreview();
|
||||
this._previewZone.value.hide();
|
||||
}
|
||||
|
||||
return await this._showDiff(true, false);
|
||||
|
||||
Reference in New Issue
Block a user