diff --git a/package.json b/package.json index eb97d01..4e68462 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "url": "https://github.com/eamodio/vscode-gitlens.git" }, "engines": { - "vscode": "^1.30.0" + "vscode": "^1.31.0" }, "main": "./dist/extension", "icon": "images/gitlens-icon.png", diff --git a/src/commands/diffDirectory.ts b/src/commands/diffDirectory.ts index eb82b59..7a5fdcf 100644 --- a/src/commands/diffDirectory.ts +++ b/src/commands/diffDirectory.ts @@ -1,6 +1,6 @@ 'use strict'; -import { commands, TextEditor, Uri, window } from 'vscode'; -import { BuiltInCommands, GlyphChars } from '../constants'; +import { env, TextEditor, Uri, window } from 'vscode'; +import { GlyphChars } from '../constants'; import { Container } from '../container'; import { Logger } from '../logger'; import { Messages } from '../messages'; @@ -95,8 +95,7 @@ export class DiffDirectoryCommand extends ActiveEditorCommand { ); if (!result) return undefined; - return commands.executeCommand( - BuiltInCommands.Open, + return env.openExternal( Uri.parse('https://git-scm.com/docs/git-config#Documentation/git-config.txt-difftool') ); } diff --git a/src/commands/externalDiff.ts b/src/commands/externalDiff.ts index bae1425..deb1cc9 100644 --- a/src/commands/externalDiff.ts +++ b/src/commands/externalDiff.ts @@ -1,6 +1,6 @@ 'use strict'; -import { commands, SourceControlResourceState, Uri, window } from 'vscode'; -import { BuiltInCommands, GlyphChars } from '../constants'; +import { env, SourceControlResourceState, Uri, window } from 'vscode'; +import { GlyphChars } from '../constants'; import { Container } from '../container'; import { GitService, GitUri } from '../git/gitService'; import { Logger } from '../logger'; @@ -195,8 +195,7 @@ export class ExternalDiffCommand extends Command { ); if (!result) return undefined; - return commands.executeCommand( - BuiltInCommands.Open, + return env.openExternal( Uri.parse('https://git-scm.com/docs/git-config#Documentation/git-config.txt-difftool') ); } diff --git a/src/git/remotes/provider.ts b/src/git/remotes/provider.ts index 8442a33..af78b5d 100644 --- a/src/git/remotes/provider.ts +++ b/src/git/remotes/provider.ts @@ -1,6 +1,5 @@ 'use strict'; -import { commands, env, Range, Uri, window } from 'vscode'; -import { BuiltInCommands } from '../../constants'; +import { env, Range, Uri, window } from 'vscode'; import { Logger } from '../../logger'; import { Messages } from '../../messages'; import { GitLogCommit } from '../models/logCommit'; @@ -115,7 +114,7 @@ export abstract class RemoteProvider { private openUrl(url?: string): Thenable<{} | undefined> { if (url === undefined) return Promise.resolve(undefined); - return commands.executeCommand(BuiltInCommands.Open, Uri.parse(url)); + return env.openExternal(Uri.parse(url)); } async copy(resource: RemoteResource): Promise<{} | undefined> { diff --git a/src/messages.ts b/src/messages.ts index 70804d1..3d07a60 100644 --- a/src/messages.ts +++ b/src/messages.ts @@ -1,8 +1,8 @@ 'use strict'; -import { commands, ConfigurationTarget, MessageItem, Uri, window } from 'vscode'; +import { commands, ConfigurationTarget, env, MessageItem, Uri, window } from 'vscode'; import { Commands } from './commands'; import { configuration, ViewLocation } from './configuration'; -import { BuiltInCommands, CommandContext, setCommandContext } from './constants'; +import { CommandContext, setCommandContext } from './constants'; import { GitCommit } from './git/gitService'; import { Logger } from './logger'; import { Versions } from './system'; @@ -129,7 +129,7 @@ export class Messages { if (uri !== undefined) { await setCommandContext(CommandContext.ViewsHideSupportGitLens, true); await this.suppressedMessage(SuppressedMessages.SupportGitLensNotification!); - await commands.executeCommand(BuiltInCommands.Open, uri); + await env.openExternal(uri); } } } @@ -182,16 +182,10 @@ export class Messages { await commands.executeCommand(Commands.ShowWelcomePage); } else if (result === actions[1]) { - await commands.executeCommand( - BuiltInCommands.Open, - Uri.parse('https://github.com/eamodio/vscode-gitlens/blob/master/CHANGELOG.md') - ); + await env.openExternal(Uri.parse('https://github.com/eamodio/vscode-gitlens/blob/master/CHANGELOG.md')); } else if (result === actions[2]) { - await commands.executeCommand( - BuiltInCommands.Open, - Uri.parse('https://gitlens.amod.io/#support-gitlens') - ); + await env.openExternal(Uri.parse('https://gitlens.amod.io/#support-gitlens')); } } }