debug: fix closeReadonlyTabsOnEnd not working (#203500)

The input itself is not readonly, the filesystem is, so this check
was always failing.

The entire `debug` scheme is readonly, so we don't need to try to
replace the check with anything else. This is pretty safe since this
code path is only hit when the new setting is enabled.

Closes #197949
This commit is contained in:
Connor Peet 2024-01-25 16:00:27 -08:00 committed by GitHub
parent 7f056a705e
commit feff7c8a7e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -710,10 +710,7 @@ export class DebugService implements IDebugService {
if (this.configurationService.getValue<IDebugConfiguration>('debug').closeReadonlyTabsOnEnd) {
const editorsToClose = this.editorService.getEditors(EditorsOrder.SEQUENTIAL).filter(({ editor }) => {
if (editor.resource?.scheme === DEBUG_SCHEME) {
return editor.isReadonly() && session.getId() === Source.getEncodedDebugData(editor.resource).sessionId;
}
return false;
return editor.resource?.scheme === DEBUG_SCHEME && session.getId() === Source.getEncodedDebugData(editor.resource).sessionId;
});
this.editorService.closeEditors(editorsToClose);
}