Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit424ba0c

Browse files
authored
Use vscode.open instead of the opn package (LeetCode-OpenSource#90)
1 parente257c76 commit424ba0c

File tree

4 files changed

+9
-21
lines changed

4 files changed

+9
-21
lines changed

‎package-lock.json

Lines changed: 0 additions & 13 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,6 @@
258258
},
259259
"dependencies": {
260260
"fs-extra":"^6.0.1",
261-
"leetcode-cli":"2.6.1",
262-
"opn":"^5.2.0"
261+
"leetcode-cli":"2.6.1"
263262
}
264263
}

‎src/leetCodeExecutor.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
// Licensed under the MIT license.
33

44
import*ascpfrom"child_process";
5-
import*asopnfrom"opn";
65
import*aspathfrom"path";
76
import*asvscodefrom"vscode";
87
import{executeCommand,executeCommandWithProgress}from"./utils/cpUtils";
9-
import{DialogOptions}from"./utils/uiUtils";
8+
import{DialogOptions,openUrl}from"./utils/uiUtils";
109
import*aswslfrom"./utils/wslUtils";
1110

1211
classLeetCodeExecutor{
@@ -38,7 +37,7 @@ class LeetCodeExecutor {
3837
DialogOptions.open,
3938
);
4039
if(choice===DialogOptions.open){
41-
opn("https://nodejs.org");
40+
openUrl("https://nodejs.org");
4241
}
4342
returnfalse;
4443
}

‎src/utils/uiUtils.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright (c) jdneo. All rights reserved.
22
// Licensed under the MIT license.
33

4-
import*asopnfrom"opn";
54
import*asvscodefrom"vscode";
65
import{isLeetCodeCnEnabled}from"../commands/plugin";
76
import{leetCodeChannel}from"../leetCodeChannel";
@@ -48,9 +47,9 @@ export async function promptForSignIn(): Promise<void> {
4847
break;
4948
caseDialogOptions.singUp:
5049
if(isLeetCodeCnEnabled()){
51-
opn("https://leetcode-cn.com");
50+
openUrl("https://leetcode-cn.com");
5251
}else{
53-
opn("https://leetcode.com");
52+
openUrl("https://leetcode.com");
5453
}
5554
break;
5655
default:
@@ -70,6 +69,10 @@ export async function showFileSelectDialog(): Promise<vscode.Uri[] | undefined>
7069
returnawaitvscode.window.showOpenDialog(options);
7170
}
7271

72+
exportasyncfunctionopenUrl(url:string):Promise<void>{
73+
vscode.commands.executeCommand("vscode.open",vscode.Uri.parse(url));
74+
}
75+
7376
exportenumDialogType{
7477
info="info",
7578
warning="warning",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp