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

Use vscode.open instead of the opn package#90

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
jdneo merged 3 commits intomasterfromcs/vscode-open
Jan 13, 2019
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletionspackage-lock.json
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

3 changes: 1 addition & 2 deletionspackage.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -258,7 +258,6 @@
},
"dependencies": {
"fs-extra": "^6.0.1",
"leetcode-cli": "2.6.1",
"opn": "^5.2.0"
"leetcode-cli": "2.6.1"
}
}
5 changes: 2 additions & 3 deletionssrc/leetCodeExecutor.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,11 +2,10 @@
// Licensed under the MIT license.

import * as cp from "child_process";
import * as opn from "opn";
import * as path from "path";
import * as vscode from "vscode";
import { executeCommand, executeCommandWithProgress } from "./utils/cpUtils";
import { DialogOptions } from "./utils/uiUtils";
import { DialogOptions, openUrl } from "./utils/uiUtils";
import * as wsl from "./utils/wslUtils";

class LeetCodeExecutor {
Expand DownExpand Up@@ -38,7 +37,7 @@ class LeetCodeExecutor {
DialogOptions.open,
);
if (choice === DialogOptions.open) {
opn("https://nodejs.org");
openUrl("https://nodejs.org");
}
return false;
}
Expand Down
9 changes: 6 additions & 3 deletionssrc/utils/uiUtils.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
// Copyright (c) jdneo. All rights reserved.
// Licensed under the MIT license.

import * as opn from "opn";
import * as vscode from "vscode";
import { isLeetCodeCnEnabled } from "../commands/plugin";
import { leetCodeChannel } from "../leetCodeChannel";
Expand DownExpand Up@@ -48,9 +47,9 @@ export async function promptForSignIn(): Promise<void> {
break;
case DialogOptions.singUp:
if (isLeetCodeCnEnabled()) {
opn("https://leetcode-cn.com");
openUrl("https://leetcode-cn.com");
} else {
opn("https://leetcode.com");
openUrl("https://leetcode.com");
}
break;
default:
Expand All@@ -70,6 +69,10 @@ export async function showFileSelectDialog(): Promise<vscode.Uri[] | undefined>
return await vscode.window.showOpenDialog(options);
}

export async function openUrl(url: string): Promise<void> {
vscode.commands.executeCommand("vscode.open", vscode.Uri.parse(url));
}

export enum DialogType {
info = "info",
warning = "warning",
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp