Browse Source

Replaces open command with env.openExternal

main
Eric Amodio 5 years ago
parent
commit
8c6690d59e
5 changed files with 14 additions and 23 deletions
  1. +1
    -1
      package.json
  2. +3
    -4
      src/commands/diffDirectory.ts
  3. +3
    -4
      src/commands/externalDiff.ts
  4. +2
    -3
      src/git/remotes/provider.ts
  5. +5
    -11
      src/messages.ts

+ 1
- 1
package.json View File

@ -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",

+ 3
- 4
src/commands/diffDirectory.ts View File

@ -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')
);
}

+ 3
- 4
src/commands/externalDiff.ts View File

@ -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')
);
}

+ 2
- 3
src/git/remotes/provider.ts View File

@ -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> {

+ 5
- 11
src/messages.ts View File

@ -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'));
}
}
}

Loading…
Cancel
Save