Skip to content

Commit dc31b10

Browse files
authored
code editor integration should set readonly-ness only when the editor shows its modified file and unset it otherwise (microsoft#242286)
microsoft/vscode-copilot#13578
1 parent 4e6f06d commit dc31b10

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

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

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -221,17 +221,7 @@ export class ChatEditingCodeEditorIntegration implements IModifiedFileEntryEdito
221221
this._store.add(toDisposable(restoreActualOptions));
222222

223223
const shouldBeReadOnly = derived(this, r => {
224-
const model = codeEditorObs.model.read(r);
225-
if (!model) {
226-
return false;
227-
}
228-
for (const session of chatEditingService.editingSessionsObs.read(r)) {
229-
const entry = session.readEntry(model.uri, r);
230-
if (entry?.isCurrentlyBeingModifiedBy.read(r)) {
231-
return true;
232-
}
233-
}
234-
return false;
224+
return enabledObs.read(r) && Boolean(_entry.isCurrentlyBeingModifiedBy.read(r));
235225
});
236226

237227
this._store.add(autorun(r => {

0 commit comments

Comments
 (0)