diff --git a/README.md b/README.md index f18fd631..7f953679 100644 --- a/README.md +++ b/README.md @@ -120,7 +120,7 @@ |---|---|---| | `leetcode.hideSolved` | Specify to hide the solved problems or not | `false` | | `leetcode.showLocked` | Specify to show the locked problems or not. Only Premium users could open the locked problems | `false` | -| `leetcode.defaultLanguage` | Specify the default language used to solve the problem. Supported languages are: `bash`, `c`, `cpp`, `csharp`, `golang`, `java`, `javascript`, `kotlin`, `mysql`, `python`,`python3`,`ruby`,`scala`,`swift` | `N/A` | +| `leetcode.defaultLanguage` | Specify the default language used to solve the problem. Supported languages are: `bash`, `c`, `cpp`, `csharp`, `golang`, `java`, `javascript`, `kotlin`, `mysql`, `php`, `python`,`python3`,`ruby`,`rust`, `scala`,`swift` | `N/A` | | `leetcode.useWsl` | Specify whether to use WSL or not | `false` | | `leetcode.endpoint` | Specify the active endpoint. Supported endpoints are: `leetcode`, `leetcode-cn` | `leetcode` | | `leetcode.outputFolder`| Specify the relative path to save the problem files. Besides using customized path, there are also several reserved words which can be used here: | N/A | diff --git a/docs/README_zh-CN.md b/docs/README_zh-CN.md index fa01450e..b1e8cec5 100644 --- a/docs/README_zh-CN.md +++ b/docs/README_zh-CN.md @@ -120,7 +120,7 @@ |---|---|---| | `leetcode.hideSolved` | 指定是否要隐藏已解决的问题 | `false` | | `leetcode.showLocked` | 指定是否显示付费题目,只有付费账户才可以打开付费题目 | `false` | -| `leetcode.defaultLanguage` | 指定答题时使用的默认语言,可选语言有:`bash`, `c`, `cpp`, `csharp`, `golang`, `java`, `javascript`, `kotlin`, `mysql`, `python`,`python3`,`ruby`,`scala`,`swift` | `N/A` | +| `leetcode.defaultLanguage` | 指定答题时使用的默认语言,可选语言有:`bash`, `c`, `cpp`, `csharp`, `golang`, `java`, `javascript`, `kotlin`, `mysql`, `php`, `python`,`python3`,`ruby`, `rust`, `scala`,`swift` | `N/A` | | `leetcode.useWsl` | 指定是否启用 WSL | `false` | | `leetcode.endpoint` | 指定使用的终端,可用终端有:`leetcode`, `leetcode-cn` | `leetcode` | | `leetcode.outputFolder` | 指定保存文件时所用的相对文件夹路径。除了用户自定义路径外,也可以使用保留项,包括: | N/A | diff --git a/package-lock.json b/package-lock.json index 632f6f87..edf39d94 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1602,26 +1602,6 @@ "flush-write-stream": "^1.0.2" } }, - "leetcode-cli": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/leetcode-cli/-/leetcode-cli-2.6.1.tgz", - "integrity": "sha512-B3OXkxcsHUBnXoO2X5JOt2tDAEjMO+Mf3PxVJwgLhjdbK5XeR2GKDa6YcMuBv5fhJRzGUfQ+l6KEMQE6lRl8eg==", - "requires": { - "ansi-styles": "3.2.1", - "cheerio": "0.20.0", - "he": "1.2.0", - "mkdirp": "0.5.1", - "moment": "^2.20.1", - "nconf": "0.10.0", - "ora": "3.0.0", - "prompt": "1.0.0", - "request": "2.88.0", - "supports-color": "5.5.0", - "underscore": "1.9.1", - "wordwrap": "1.0.0", - "yargs": "12.0.4" - } - }, "levn": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", @@ -3011,6 +2991,26 @@ } } }, + "vsc-leetcode-cli": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/vsc-leetcode-cli/-/vsc-leetcode-cli-2.6.2.tgz", + "integrity": "sha512-tJC2Cj64MNdPnGP+ozju/uOq2qD8mJoPd4jFodA7fFXylrMKtG2JSNz9nZkKrU63iRgDyjRwljHvz5U5Et42fg==", + "requires": { + "ansi-styles": "3.2.1", + "cheerio": "0.20.0", + "he": "1.2.0", + "mkdirp": "0.5.1", + "moment": "^2.20.1", + "nconf": "0.10.0", + "ora": "3.0.0", + "prompt": "1.0.0", + "request": "2.88.0", + "supports-color": "5.5.0", + "underscore": "1.9.1", + "wordwrap": "1.0.0", + "yargs": "12.0.4" + } + }, "vscode": { "version": "1.1.30", "resolved": "https://registry.npmjs.org/vscode/-/vscode-1.1.30.tgz", diff --git a/package.json b/package.json index 0d5451c1..2d2494f5 100644 --- a/package.json +++ b/package.json @@ -283,7 +283,7 @@ }, "dependencies": { "fs-extra": "^6.0.1", - "leetcode-cli": "2.6.1", + "vsc-leetcode-cli": "2.6.2", "lodash.kebabcase": "^4.1.1", "require-from-string": "^2.0.2" } diff --git a/src/leetCodeExecutor.ts b/src/leetCodeExecutor.ts index 995c5ca3..373bda11 100644 --- a/src/leetCodeExecutor.ts +++ b/src/leetCodeExecutor.ts @@ -17,7 +17,7 @@ class LeetCodeExecutor { private leetCodeRootPathInWsl: string; constructor() { - this.leetCodeRootPath = path.join(__dirname, "..", "..", "node_modules", "leetcode-cli"); + this.leetCodeRootPath = path.join(__dirname, "..", "..", "node_modules", "vsc-leetcode-cli"); this.leetCodeRootPathInWsl = ""; } diff --git a/src/shared.ts b/src/shared.ts index 5c21e5ab..942e5ba1 100644 --- a/src/shared.ts +++ b/src/shared.ts @@ -22,9 +22,11 @@ export const languages: string[] = [ "javascript", "kotlin", "mysql", + "php", "python", "python3", "ruby", + "rust", "scala", "swift", ]; @@ -39,9 +41,11 @@ export const langExt: Map = new Map([ ["javascript", "js"], ["kotlin", "kt"], ["mysql", "sql"], + ["php", "php"], ["python", "py"], ["python3", "py"], ["ruby", "rb"], + ["rust", "rs"], ["scala", "scala"], ["swift", "swift"], ]);