Skip to content

Commit

Permalink
workspace: modifying retrieval of untitled files
Browse files Browse the repository at this point in the history
  • Loading branch information
Vlad Arama committed Jun 8, 2023
1 parent 045209f commit 88bc7d7
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions packages/core/src/browser/common-frontend-contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import { OS, isOSX, isWindows } from '../common/os';
import { ResourceContextKey } from './resource-context-key';
import { UriSelection } from '../common/selection';
import { StorageService } from './storage-service';
import { Navigatable } from './navigatable';
import { Navigatable, NavigatableWidget } from './navigatable';
import { QuickViewService } from './quick-input/quick-view-service';
import { environment } from '@theia/application-package/lib/environment';
import { IconTheme, IconThemeService } from './icon-theme-service';
Expand All @@ -63,7 +63,7 @@ import { DecorationStyle } from './decoration-style';
import { isPinned, Title, togglePinned, Widget } from './widgets';
import { SaveResourceService } from './save-resource-service';
import { UserWorkingDirectoryProvider } from './user-working-directory-provider';
import { UntitledResourceResolver } from '../common';
import { UNTITLED_SCHEME, UntitledResourceResolver } from '../common';
import { LanguageQuickPickService } from './i18n/language-quick-pick-service';

export namespace CommonMenus {
Expand Down Expand Up @@ -1150,13 +1150,13 @@ export class CommonFrontendContribution implements FrontendApplicationContributi
const captionsToSave = this.unsavedTabsCaptions();
const untitledCaptionsToSave = this.unsavedUntitledTabsCaptions();
const result = await confirmExitWithOrWithoutSaving(captionsToSave, async () => {
await this.shell.saveAll();
await this.saveDirty(untitledCaptionsToSave);
});
return result;
}
};
}
await this.shell.saveAll();
await this.saveDirty(untitledCaptionsToSave);
});
return result;
}
};
}
} finally {
this.shouldPreventClose = false;
}
Expand All @@ -1168,7 +1168,7 @@ export class CommonFrontendContribution implements FrontendApplicationContributi
}
protected unsavedUntitledTabsCaptions(): Widget[] {
return this.shell.widgets.filter(widget =>
widget.title.label.includes('Untitled-') && this.saveResourceService.canSaveAs(widget)
NavigatableWidget.getUri(widget)?.scheme === UNTITLED_SCHEME && this.saveResourceService.canSaveAs(widget)
);
}
protected async configureDisplayLanguage(): Promise<void> {
Expand Down

0 comments on commit 88bc7d7

Please sign in to comment.