diff --git a/README.md b/README.md index a46fe59c..ce36142a 100644 --- a/README.md +++ b/README.md @@ -127,7 +127,7 @@ | **(Deprecated)** `leetcode.enableShortcuts` | Specify whether the submit and test shortcuts in editor or not. | `true` | | `leetcode.editor.shortcuts` | Specify the customized shorcuts in editors. Supported values are: `submit`, `test`, `solution` and `description`. | `["submit, test"]` | | `leetcode.enableSideMode` | Specify whether `preview`, `solution` and `submission` tab should be grouped into the second editor column when solving a problem. | `true` | -| `leetcode.nodePath` | Specify the `Node.js` executable path. | `node` | +| `leetcode.nodePath` | Specify the `Node.js` executable path. for example, C:\Program Files\nodejs\node.exe | `node` | ## Want Help? diff --git a/docs/README_zh-CN.md b/docs/README_zh-CN.md index 6d90edb6..be328359 100644 --- a/docs/README_zh-CN.md +++ b/docs/README_zh-CN.md @@ -127,7 +127,7 @@ | **(Deprecated)** `leetcode.enableShortcuts` | 指定是否在 VS Code 编辑文件下方显示提交和测试的快捷按钮。 | `true` | | `leetcode.editor.shortcuts` | 指定在编辑器内所自定义的快捷方式。可用的快捷方式有: `submit`, `test`, `solution`, `description`。 | `["submit, test"]` | | `leetcode.enableSideMode` | 指定在解决一道题时,是否将`问题预览`、`高票答案`与`提交结果`窗口集中在编辑器的第二栏。 | `true` | -| `leetcode.nodePath` | 指定 `Node.js` 可执行文件的路径。 | `node` | +| `leetcode.nodePath` | 指定 `Node.js` 可执行文件的路径。如:C:\Program Files\nodejs\node.exe | `node` | ## 需要帮助? 在遇到任何问题时,可以先查看一下[疑难解答](https://github.com/jdneo/vscode-leetcode/wiki/%E7%96%91%E9%9A%BE%E8%A7%A3%E7%AD%94)以及[常见问题](https://github.com/jdneo/vscode-leetcode/wiki/%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98)寻求帮助。 diff --git a/package.json b/package.json index 5f90e490..5e0005b8 100644 --- a/package.json +++ b/package.json @@ -361,7 +361,7 @@ "type": "string", "default": "node", "scope": "application", - "description": "The Node.js executable path." + "description": "The Node.js executable path. for example, C:\\Program Files\\nodejs\\node.exe" } } } diff --git a/src/leetCodeExecutor.ts b/src/leetCodeExecutor.ts index c3ef495c..8bef00fa 100644 --- a/src/leetCodeExecutor.ts +++ b/src/leetCodeExecutor.ts @@ -49,6 +49,8 @@ class LeetCodeExecutor implements Disposable { if (!await fse.pathExists(this.nodeExecutable)) { throw new Error(`The Node.js executable does not exist on path ${this.nodeExecutable}`); } + // Wrap the executable with "" to avoid space issue in the path. + this.nodeExecutable = `"${this.nodeExecutable}"`; if (useWsl()) { this.nodeExecutable = await toWslPath(this.nodeExecutable); } diff --git a/src/utils/workspaceUtils.ts b/src/utils/workspaceUtils.ts index df7df0ad..b27a3ddf 100644 --- a/src/utils/workspaceUtils.ts +++ b/src/utils/workspaceUtils.ts @@ -64,7 +64,10 @@ export async function getActiveFilePath(uri?: vscode.Uri): Promise