Skip to content

Commit 1c39d75

Browse files
authored
fix: don't require untitled chat edited files to be part of the workspace (microsoft#232172)
1 parent f338f3d commit 1c39d75

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import { IChatWidgetService } from '../chat.js';
3636
import { ChatEditingMultiDiffSourceResolver } from './chatEditingService.js';
3737
import { ChatEditingModifiedFileEntry, IModifiedEntryTelemetryInfo, ISnapshotEntry } from './chatEditingModifiedFileEntry.js';
3838
import { ChatEditingTextModelContentProvider } from './chatEditingTextModelContentProviders.js';
39+
import { Schemas } from '../../../../../base/common/network.js';
3940

4041
export class ChatEditingSession extends Disposable implements IChatEditingSession {
4142
private readonly _state = observableValue<ChatEditingSessionState>(this, ChatEditingSessionState.Initial);
@@ -517,7 +518,7 @@ export class ChatEditingSession extends Disposable implements IChatEditingSessio
517518
return;
518519
}
519520

520-
if (!this._workspaceContextService.getWorkspaceFolder(resource) && !(await this._fileService.exists(resource))) {
521+
if (resource.scheme !== Schemas.untitled && !this._workspaceContextService.getWorkspaceFolder(resource) && !(await this._fileService.exists(resource))) {
521522
// if the file doesn't exist yet and is outside the workspace, prompt the user for a location to save it to
522523
const saveLocation = await this._dialogService.showSaveDialog({ title: localize('chatEditing.fileSave', '{0} wants to create a file. Choose where it should be saved.', this._chatAgentService.getDefaultAgent(ChatAgentLocation.EditingSession)?.fullName ?? 'Chat') });
523524
if (!saveLocation) {

0 commit comments

Comments
 (0)