Skip to content

Commit 8c6690d

Browse files
committed
Replaces open command with env.openExternal
1 parent d19c137 commit 8c6690d

File tree

5 files changed

+14
-23
lines changed

5 files changed

+14
-23
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"url": "https://github.com/eamodio/vscode-gitlens.git"
1919
},
2020
"engines": {
21-
"vscode": "^1.30.0"
21+
"vscode": "^1.31.0"
2222
},
2323
"main": "./dist/extension",
2424
"icon": "images/gitlens-icon.png",

src/commands/diffDirectory.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
2-
import { commands, TextEditor, Uri, window } from 'vscode';
3-
import { BuiltInCommands, GlyphChars } from '../constants';
2+
import { env, TextEditor, Uri, window } from 'vscode';
3+
import { GlyphChars } from '../constants';
44
import { Container } from '../container';
55
import { Logger } from '../logger';
66
import { Messages } from '../messages';
@@ -95,8 +95,7 @@ export class DiffDirectoryCommand extends ActiveEditorCommand {
9595
);
9696
if (!result) return undefined;
9797

98-
return commands.executeCommand(
99-
BuiltInCommands.Open,
98+
return env.openExternal(
10099
Uri.parse('https://git-scm.com/docs/git-config#Documentation/git-config.txt-difftool')
101100
);
102101
}

src/commands/externalDiff.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
2-
import { commands, SourceControlResourceState, Uri, window } from 'vscode';
3-
import { BuiltInCommands, GlyphChars } from '../constants';
2+
import { env, SourceControlResourceState, Uri, window } from 'vscode';
3+
import { GlyphChars } from '../constants';
44
import { Container } from '../container';
55
import { GitService, GitUri } from '../git/gitService';
66
import { Logger } from '../logger';
@@ -195,8 +195,7 @@ export class ExternalDiffCommand extends Command {
195195
);
196196
if (!result) return undefined;
197197

198-
return commands.executeCommand(
199-
BuiltInCommands.Open,
198+
return env.openExternal(
200199
Uri.parse('https://git-scm.com/docs/git-config#Documentation/git-config.txt-difftool')
201200
);
202201
}

src/git/remotes/provider.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
'use strict';
2-
import { commands, env, Range, Uri, window } from 'vscode';
3-
import { BuiltInCommands } from '../../constants';
2+
import { env, Range, Uri, window } from 'vscode';
43
import { Logger } from '../../logger';
54
import { Messages } from '../../messages';
65
import { GitLogCommit } from '../models/logCommit';
@@ -115,7 +114,7 @@ export abstract class RemoteProvider {
115114
private openUrl(url?: string): Thenable<{} | undefined> {
116115
if (url === undefined) return Promise.resolve(undefined);
117116

118-
return commands.executeCommand(BuiltInCommands.Open, Uri.parse(url));
117+
return env.openExternal(Uri.parse(url));
119118
}
120119

121120
async copy(resource: RemoteResource): Promise<{} | undefined> {

src/messages.ts

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
'use strict';
2-
import { commands, ConfigurationTarget, MessageItem, Uri, window } from 'vscode';
2+
import { commands, ConfigurationTarget, env, MessageItem, Uri, window } from 'vscode';
33
import { Commands } from './commands';
44
import { configuration, ViewLocation } from './configuration';
5-
import { BuiltInCommands, CommandContext, setCommandContext } from './constants';
5+
import { CommandContext, setCommandContext } from './constants';
66
import { GitCommit } from './git/gitService';
77
import { Logger } from './logger';
88
import { Versions } from './system';
@@ -129,7 +129,7 @@ export class Messages {
129129
if (uri !== undefined) {
130130
await setCommandContext(CommandContext.ViewsHideSupportGitLens, true);
131131
await this.suppressedMessage(SuppressedMessages.SupportGitLensNotification!);
132-
await commands.executeCommand(BuiltInCommands.Open, uri);
132+
await env.openExternal(uri);
133133
}
134134
}
135135
}
@@ -182,16 +182,10 @@ export class Messages {
182182
await commands.executeCommand(Commands.ShowWelcomePage);
183183
}
184184
else if (result === actions[1]) {
185-
await commands.executeCommand(
186-
BuiltInCommands.Open,
187-
Uri.parse('https://github.com/eamodio/vscode-gitlens/blob/master/CHANGELOG.md')
188-
);
185+
await env.openExternal(Uri.parse('https://github.com/eamodio/vscode-gitlens/blob/master/CHANGELOG.md'));
189186
}
190187
else if (result === actions[2]) {
191-
await commands.executeCommand(
192-
BuiltInCommands.Open,
193-
Uri.parse('https://gitlens.amod.io/#support-gitlens')
194-
);
188+
await env.openExternal(Uri.parse('https://gitlens.amod.io/#support-gitlens'));
195189
}
196190
}
197191
}

0 commit comments

Comments
 (0)