Skip to content

Commit 49fc0fe

Browse files
author
Benjamin Pasero
committed
"You cannot save this document with extension..." Is this new? (fix microsoft#100241)
1 parent 97650fb commit 49fc0fe

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/vs/workbench/services/dialogs/browser/abstractFileDialogService.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import { coalesce } from 'vs/base/common/arrays';
2525
import { trim } from 'vs/base/common/strings';
2626
import { IModeService } from 'vs/editor/common/services/modeService';
2727
import { ILabelService } from 'vs/platform/label/common/label';
28+
import { isWindows } from 'vs/base/common/platform';
2829

2930
export abstract class AbstractFileDialogService implements IFileDialogService {
3031

@@ -254,7 +255,7 @@ export abstract class AbstractFileDialogService implements IFileDialogService {
254255
const options: ISaveDialogOptions = {
255256
defaultUri,
256257
title: nls.localize('saveAsTitle', "Save As"),
257-
availableFileSystems,
258+
availableFileSystems
258259
};
259260

260261
interface IFilter { name: string; extensions: string[]; }
@@ -282,8 +283,12 @@ export abstract class AbstractFileDialogService implements IFileDialogService {
282283
// We have no matching filter, e.g. because the language
283284
// is unknown. We still add the extension to the list of
284285
// filters though so that it can be picked
285-
// (https://github.com/microsoft/vscode/issues/96283)
286-
if (!matchingFilter && ext) {
286+
// (https://github.com/microsoft/vscode/issues/96283) but
287+
// only on Windows where this is an issue. Adding this to
288+
// macOS would result in the following bugs:
289+
// https://github.com/microsoft/vscode/issues/100614 and
290+
// https://github.com/microsoft/vscode/issues/100241
291+
if (isWindows && !matchingFilter && ext) {
287292
matchingFilter = { name: trim(ext, '.').toUpperCase(), extensions: [trim(ext, '.')] };
288293
}
289294

0 commit comments

Comments
 (0)