Skip to content

Commit 13c3324

Browse files
committed
update domain
2 parents d713ad5 + d298470 commit 13c3324

File tree

8 files changed

+158
-21
lines changed

8 files changed

+158
-21
lines changed

package-lock.json

+138-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"name": "vscode-leetcode",
3-
"displayName": "LeetCode",
2+
"name": "self-leetcode",
3+
"displayName": "Self-LeetCode",
44
"description": "Solve LeetCode problems in VS Code",
5-
"version": "0.18.1",
5+
"version": "0.18.3",
66
"author": "Sheng Chen",
77
"publisher": "LeetCode",
88
"license": "MIT",
@@ -41,7 +41,7 @@
4141
"onCommand:leetcode.problems.sort",
4242
"onView:leetCodeExplorer"
4343
],
44-
"main": "./out/src/extension",
44+
"main": "./out/src/extension.js",
4545
"contributes": {
4646
"commands": [
4747
{
@@ -729,6 +729,7 @@
729729
"markdown-it": "^8.4.2",
730730
"require-from-string": "^2.0.2",
731731
"unescape-js": "^1.1.4",
732-
"vsc-leetcode-cli": "2.8.1"
732+
"vsc-leetcode-cli": "2.8.1",
733+
"@haozibi/vsc-leetcode-cli": "2.8.3"
733734
}
734735
}

resources/LeetCode.png

7.82 KB
Loading

resources/LeetCode.svg

+1-9
Loading

resources/bak/LeetCode.png

6.87 KB
Loading

resources/bak/LeetCode.svg

+9
Loading

src/commands/list.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export async function listProblems(): Promise<IProblem[]> {
1919
const result: string = await leetCodeExecutor.listProblems(showLocked, useEndpointTranslation);
2020
const problems: IProblem[] = [];
2121
const lines: string[] = result.split("\n");
22-
const reg: RegExp = /^(.)\s(.{1,2})\s(.)\s\[\s*(\d*)\s*\]\s*(.*)\s*(Easy|Medium|Hard)\s*\((\s*\d+\.\d+ %)\)/;
22+
const reg: RegExp = /^(.)\s(.{1,2})\s(.)\s\[\s*(.*)\s*\]\s*(.*)\s*(Easy|Medium|Hard)\s*\((\s*\d+\.\d+ %)\)/;
2323
const { companies, tags } = await leetCodeExecutor.getCompaniesAndTags();
2424
for (const line of lines) {
2525
const match: RegExpMatchArray | null = line.match(reg);

src/leetCodeExecutor.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class LeetCodeExecutor implements Disposable {
2020
private configurationChangeListener: Disposable;
2121

2222
constructor() {
23-
this.leetCodeRootPath = path.join(__dirname, "..", "..", "node_modules", "vsc-leetcode-cli");
23+
this.leetCodeRootPath = path.join(__dirname, "..", "..", "node_modules", "@haozibi", "vsc-leetcode-cli");
2424
this.nodeExecutable = this.getNodePath();
2525
this.configurationChangeListener = workspace.onDidChangeConfiguration((event: ConfigurationChangeEvent) => {
2626
if (event.affectsConfiguration("leetcode.nodePath")) {
@@ -102,7 +102,7 @@ class LeetCodeExecutor implements Disposable {
102102

103103
public async showProblem(problemNode: IProblem, language: string, filePath: string, showDescriptionInComment: boolean = false, needTranslation: boolean): Promise<void> {
104104
const templateType: string = showDescriptionInComment ? "-cx" : "-c";
105-
const cmd: string[] = [await this.getLeetCodeBinaryPath(), "show", problemNode.id, templateType, "-l", language];
105+
const cmd: string[] = [await this.getLeetCodeBinaryPath(), "show", "'" + problemNode.id + "'", templateType, "-l", language];
106106

107107
if (!needTranslation) {
108108
cmd.push("-T"); // use -T to force English version
@@ -139,7 +139,7 @@ class LeetCodeExecutor implements Disposable {
139139
}
140140

141141
public async getDescription(problemNodeId: string, needTranslation: boolean): Promise<string> {
142-
const cmd: string[] = [await this.getLeetCodeBinaryPath(), "show", problemNodeId, "-x"];
142+
const cmd: string[] = [await this.getLeetCodeBinaryPath(), "show", "'" + problemNodeId + "'", "-x"];
143143
if (!needTranslation) {
144144
cmd.push("-T");
145145
}

0 commit comments

Comments
 (0)