wip: UrlService
This commit is contained in:
parent
efd6451efb
commit
c063542c2a
|
@ -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',
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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);
|
||||
|
|
16
src/vs/platform/url/common/url.ts
Normal file
16
src/vs/platform/url/common/url.ts
Normal file
|
@ -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<IURLService>(ID);
|
||||
|
||||
export interface IURLService {
|
||||
onOpenUrl: Event<string>;
|
||||
}
|
6
src/vs/platform/url/common/urlIpc.ts
Normal file
6
src/vs/platform/url/common/urlIpc.ts
Normal file
|
@ -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';
|
19
src/vs/platform/url/node/urlService.ts
Normal file
19
src/vs/platform/url/node/urlService.ts
Normal file
|
@ -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<string>();
|
||||
onOpenUrl: Event<string> = this._onOpenUrl.event;
|
||||
|
||||
constructor() {
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue