Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adopt latest Electron build (#826) #854

Merged
merged 4 commits into from
Dec 1, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Code",
"version": "0.10.3",
"electronVersion": "0.34.1",
"electronVersion": "0.34.5",
"author": {
"name": "Microsoft Corporation"
},
Expand Down
1 change: 1 addition & 0 deletions scripts/code.bat
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ if not exist out node .\node_modules\gulp\bin\gulp.js compile
:: Configuration
set NODE_ENV=development
set VSCODE_DEV=1
set ELECTRON_DEFAULT_ERROR_MODE=1
set ELECTRON_ENABLE_LOGGING=1
set ELECTRON_ENABLE_STACK_DUMPING=1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class UntitledEditorInput extends EditorInput implements IResourceEditorI
public suggestFileName(): string {
if (!this.hasAssociatedFilePath) {
let mime = this.getMime();
if (mime) {
if (mime && mime !== MIME_TEXT /* do not suggest when the mime type is simple plain text */) {
return suggestFilename(mime, this.getName());
}
}
Expand Down
20 changes: 8 additions & 12 deletions src/vs/workbench/parts/files/electron-browser/textFileServices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,31 +348,27 @@ export class TextFileService extends BrowserTextFileService {
private promptForPathAsync(defaultPath?: string): TPromise<string> {
return new TPromise<string>((c, e) => {
Dialog.showSaveDialog(remote.getCurrentWindow(), this.getSaveDialogOptions(defaultPath ? paths.normalize(defaultPath, true) : void 0), (path) => {
if (path && isWindows) {
path = strings.rtrim(path, '.*'); // Bug on Windows: When "All Files" is picked, the path gets an extra ".*"
}

c(path);
});
});
}

private promptForPathSync(defaultPath?: string): string {
let path = Dialog.showSaveDialog(remote.getCurrentWindow(), this.getSaveDialogOptions(defaultPath ? paths.normalize(defaultPath, true) : void 0));
if (path && isWindows) {
path = strings.rtrim(path, '.*'); // Bug on Windows: When "All Files" is picked, the path gets an extra ".*"
}

return path;
return Dialog.showSaveDialog(remote.getCurrentWindow(), this.getSaveDialogOptions(defaultPath ? paths.normalize(defaultPath, true) : void 0));
}

private getSaveDialogOptions(defaultPath?: string): remote.ISaveDialogOptions {
let options: remote.ISaveDialogOptions = {
defaultPath: defaultPath
};

// Filters are only working well on Windows it seems
if (!isWindows) {
// Filters are working flaky in Electron and there are bugs. On Windows they are working
// somewhat but we see issues:
// - https://github.com/atom/electron/issues/3556
// - https://github.com/Microsoft/vscode/issues/451
// - Bug on Windows: When "All Files" is picked, the path gets an extra ".*"
// Until these issues are resolved, we disable the dialog file extension filtering.
if (true) {
return options;
}

Expand Down