提交 61416238 编写于 作者: B Benjamin Pasero

Missing saveAs csv file type in file saveAs dialog (fix #96283)

上级 e88b8d32
......@@ -279,21 +279,25 @@ export abstract class AbstractFileDialogService implements IFileDialogService {
return filter;
}));
// Filters are a bit weird on Windows, based on having a match or not:
// Match: we put the matching filter first so that it shows up selected and the all files last
// No match: we put the all files filter first
const allFilesFilter = { name: nls.localize('allFiles', "All Files"), extensions: ['*'] };
if (matchingFilter) {
filters.unshift(matchingFilter);
filters.unshift(allFilesFilter);
} else {
filters.unshift(allFilesFilter);
// We have no matching filter, e.g. because the language
// is unknown. We still add the extension to the list of
// filters though so that it can be picked
// (https://github.com/microsoft/vscode/issues/96283)
if (!matchingFilter && ext) {
matchingFilter = { name: nls.localize('fileExt', "{0} File", ext), extensions: [trim(ext, '.')] };
}
// Allow to save file without extension
filters.push({ name: nls.localize('noExt', "No Extension"), extensions: [''] });
options.filters = filters;
// Order of filters is
// - File Extension Match
// - All Files
// - All Languages
// - No Extension
options.filters = coalesce([
matchingFilter,
{ name: nls.localize('allFiles', "All Files"), extensions: ['*'] },
...filters,
{ name: nls.localize('noExt', "No Extension"), extensions: [''] }
]);
return options;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册