diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js index 757ec894355..ae2399c2d7b 100644 --- a/build/gulpfile.vscode.js +++ b/build/gulpfile.vscode.js @@ -108,6 +108,11 @@ const config = { extensions: ["ascx", "asp", "aspx", "bash", "bash_login", "bash_logout", "bash_profile", "bashrc", "bat", "bowerrc", "c", "cc", "clj", "cljs", "cljx", "clojure", "cmd", "coffee", "config", "cpp", "cs", "cshtml", "csproj", "css", "csx", "ctp", "cxx", "dockerfile", "dot", "dtd", "editorconfig", "edn", "eyaml", "eyml", "fs", "fsi", "fsscript", "fsx", "gemspec", "gitattributes", "gitconfig", "gitignore", "go", "h", "handlebars", "hbs", "hh", "hpp", "htm", "html", "hxx", "ini", "jade", "jav", "java", "js", "jscsrc", "jshintrc", "jshtm", "json", "jsp", "less", "lua", "m", "makefile", "markdown", "md", "mdoc", "mdown", "mdtext", "mdtxt", "mdwn", "mkd", "mkdn", "ml", "mli", "php", "phtml", "pl", "pl6", "pm", "pm6", "pod", "pp", "profile", "properties", "ps1", "psd1", "psgi", "psm1", "py", "r", "rb", "rhistory", "rprofile", "rs", "rt", "scss", "sh", "shtml", "sql", "svg", "svgz", "t", "ts", "txt", "vb", "wxi", "wxl", "wxs", "xaml", "xml", "yaml", "yml", "zlogin", "zlogout", "zprofile", "zsh", "zshenv", "zshrc"], iconFile: 'resources/darwin/code_file.icns' }], + darwinBundleURLTypes: [{ + role: 'Viewer', + name: product.nameLong, + urlSchemes: ['vscode'] + }], darwinCredits: darwinCreditsTemplate ? new Buffer(darwinCreditsTemplate({ commit: commit, date: new Date().toISOString() })) : void 0, linuxExecutableName: product.applicationName, winIcon: 'resources/win32/code.ico', diff --git a/package.json b/package.json index 40743620192..871851b1e8d 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "ghooks": "1.0.3", "glob": "^5.0.13", "gulp": "^3.8.9", - "gulp-atom-electron": "^1.7.1", + "gulp-atom-electron": "^1.8.0", "gulp-azure-storage": "^0.6.0", "gulp-bom": "^1.0.0", "gulp-buffer": "0.0.2", diff --git a/src/vs/code/electron-main/main.ts b/src/vs/code/electron-main/main.ts index c3668abf925..e23a8478ba2 100644 --- a/src/vs/code/electron-main/main.ts +++ b/src/vs/code/electron-main/main.ts @@ -144,6 +144,12 @@ function main(accessor: ServicesAccessor, ipcServer: Server, userEnv: IProcessEn dispose(); }); + app.setAsDefaultProtocolClient('vscode'); + + app.on('open-url', url => { + console.log(url); + }); + // Dispose on vscode:exit ipc.on('vscode:exit', (event, code: number) => { logService.log('IPC#vscode:exit', code); diff --git a/src/vs/platform/url/common/url.ts b/src/vs/platform/url/common/url.ts new file mode 100644 index 00000000000..a3ef9cf051a --- /dev/null +++ b/src/vs/platform/url/common/url.ts @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; + +import Event from 'vs/base/common/event'; +import {createDecorator} from 'vs/platform/instantiation/common/instantiation'; + +export const ID = 'urlService'; +export const IURLService = createDecorator(ID); + +export interface IURLService { + onOpenUrl: Event; +} diff --git a/src/vs/platform/url/common/urlIpc.ts b/src/vs/platform/url/common/urlIpc.ts new file mode 100644 index 00000000000..2000711f430 --- /dev/null +++ b/src/vs/platform/url/common/urlIpc.ts @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; \ No newline at end of file diff --git a/src/vs/platform/url/node/urlService.ts b/src/vs/platform/url/node/urlService.ts new file mode 100644 index 00000000000..ce3dce08007 --- /dev/null +++ b/src/vs/platform/url/node/urlService.ts @@ -0,0 +1,19 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; + +import Event, {Emitter} from 'vs/base/common/event'; +import {IURLService} from 'vs/platform/url/common/url'; + +export class URLService implements IURLService { + + private _onOpenUrl = new Emitter(); + onOpenUrl: Event = this._onOpenUrl.event; + + constructor() { + + } +} \ No newline at end of file