diff --git a/CHANGELOG.md b/CHANGELOG.md index ffc9f01e..e8839e7a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to the "leetcode" extension will be documented in this file. Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. +## [0.15.0] +### Added +- Auto refresh the explorer after submitting [#91](https://github.com/jdneo/vscode-leetcode/issues/91) +- Add a editor shortcut `Description` to show the problem description [#286](https://github.com/jdneo/vscode-leetcode/issues/286) +- Support customizing the shortcuts in editor [#335](https://github.com/jdneo/vscode-leetcode/issues/335) + +### Fixed +[Bugs fixed](https://github.com/jdneo/vscode-leetcode/issues?q=is%3Aissue+milestone%3A0.15.0+is%3Aclosed+label%3Abug) + ## [0.14.3] ### Added - Support interpolation for `leetcode.outputFolder` settings [#151](https://github.com/jdneo/vscode-leetcode/issues/151) diff --git a/README.md b/README.md index 64f62c19..5fcf3138 100644 --- a/README.md +++ b/README.md @@ -81,37 +81,18 @@ --- -### Show Top Voted Solution +### Editor Shortcuts

- Show Top Voted Solution + Editor Shortcuts

-- Select `Show Top Voted Solution` will display the top voted solution for you. +- The extension supports 4 editor shortcuts (aka Code Lens): + - `Submit`: Submit your answer to LeetCode. + - `Test`: Test your answer with customized test cases. + - `Solution`: Show the top voted solution for the current problem. + - `Description`: Show the problem description page. ---- - -### Submit the Answer -

- Submit the Answer -

- -- You can submit the answer by clicking `Submit` at the bottom of the file. Or you can right click in the editor and select `Submit to LeetCode`. - -> If you want to hide the shortcuts showing in the editor, just simply set the setting `leetcode.enableShortcuts` to false. - ---- - -### Test the Answer -

- Test the Answer -

- -- You can test the answer by clicking `Test` at the bottom of the file. Or you can right click in the editor and select `Test in LeetCode`. - -- There are 3 ways to test the answer: - - **Test with the default cases** - - **Write test cases in input box** - - **Test with the written cases in file** + > Note: You can customize the shortcuts using the setting: `leetcode.editor.shortcuts`. By default, only `Submit` and `Test` shortcuts are enabled. --- @@ -142,7 +123,8 @@ | `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: For example: `problem-${tag}-${difficulty}` | N/A | | `leetcode.enableStatusBar` | Specify whether the LeetCode status bar will be shown or not. | `true` | -| `leetcode.enableShortcuts` | Specify whether the submit and test shortcuts in editor or not. | `true` | +| **(Deprecated)** `leetcode.enableShortcuts` | Specify whether the submit and test shortcuts in editor or not. | `true` | +| `leetcode.editor.shortcuts` | Specify the customized shorcuts in editors | `["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` | diff --git a/docs/README_zh-CN.md b/docs/README_zh-CN.md index 39ae2683..0bd9d54d 100644 --- a/docs/README_zh-CN.md +++ b/docs/README_zh-CN.md @@ -81,37 +81,18 @@ --- -### 查看高票解答 +### 编辑器快捷方式

- 高票解答 + Editor Shortcuts

-- 选择 `Show Top Voted Solution` 可查看该题目在讨论区内的高票解答。 +- 插件会在编辑区域内支持四种不同的快捷方式(Code Lens): + - `Submit`: 提交你的答案至 LeetCode; + - `Test`: 用给定的测试用例测试你的答案; + - `Solution`: 显示该问题的高票解答; + - `Description`: 显示该问题的题目描述。 ---- - -### 提交答案 -

- 提交答案 -

- -- 通过点击文件最下方的 `Submit` 可提交答案。 你也可以在编辑区内右键并选择 `Submit to LeetCode`,将**当前**文件提交。 - -> 如果你不希望在编辑器中显示**测试**和**提交**的快捷方式,可以将配置项 `leetcode.enableShortcuts` 设置为 `false`。 - ---- - -### 测试答案 -

- 测试答案 -

- -- 通过点击文件最下方的 `Test` 可测试答案。你也可以在编辑区内右键并选择 `Test in LeetCode`,对**当前**文件进行测试。 - -- 有下列三种测试集来源: - - **默认测试集**:Test with the default cases - - **在输入框内输入测试集**:Write test cases in input box - - **提供自定义测试集文件**:Test with the written cases in file + > 注意:你可以通过 `leetcode.editor.shortcuts` 配置项来定制需要激活的快捷方式。默认情况下只有 `Submit` 和 `Test` 会被激活。 --- @@ -142,7 +123,8 @@ | `leetcode.endpoint` | 指定使用的终端,可用终端有:`leetcode`, `leetcode-cn` | `leetcode` | | `leetcode.outputFolder` | 指定保存文件时所用的相对文件夹路径。除了用户自定义路径外,也可以使用保留项,包括:例如:`problem-${tag}-${difficulty}` | N/A | | `leetcode.enableStatusBar` | 指定是否在 VS Code 下方显示插件状态栏。 | `true` | -| `leetcode.enableShortcuts` | 指定是否在 VS Code 编辑文件下方显示提交和测试的快捷按钮。 | `true` | +| **(Deprecated)** `leetcode.enableShortcuts` | 指定是否在 VS Code 编辑文件下方显示提交和测试的快捷按钮。 | `true` | +| `leetcode.editor.shortcuts` | 指定在编辑器内所自定义的快捷方式。 | `["submit, test"]` | | `leetcode.enableSideMode` | 指定在解决一道题时,是否将`问题预览`、`高票答案`与`提交结果`窗口集中在编辑器的第二栏。 | `true` | | `leetcode.nodePath` | 指定 `Node.js` 可执行文件的路径。 | `node` | diff --git a/docs/imgs/shortcuts.png b/docs/imgs/shortcuts.png new file mode 100644 index 00000000..c949989d Binary files /dev/null and b/docs/imgs/shortcuts.png differ diff --git a/docs/imgs/solution.png b/docs/imgs/solution.png deleted file mode 100644 index 526d3f66..00000000 Binary files a/docs/imgs/solution.png and /dev/null differ diff --git a/docs/imgs/submit.png b/docs/imgs/submit.png deleted file mode 100644 index 9c81a760..00000000 Binary files a/docs/imgs/submit.png and /dev/null differ diff --git a/docs/imgs/test.png b/docs/imgs/test.png deleted file mode 100644 index b90feab8..00000000 Binary files a/docs/imgs/test.png and /dev/null differ diff --git a/package-lock.json b/package-lock.json index 7ea3a73c..f6c87e2d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "vscode-leetcode", - "version": "0.14.3", + "version": "0.15.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -66,13 +66,13 @@ }, "acorn": { "version": "2.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-2.7.0.tgz", + "resolved": "http://registry.npmjs.org/acorn/-/acorn-2.7.0.tgz", "integrity": "sha1-q259nYhqrKiwhbwzEreaGYQz8Oc=", "optional": true }, "acorn-globals": { "version": "1.0.9", - "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-1.0.9.tgz", + "resolved": "http://registry.npmjs.org/acorn-globals/-/acorn-globals-1.0.9.tgz", "integrity": "sha1-VbtemGkVB7dFedBRNBMhfDgMVM8=", "optional": true, "requires": { @@ -135,7 +135,7 @@ }, "async": { "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "resolved": "http://registry.npmjs.org/async/-/async-1.5.2.tgz", "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" }, "asynckit": { @@ -258,7 +258,7 @@ }, "cheerio": { "version": "0.20.0", - "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-0.20.0.tgz", + "resolved": "http://registry.npmjs.org/cheerio/-/cheerio-0.20.0.tgz", "integrity": "sha1-XHEPK6uVZTJyhCugHG6mGzVF7DU=", "requires": { "css-select": "~1.2.0", @@ -358,7 +358,7 @@ }, "css-select": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz", + "resolved": "http://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz", "integrity": "sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=", "requires": { "boolbase": "~1.0.0", @@ -715,7 +715,7 @@ }, "htmlparser2": { "version": "3.8.3", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz", + "resolved": "http://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz", "integrity": "sha1-mWwosZFRaovoZQGn15dX5ccMEGg=", "requires": { "domelementtype": "1", @@ -727,7 +727,7 @@ "dependencies": { "entities": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz", + "resolved": "http://registry.npmjs.org/entities/-/entities-1.0.0.tgz", "integrity": "sha1-sph6o4ITR/zeZCsk/fyeT7cSvyY=" } } @@ -855,7 +855,7 @@ }, "jsdom": { "version": "7.2.2", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-7.2.2.tgz", + "resolved": "http://registry.npmjs.org/jsdom/-/jsdom-7.2.2.tgz", "integrity": "sha1-QLQCdwwr2iNGkJa+6Rq2deOx/G4=", "optional": true, "requires": { @@ -1135,7 +1135,7 @@ "dependencies": { "yargs": { "version": "3.32.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.32.0.tgz", + "resolved": "http://registry.npmjs.org/yargs/-/yargs-3.32.0.tgz", "integrity": "sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU=", "requires": { "camelcase": "^2.0.1", @@ -1151,7 +1151,7 @@ }, "ncp": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ncp/-/ncp-1.0.1.tgz", + "resolved": "http://registry.npmjs.org/ncp/-/ncp-1.0.1.tgz", "integrity": "sha1-0VNn5cuHQyuhF9K/gP30Wuz7QkY=" }, "nice-try": { @@ -1251,7 +1251,7 @@ }, "os-locale": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "resolved": "http://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", "requires": { "lcid": "^1.0.0" @@ -1389,7 +1389,7 @@ }, "readable-stream": { "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", "requires": { "core-util-is": "~1.0.0", @@ -1613,7 +1613,7 @@ }, "strip-eof": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "resolved": "http://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" }, "supports-color": { @@ -1765,7 +1765,7 @@ "dependencies": { "async": { "version": "0.9.2", - "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", + "resolved": "http://registry.npmjs.org/async/-/async-0.9.2.tgz", "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=" } } @@ -1873,7 +1873,7 @@ }, "winston": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/winston/-/winston-2.1.1.tgz", + "resolved": "http://registry.npmjs.org/winston/-/winston-2.1.1.tgz", "integrity": "sha1-PJNJ0ZYgf9G9/51LxD73JRDjoS4=", "requires": { "async": "~1.0.0", @@ -1887,12 +1887,12 @@ "dependencies": { "async": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/async/-/async-1.0.0.tgz", + "resolved": "http://registry.npmjs.org/async/-/async-1.0.0.tgz", "integrity": "sha1-+PwEyjoTeErenhZBr5hXjPvWR6k=" }, "colors": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", + "resolved": "http://registry.npmjs.org/colors/-/colors-1.0.3.tgz", "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=" }, "pkginfo": { @@ -1909,7 +1909,7 @@ }, "wrap-ansi": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "resolved": "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", "requires": { "string-width": "^1.0.1", diff --git a/package.json b/package.json index d8187565..607dc824 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "vscode-leetcode", "displayName": "LeetCode", "description": "Solve LeetCode problems in VS Code", - "version": "0.14.3", + "version": "0.15.0", "author": "Sheng Chen", "publisher": "shengchen", "license": "MIT", @@ -349,7 +349,7 @@ "description" ] }, - "description": "Customize the shorcuts in editor." + "description": "Customize the shorcuts in editors." }, "leetcode.enableSideMode": { "type": "boolean",