Open troubleshooting page in browser. (#131)

* Add opn as a dependency.

* Open troubleshooting page in browser.

* Update changelog.
This commit is contained in:
Yan Zhang 2018-09-17 16:59:13 +08:00 коммит произвёл GitHub
Родитель e4069a529b
Коммит dabd3dbabf
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
5 изменённых файлов: 60 добавлений и 3 удалений

Просмотреть файл

@ -20,6 +20,7 @@ All notable changes to the "vscode-maven" extension will be documented in this f
### 0.11.0
- Sort Maven projects alphabetically in Explorer. [PR#118](https://github.com/Microsoft/vscode-maven/pull/118) by @owenconti
- Adjust order of steps when generating projects from an archetype. [#122](https://github.com/Microsoft/vscode-maven/issues/122)
- Open trouble-shooting page in browser.[PR#131](https://github.com/Microsoft/vscode-maven/pull/131)
- Fixed some bugs.
Thank [Owen Conti (@owenconti)](https://github.com/owenconti) for the help to make the extension even better.

22
package-lock.json сгенерированный
Просмотреть файл

@ -40,6 +40,15 @@
"integrity": "sha512-u+JAi1KtmaUoU/EHJkxoiuvzyo91FCE41Z9TZWWcOUU3P8oUdlDLdrGzCGWySPgbRMD17B0B+1aaJLYI9egQ6A==",
"dev": true
},
"@types/opn": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/@types/opn/-/opn-5.1.0.tgz",
"integrity": "sha512-TNPrB7Y1xl06zDI0aGyqkgxjhIev3oJ+cdqlZ52MTAHauWpEL/gIUdHebIfRHFZk9IqSBpE2ci1DT48iZH81yg==",
"dev": true,
"requires": {
"@types/node": "*"
}
},
"@types/xml2js": {
"version": "0.4.2",
"resolved": "https://registry.npmjs.org/@types/xml2js/-/xml2js-0.4.2.tgz",
@ -1272,6 +1281,11 @@
"integrity": "sha1-1LVcafUYhvm2XHDWwmItN+KfSP4=",
"dev": true
},
"is-wsl": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz",
"integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0="
},
"isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
@ -1601,6 +1615,14 @@
"wrappy": "1"
}
},
"opn": {
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/opn/-/opn-5.3.0.tgz",
"integrity": "sha512-bYJHo/LOmoTd+pfiYhfZDnf9zekVJrY+cnS2a5F2x+w5ppvTqObojTP7WiFG+kVZs9Inw+qQ/lw7TroWwhdd2g==",
"requires": {
"is-wsl": "^1.1.0"
}
},
"ordered-read-streams": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-0.3.0.tgz",

Просмотреть файл

@ -358,6 +358,7 @@
"@types/minimatch": "^3.0.1",
"@types/mocha": "^2.2.42",
"@types/node": "^7.0.43",
"@types/opn": "^5.1.0",
"@types/xml2js": "^0.4.2",
"tslint": "^5.8.0",
"tslint-microsoft-contrib": "^5.0.1",
@ -368,6 +369,7 @@
"fs-extra": "^4.0.3",
"md5": "^2.2.1",
"minimatch": "^3.0.4",
"opn": "^5.3.0",
"vscode-extension-telemetry-wrapper": "^0.3.1",
"xml2js": "^0.4.19"
}

Просмотреть файл

@ -2,11 +2,15 @@
// Licensed under the MIT license.
import * as fs from "fs-extra";
import { commands, InputBoxOptions, OpenDialogOptions, OutputChannel, QuickPickItem, QuickPickOptions, Terminal, Uri, window } from "vscode";
// tslint:disable-next-line:no-require-imports
import opn = require('opn');
import { InputBoxOptions, OpenDialogOptions, OutputChannel, QuickPickItem, QuickPickOptions, Terminal, Uri, window } from "vscode";
import { Settings } from "./Settings";
import { Utils } from "./Utils";
export namespace VSCodeUI {
const TROUBLESHOOTING_LINK: string = "https://github.com/Microsoft/vscode-maven/blob/master/Troubleshooting.md";
// output channel
class MavenOutputChannel {
private readonly channel: OutputChannel = window.createOutputChannel("Maven for Java");
@ -221,8 +225,7 @@ export namespace VSCodeUI {
const choiceForDetails: string = await window.showErrorMessage(errorMessage, OPTION_LEARN_MORE);
if (choiceForDetails === OPTION_LEARN_MORE) {
// open FAQs
const readmeFilePath: string = Utils.getPathToExtensionRoot("Troubleshooting.md");
commands.executeCommand("markdown.showPreview", Uri.file(readmeFilePath));
opn(TROUBLESHOOTING_LINK);
}
}
}

Просмотреть файл

@ -10,6 +10,7 @@ are grateful to these developers for their contribution to open source.
3. fs-extra (https://github.com/jprichardson/node-fs-extra)
4. vscode-extension-telemetry-wrapper (https://github.com/Eskibear/vscode-extension-telemetry-wrapper)
5. xml2js (https://github.com/Leonidas-from-XIV/node-xml2js)
6. opn (https://github.com/sindresorhus/opn)
md5 NOTICES BEGIN HERE
=============================
@ -135,3 +136,31 @@ IN THE SOFTWARE.
END OF xml2js NOTICES AND INFORMATION
==========================================================
opn NOTICES BEGIN HERE
=============================
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
END OF opn NOTICES AND INFORMATION
=========================================