diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md index 6253f0a4..c697e09a 100644 --- a/.github/ISSUE_TEMPLATE/question.md +++ b/.github/ISSUE_TEMPLATE/question.md @@ -3,11 +3,11 @@ name: 💬 Questions / Help about: If you have questions, please check our documents first --- -Before you submit an question we recommend you to check out the [DOCUMENT](https://github.com/jdneo/vscode-leetcode/blob/master/README.md) first. +Before you submit an question we recommend you to check out the [DOCUMENT](https://github.com/LeetCode-OpenSource/vscode-leetcode/blob/master/README.md) first. You can also find more information in: -- [TROUBLESHOOTING](https://github.com/jdneo/vscode-leetcode/wiki/Troubleshooting) -- [FAQ](https://github.com/jdneo/vscode-leetcode/wiki/FAQ) +- [TROUBLESHOOTING](https://github.com/LeetCode-OpenSource/vscode-leetcode/wiki/Troubleshooting) +- [FAQ](https://github.com/LeetCode-OpenSource/vscode-leetcode/wiki/FAQ) ## 💬 Questions and Help diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..1df11a00 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,71 @@ +name: CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + linux: + name: Linux + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v2 + + - name: Setup Node.js environment + uses: actions/setup-node@v2 + with: + node-version: 12 + + - name: Install Node.js modules + run: npm install + + - name: Lint + run: npm run lint + + - name: VSCE Packge + run: npx vsce package + + windows: + name: Windows + runs-on: windows-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v2 + + - name: Setup Node.js environment + uses: actions/setup-node@v2 + with: + node-version: 12 + + - name: Install Node.js modules + run: npm install + + - name: Lint + run: npm run lint + + - name: VSCE Packge + run: npx vsce package + + darwin: + name: macOS + runs-on: macos-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v2 + + - name: Setup Node.js environment + uses: actions/setup-node@v2 + with: + node-version: 12 + + - name: Install Node.js modules + run: npm install + + - name: Lint + run: npm run lint + + - name: VSCE Packge + run: npx vsce package diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6bbae841..00000000 --- a/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -language: node_js - -node_js: - - 'lts/*' - -before_install: - - if [ $TRAVIS_OS_NAME == "linux" ]; then - export CXX="g++-4.9" CC="gcc-4.9" DISPLAY=:99.0; - sh -e /etc/init.d/xvfb start; - sleep 3; - fi - -install: - - npm install -g vsce - - npm install - -script: - - npm run lint - - vsce package diff --git a/.vscodeignore b/.vscodeignore index 8cdceec0..7a04907d 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -5,7 +5,6 @@ test/** src/** **/*.map .gitignore -.travis.yml package-lock.json tsconfig.json tslint.json diff --git a/ACKNOWLEDGEMENTS.md b/ACKNOWLEDGEMENTS.md index 8f9ea9ce..6c7758be 100644 --- a/ACKNOWLEDGEMENTS.md +++ b/ACKNOWLEDGEMENTS.md @@ -3,22 +3,22 @@ A big thanks to the following individuals for contributing: - [@JIEJIAN21](https://github.com/JIEJIAN21) - thanks for logo and icon design -- [@TsFreddie](https://github.com/TsFreddie) — [contributions](https://github.com/jdneo/vscode-leetcode/commits?author=TsFreddie) -- [@ntt2k](https://github.com/ntt2k) — [contributions](https://github.com/jdneo/vscode-leetcode/commits?author=ntt2k) -- [@purocean](https://github.com/purocean) — [contributions](https://github.com/jdneo/vscode-leetcode/commits?author=purocean) -- [@Xeonacid](https://github.com/Xeonacid) — [contributions](https://github.com/jdneo/vscode-leetcode/commits?author=Xeonacid) -- [@Himself65](https://github.com/Himself65) — [contributions](https://github.com/jdneo/vscode-leetcode/commits?author=Himself65) -- [@Vigilans](https://github.com/Vigilans) — [contributions](https://github.com/jdneo/vscode-leetcode/commits?author=Vigilans) -- [@ringcrl](https://github.com/ringcrl) — [contributions](https://github.com/jdneo/vscode-leetcode/commits?author=ringcrl) -- [@pujiaxun](https://github.com/pujiaxun) — [contributions](https://github.com/jdneo/vscode-leetcode/commits?author=pujiaxun) -- [@edvardchen](https://github.com/edvardchen) — [contributions](https://github.com/jdneo/vscode-leetcode/commits?author=edvardchen) -- [@poppinlp](https://github.com/poppinlp) — [contributions](https://github.com/jdneo/vscode-leetcode/commits?author=poppinlp) -- [@xuzaixian](https://github.com/xuzaixian) — [contributions](https://github.com/jdneo/vscode-leetcode/commits?author=xuzaixian) -- [@ZainChen](https://github.com/ZainChen) — [contributions](https://github.com/jdneo/vscode-leetcode/commits?author=ZainChen) -- [@houtianze](https://github.com/houtianze) — [contributions](https://github.com/jdneo/vscode-leetcode/commits?author=houtianze) -- [@magic-akari](https://github.com/magic-akari) - [contributions](https://github.com/jdneo/vscode-leetcode/commits?author=magic-akari) -- [@SF-Zhou](https://github.com/SF-Zhou) - [contributions](https://github.com/jdneo/vscode-leetcode/commits?author=SF-Zhou) -- [@fuafa](https://github.com/fuafa) - [contributions](https://github.com/jdneo/vscode-leetcode/commits?author=fuafa) -- [@iFun](https://github.com/iFun) - [contributions](https://github.com/jdneo/vscode-leetcode/commits?author=iFun) -- [@hologerry](https://github.com/hologerry) - [contributions](https://github.com/jdneo/vscode-leetcode/commits?author=hologerry) -- [@yihong0618](https://github.com/yihong0618) - [contributions](https://github.com/jdneo/vscode-leetcode/commits?author=yihong0618) +- [@TsFreddie](https://github.com/TsFreddie) — [contributions](https://github.com/LeetCode-OpenSource/vscode-leetcode/commits?author=TsFreddie) +- [@ntt2k](https://github.com/ntt2k) — [contributions](https://github.com/LeetCode-OpenSource/vscode-leetcode/commits?author=ntt2k) +- [@purocean](https://github.com/purocean) — [contributions](https://github.com/LeetCode-OpenSource/vscode-leetcode/commits?author=purocean) +- [@Xeonacid](https://github.com/Xeonacid) — [contributions](https://github.com/LeetCode-OpenSource/vscode-leetcode/commits?author=Xeonacid) +- [@Himself65](https://github.com/Himself65) — [contributions](https://github.com/LeetCode-OpenSource/vscode-leetcode/commits?author=Himself65) +- [@Vigilans](https://github.com/Vigilans) — [contributions](https://github.com/LeetCode-OpenSource/vscode-leetcode/commits?author=Vigilans) +- [@ringcrl](https://github.com/ringcrl) — [contributions](https://github.com/LeetCode-OpenSource/vscode-leetcode/commits?author=ringcrl) +- [@pujiaxun](https://github.com/pujiaxun) — [contributions](https://github.com/LeetCode-OpenSource/vscode-leetcode/commits?author=pujiaxun) +- [@edvardchen](https://github.com/edvardchen) — [contributions](https://github.com/LeetCode-OpenSource/vscode-leetcode/commits?author=edvardchen) +- [@poppinlp](https://github.com/poppinlp) — [contributions](https://github.com/LeetCode-OpenSource/vscode-leetcode/commits?author=poppinlp) +- [@xuzaixian](https://github.com/xuzaixian) — [contributions](https://github.com/LeetCode-OpenSource/vscode-leetcode/commits?author=xuzaixian) +- [@ZainChen](https://github.com/ZainChen) — [contributions](https://github.com/LeetCode-OpenSource/vscode-leetcode/commits?author=ZainChen) +- [@houtianze](https://github.com/houtianze) — [contributions](https://github.com/LeetCode-OpenSource/vscode-leetcode/commits?author=houtianze) +- [@magic-akari](https://github.com/magic-akari) - [contributions](https://github.com/LeetCode-OpenSource/vscode-leetcode/commits?author=magic-akari) +- [@SF-Zhou](https://github.com/SF-Zhou) - [contributions](https://github.com/LeetCode-OpenSource/vscode-leetcode/commits?author=SF-Zhou) +- [@fuafa](https://github.com/fuafa) - [contributions](https://github.com/LeetCode-OpenSource/vscode-leetcode/commits?author=fuafa) +- [@iFun](https://github.com/iFun) - [contributions](https://github.com/LeetCode-OpenSource/vscode-leetcode/commits?author=iFun) +- [@hologerry](https://github.com/hologerry) - [contributions](https://github.com/LeetCode-OpenSource/vscode-leetcode/commits?author=hologerry) +- [@yihong0618](https://github.com/yihong0618) - [contributions](https://github.com/LeetCode-OpenSource/vscode-leetcode/commits?author=yihong0618) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb9c73be..0de174fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,111 +3,138 @@ 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.18.0] +### Added +- Add `star` command in shortcuts [PR#601](https://github.com/LeetCode-OpenSource/vscode-leetcode/pull/601) +- Add an option to disable endpoint translation [#389](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/389) + +### Changed +- LeetCode actions are moved into sub-menu: `LeetCode` in the editor context menu. [PR#712](https://github.com/LeetCode-OpenSource/vscode-leetcode/pull/712) + +### Fixed +[Bugs fixed](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues?q=is%3Aissue+milestone%3A0.18.0+is%3Aclosed+label%3Abug) + +## [0.17.0] +### Added +- Add TypeScript support [#560](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/560) + +### Changed +- Update the UI resources [PR#561](https://github.com/LeetCode-OpenSource/vscode-leetcode/pull/561) + +## [0.16.2] +### Added +- New Category: `Concurrency` [CLI#42](https://github.com/leetcode-tools/leetcode-cli/pull/42) +- New configuration to better configure how to show the description [#310](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/310) + +### Removed +- Removed the deprecated setting `leetcode.enableShortcuts` [PR#520](https://github.com/LeetCode-OpenSource/vscode-leetcode/pull/520) +- Removed the deprecated setting `leetcode.outputFolder` [PR#521](https://github.com/LeetCode-OpenSource/vscode-leetcode/pull/521) + ## [0.16.1] ### Added -- Can show the problem in current workspace even if it's not a LeetCode workspace [#373](https://github.com/jdneo/vscode-leetcode/issues/373) +- Can show the problem in current workspace even if it's not a LeetCode workspace [#373](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/373) ### Fixed -[Bugs fixed](https://github.com/jdneo/vscode-leetcode/issues?q=is%3Aissue+milestone%3A0.16.1+is%3Aclosed+label%3Abug) +[Bugs fixed](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues?q=is%3Aissue+milestone%3A0.16.1+is%3Aclosed+label%3Abug) ## [0.16.0] ### Added -- Support GitHub login and LinkedIn login [PR#496](https://github.com/jdneo/vscode-leetcode/pull/496) +- Support GitHub login and LinkedIn login [PR#496](https://github.com/LeetCode-OpenSource/vscode-leetcode/pull/496) ## [0.15.8] ### Added -- Add a new command `Sign In by Cookie` to workaround the issue that [users cannot login to LeetCode](https://github.com/jdneo/vscode-leetcode/issues/478). Please check the [workaround steps](https://github.com/jdneo/vscode-leetcode/tree/master#%EF%B8%8F-attention-%EF%B8%8F--workaround-to-login-to-leetcode-endpoint) for more details! +- Add a new command `Sign In by Cookie` to workaround the issue that [users cannot login to LeetCode](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/478). Please check the [workaround steps](https://github.com/LeetCode-OpenSource/vscode-leetcode/tree/master#%EF%B8%8F-attention-%EF%B8%8F--workaround-to-login-to-leetcode-endpoint) for more details! ### Changed -- Update the explorer icons to be align with the VS Code design [#460](https://github.com/jdneo/vscode-leetcode/issues/460) +- Update the explorer icons to be align with the VS Code design [#460](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/460) ## [0.15.7] ### Fixed -[Bugs fixed](https://github.com/jdneo/vscode-leetcode/issues?q=is%3Aissue+milestone%3A0.15.7+is%3Aclosed+label%3Abug) +[Bugs fixed](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues?q=is%3Aissue+milestone%3A0.15.7+is%3Aclosed+label%3Abug) ## [0.15.6] ### Added -- Add a link to the solution page [#424](https://github.com/jdneo/vscode-leetcode/issues/424) +- Add a link to the solution page [#424](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/424) ### Fixed -[Bugs fixed](https://github.com/jdneo/vscode-leetcode/issues?q=is%3Aissue+milestone%3A0.15.6+is%3Aclosed+label%3Abug) +[Bugs fixed](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues?q=is%3Aissue+milestone%3A0.15.6+is%3Aclosed+label%3Abug) ## [0.15.5] ### Added -- Add a link to the discussion page [#420](https://github.com/jdneo/vscode-leetcode/issues/420) +- Add a link to the discussion page [#420](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/420) ### Fixed -[Bugs fixed](https://github.com/jdneo/vscode-leetcode/issues?q=is%3Aissue+milestone%3A0.15.5+is%3Aclosed+label%3Abug) +[Bugs fixed](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues?q=is%3Aissue+milestone%3A0.15.5+is%3Aclosed+label%3Abug) ## [0.15.4] ### Added -- Add a new setting `leetcode.filePath`. Now users can use this setting to dynamicly specify the relative folder name and file name. [#PR380](https://github.com/jdneo/vscode-leetcode/pull/380) +- Add a new setting `leetcode.filePath`. Now users can use this setting to dynamicly specify the relative folder name and file name. [#PR380](https://github.com/LeetCode-OpenSource/vscode-leetcode/pull/380) ### Fixed -- Missing language `Rust` in the supported language list. [#PR412](https://github.com/jdneo/vscode-leetcode/pull/412) -- Cannot show output when the answer is wrong. [#414](https://github.com/jdneo/vscode-leetcode/issues/414) +- Missing language `Rust` in the supported language list. [#PR412](https://github.com/LeetCode-OpenSource/vscode-leetcode/pull/412) +- Cannot show output when the answer is wrong. [#414](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/414) ## [0.15.3] ### Added -- Support `Pick One` [#263](https://github.com/jdneo/vscode-leetcode/issues/263) -- Support toggling the favorite problems [#378](https://github.com/jdneo/vscode-leetcode/issues/378) +- Support `Pick One` [#263](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/263) +- Support toggling the favorite problems [#378](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/378) ### Changed -- Update the activity bar icon [#395](https://github.com/jdneo/vscode-leetcode/issues/263) +- Update the activity bar icon [#395](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/263) ### Fixed -[Bugs fixed](https://github.com/jdneo/vscode-leetcode/issues?q=is%3Aissue+milestone%3A0.15.3+is%3Aclosed+label%3Abug) +[Bugs fixed](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues?q=is%3Aissue+milestone%3A0.15.3+is%3Aclosed+label%3Abug) ## [0.15.2] ### Added -- Prompt to open the workspace for LeetCode [#130](https://github.com/jdneo/vscode-leetcode/issues/130) -- Support deleting sessions [#198](https://github.com/jdneo/vscode-leetcode/issues/130) +- Prompt to open the workspace for LeetCode [#130](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/130) +- Support deleting sessions [#198](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/130) ### Fixed -[Bugs fixed](https://github.com/jdneo/vscode-leetcode/issues?q=is%3Aissue+milestone%3A0.15.2+is%3Aclosed+label%3Abug) +[Bugs fixed](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues?q=is%3Aissue+milestone%3A0.15.2+is%3Aclosed+label%3Abug) ## [0.15.1] ### Fixed -[Bugs fixed](https://github.com/jdneo/vscode-leetcode/issues?q=is%3Aissue+milestone%3A0.15.1+is%3Aclosed+label%3Abug) +[Bugs fixed](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues?q=is%3Aissue+milestone%3A0.15.1+is%3Aclosed+label%3Abug) ## [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) +- Auto refresh the explorer after submitting [#91](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/91) +- Add a editor shortcut `Description` to show the problem description [#286](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/286) +- Support customizing the shortcuts in editor [#335](https://github.com/LeetCode-OpenSource/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) +[Bugs fixed](https://github.com/LeetCode-OpenSource/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) +- Support interpolation for `leetcode.outputFolder` settings [#151](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/151) ### Fixed -[Bugs fixed](https://github.com/jdneo/vscode-leetcode/issues?q=is%3Aissue+is%3Aclosed+milestone%3A0.14.3+label%3Abug) +[Bugs fixed](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues?q=is%3Aissue+is%3Aclosed+milestone%3A0.14.3+label%3Abug) ## [0.14.2] ### Added -- Add the `All` category in the LeetCode Explorer [#184](https://github.com/jdneo/vscode-leetcode/issues/184) -- Add shortcuts for `Show top voted solution` [#269](https://github.com/jdneo/vscode-leetcode/issues/269) +- Add the `All` category in the LeetCode Explorer [#184](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/184) +- Add shortcuts for `Show top voted solution` [#269](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/269) ### Fixed -[Bugs fixed](https://github.com/jdneo/vscode-leetcode/issues?q=is%3Aissue+is%3Aclosed+label%3Abug+milestone%3A0.14.2) +[Bugs fixed](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues?q=is%3Aissue+is%3Aclosed+label%3Abug+milestone%3A0.14.2) ## [0.14.1] ### Added -- Add setting `leetcode.showCommentDescription` to specify whether including the problem description in comments or not [#287](https://github.com/jdneo/vscode-leetcode/issues/287) +- Add setting `leetcode.showCommentDescription` to specify whether including the problem description in comments or not [#287](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/287) ## [0.14.0] ### Added -- Add setting `leetcode.enableShortcuts` to specify whether to show the submit/test shortcuts in editor [#146](https://github.com/jdneo/vscode-leetcode/issues/146) -- Add `Like` and `Dislike` counts in the problem description [#267](https://github.com/jdneo/vscode-leetcode/issues/267) +- Add setting `leetcode.enableShortcuts` to specify whether to show the submit/test shortcuts in editor [#146](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/146) +- Add `Like` and `Dislike` counts in the problem description [#267](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/267) ### Changed - Improve the `Preview`, `Result` and `Solution` views ### Fixed -[Bugs fixed](https://github.com/jdneo/vscode-leetcode/issues?q=is%3Aissue+label%3Abug+is%3Aclosed+milestone%3A0.14.0) +[Bugs fixed](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues?q=is%3Aissue+label%3Abug+is%3Aclosed+milestone%3A0.14.0) ## [0.13.3] ### Fixed @@ -115,51 +142,51 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how ## [0.13.2] ### Added -- Add a setting `leetcode.enableStatusBar` to specify whether the LeetCode status bar will be shown or not [#156](https://github.com/jdneo/vscode-leetcode/issues/156) -- Add a setting `leetcode.nodePath` to specify the `Node.js` executable path [#227](https://github.com/jdneo/vscode-leetcode/issues/227) +- Add a setting `leetcode.enableStatusBar` to specify whether the LeetCode status bar will be shown or not [#156](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/156) +- Add a setting `leetcode.nodePath` to specify the `Node.js` executable path [#227](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/227) ### Changed -- Update the activity bar icon, See: [#225](https://github.com/jdneo/vscode-leetcode/pull/225) +- Update the activity bar icon, See: [#225](https://github.com/LeetCode-OpenSource/vscode-leetcode/pull/225) ### Fixed -[Bugs fixed](https://github.com/jdneo/vscode-leetcode/issues?q=is%3Aissue+milestone%3A0.13.2+is%3Aclosed+label%3Abug) +[Bugs fixed](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues?q=is%3Aissue+milestone%3A0.13.2+is%3Aclosed+label%3Abug) ## [0.13.1] ### Fixed -[Bugs fixed](https://github.com/jdneo/vscode-leetcode/issues?q=is%3Aissue+milestone%3A0.13.1+is%3Aclosed+label%3Abug) +[Bugs fixed](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues?q=is%3Aissue+milestone%3A0.13.1+is%3Aclosed+label%3Abug) ## [0.13.0] ### Added -- Preview the problem description [#131](https://github.com/jdneo/vscode-leetcode/issues/131) -- Show top voted solution [#193](https://github.com/jdneo/vscode-leetcode/pull/193) -- Add `collapse all` for the explorer [#197](https://github.com/jdneo/vscode-leetcode/pull/197) +- Preview the problem description [#131](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/131) +- Show top voted solution [#193](https://github.com/LeetCode-OpenSource/vscode-leetcode/pull/193) +- Add `collapse all` for the explorer [#197](https://github.com/LeetCode-OpenSource/vscode-leetcode/pull/197) ### Fixed -[Bugs fixed](https://github.com/jdneo/vscode-leetcode/issues?q=is%3Aissue+is%3Aclosed+milestone%3A0.13.0+label%3Abug) +[Bugs fixed](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues?q=is%3Aissue+is%3Aclosed+milestone%3A0.13.0+label%3Abug) ## [0.12.0] ### Added -- Add new command `LeetCode: Switch Default Language` to support switching the default language [#115](https://github.com/jdneo/vscode-leetcode/issues/115) -- Support `PHP` and `Rust` ([#83](https://github.com/jdneo/vscode-leetcode/issues/83), [#103](https://github.com/jdneo/vscode-leetcode/issues/103)) +- Add new command `LeetCode: Switch Default Language` to support switching the default language [#115](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/115) +- Support `PHP` and `Rust` ([#83](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/83), [#103](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/103)) ### Fixed -- Cannot retrieve time and memory result [#105](https://github.com/jdneo/vscode-leetcode/issues/105) -- Power operator displays in a wrong way [#74](https://github.com/jdneo/vscode-leetcode/issues/74) +- Cannot retrieve time and memory result [#105](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/105) +- Power operator displays in a wrong way [#74](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/74) ## [0.11.0] ### Added -- Add new setting: `leetcode.outputFolder` to customize the sub-directory to save the files generated by 'Show Problem' [#119](https://github.com/jdneo/vscode-leetcode/issues/119) -- Add tooltips for sub-category nodes in LeetCode Explorer [#143](https://github.com/jdneo/vscode-leetcode/pull/143) +- Add new setting: `leetcode.outputFolder` to customize the sub-directory to save the files generated by 'Show Problem' [#119](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/119) +- Add tooltips for sub-category nodes in LeetCode Explorer [#143](https://github.com/LeetCode-OpenSource/vscode-leetcode/pull/143) ### Changed -- Now when triggering 'Show Problem', the extension will not generate a new file if it already exists [#59](https://github.com/jdneo/vscode-leetcode/issues/59) +- Now when triggering 'Show Problem', the extension will not generate a new file if it already exists [#59](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/59) ### Fixed -- Log in timeout when proxy is enabled [#117](https://github.com/jdneo/vscode-leetcode/issues/117) +- Log in timeout when proxy is enabled [#117](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/117) ## [0.10.2] ### Fixed -- Test cases cannot have double quotes [#60](https://github.com/jdneo/vscode-leetcode/issues/60) +- Test cases cannot have double quotes [#60](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/60) ## [0.10.1] ### Changed @@ -167,13 +194,13 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how ## [0.10.0] ### Added -- Add an extension setting to hide solved problems [#95](https://github.com/jdneo/vscode-leetcode/issues/95) -- Support categorize problems by company, tag, difficulty and favorite [#67](https://github.com/jdneo/vscode-leetcode/issues/67) +- Add an extension setting to hide solved problems [#95](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/95) +- Support categorize problems by company, tag, difficulty and favorite [#67](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/67) ## [0.9.0] ### Changed -- Improve the experience of switching endpoint [#85](https://github.com/jdneo/vscode-leetcode/issues/85) -- Use web view to show the result page [#76](https://github.com/jdneo/vscode-leetcode/issues/76) +- Improve the experience of switching endpoint [#85](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/85) +- Use web view to show the result page [#76](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/76) ## [0.8.2] @@ -181,7 +208,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how - Add Code Lens for submitting the answer to LeetCode ### Fixed -- Fix the bug that the extension could not automatically sign in [#72](https://github.com/jdneo/vscode-leetcode/issues/72) +- Fix the bug that the extension could not automatically sign in [#72](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/72) ## [0.8.1] ### Changed @@ -189,67 +216,67 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how ## [0.8.0] ### Added -- Support LeetCode CN [#50](https://github.com/jdneo/vscode-leetcode/issues/50) -- Support Windows Subsystem for Linux [#47](https://github.com/jdneo/vscode-leetcode/issues/47) +- Support LeetCode CN [#50](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/50) +- Support Windows Subsystem for Linux [#47](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/47) ## [0.7.0] ### Added -- Add spinner when submitting code [#43](https://github.com/jdneo/vscode-leetcode/issues/43) +- Add spinner when submitting code [#43](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/43) ## [0.6.1] ### Added -- Add Sign in action into LeetCode Explorer title area [#25](https://github.com/jdneo/vscode-leetcode/issues/25) +- Add Sign in action into LeetCode Explorer title area [#25](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/25) ## [0.6.0] ### Changed -- Move LeetCode explorer into activity bar [#39](https://github.com/jdneo/vscode-leetcode/issues/39) +- Move LeetCode explorer into activity bar [#39](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/39) ### Added -- Support trigger test & submit in the editor [#37](https://github.com/jdneo/vscode-leetcode/issues/37) +- Support trigger test & submit in the editor [#37](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/37) ### Fixed -- Fix the bug that cannot show problem [#41](https://github.com/jdneo/vscode-leetcode/issues/41) +- Fix the bug that cannot show problem [#41](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/41) ## [0.5.1] ### Fixed -- Fix the bug when user's path contains white spaces [#34](https://github.com/jdneo/vscode-leetcode/issues/34) +- Fix the bug when user's path contains white spaces [#34](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/34) ## [0.5.0] ### Added -- Support submit and test solution files from the file explorer in VS Code ([#24](https://github.com/jdneo/vscode-leetcode/issues/24), [#26](https://github.com/jdneo/vscode-leetcode/issues/26)) +- Support submit and test solution files from the file explorer in VS Code ([#24](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/24), [#26](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/26)) ## [0.4.0] ### Added -- Support locked problem [#20](https://github.com/jdneo/vscode-leetcode/issues/20) +- Support locked problem [#20](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/20) ### Changed -- Simplify the command 'LeetCode: Test Current File' to 'LeetCode: Test' [#18](https://github.com/jdneo/vscode-leetcode/issues/18) -- Will automatically save current file when 'LeetCode: Test' command is triggered [#17](https://github.com/jdneo/vscode-leetcode/issues/17) +- Simplify the command 'LeetCode: Test Current File' to 'LeetCode: Test' [#18](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/18) +- Will automatically save current file when 'LeetCode: Test' command is triggered [#17](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/17) ## [0.3.0] ### Added -- Test current solution file [#15](https://github.com/jdneo/vscode-leetcode/issues/15) +- Test current solution file [#15](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/15) ## [0.2.1] ### Fixed -- Fix the wrong icon bug in LeetCode Explorer [#9](https://github.com/jdneo/vscode-leetcode/issues/9) -- Fix the switch session bug when login session is expired [#12](https://github.com/jdneo/vscode-leetcode/issues/12) +- Fix the wrong icon bug in LeetCode Explorer [#9](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/9) +- Fix the switch session bug when login session is expired [#12](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/12) ## [0.2.0] ### Added -- Support setting the default language to solve problems [#5](https://github.com/jdneo/vscode-leetcode/issues/5) +- Support setting the default language to solve problems [#5](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/5) ### Fixed -- When user cancels login, no further actions will happen [#10](https://github.com/jdneo/vscode-leetcode/issues/10) +- When user cancels login, no further actions will happen [#10](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/10) ## [0.1.2] ### Fixed -- Fix the duplicated nodes in LeetCode Explorer bug [#6](https://github.com/jdneo/vscode-leetcode/issues/6) +- Fix the duplicated nodes in LeetCode Explorer bug [#6](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/6) ## [0.1.1] ### Fixed -- Fix a bug in LeetCode Explorer [#3](https://github.com/jdneo/vscode-leetcode/issues/3) -- Remove the show problem command from command palette [#4](https://github.com/jdneo/vscode-leetcode/issues/4) +- Fix a bug in LeetCode Explorer [#3](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/3) +- Remove the show problem command from command palette [#4](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/4) ## [0.1.0] ### Added diff --git a/LICENSE b/LICENSE index 4401d6f6..fffb65eb 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,7 @@ MIT License -Copyright (c) 2018 jdneo +Copyright (c) 2020-present 力扣 +Copyright (c) 2018-2019 jdneo Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index fecddd1b..ac752c73 100644 --- a/README.md +++ b/README.md @@ -3,48 +3,48 @@ > Solve LeetCode problems in VS Code

- +

- - + + - + - - + + - - + +

-- English Document | [中文文档](https://github.com/jdneo/vscode-leetcode/blob/master/docs/README_zh-CN.md) +- English Document | [中文文档](https://github.com/LeetCode-OpenSource/vscode-leetcode/blob/master/docs/README_zh-CN.md) ## ❗️ Attention ❗️- Workaround to login to LeetCode endpoint > Note: If you are using `leetcode-cn.com`, you can just ignore this section. -Recently we observed that [the extension cannot login to leetcode.com endpoint anymore](https://github.com/jdneo/vscode-leetcode/issues/478). The root cause of this issue is that leetcode.com changed its login mechanism and so far there is no ideal way to fix that issue. +Recently we observed that [the extension cannot login to leetcode.com endpoint anymore](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/478). The root cause of this issue is that leetcode.com changed its login mechanism and so far there is no ideal way to fix that issue. Thanks for [@yihong0618](https://github.com/yihong0618) provided a workaround which can somehow mitigate this. Now you can simply click the `Sign In` button and then select `Third Party` login or `Cookie` login. -> Note: If you want to use third-party login(**Recommended**), please make sure your account has been connected to the thrid-party. If you want to use `Cookie` login, click [here](https://github.com/jdneo/vscode-leetcode/issues/478#issuecomment-564757098) to see the steps. +> Note: If you want to use third-party login(**Recommended**), please make sure your account has been connected to the third-party. If you want to use `Cookie` login, click [here](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/478#issuecomment-564757098) to see the steps. ## Requirements - [VS Code 1.30.1+](https://code.visualstudio.com/) -- [Node.js 8+](https://nodejs.org) +- [Node.js 10+](https://nodejs.org) > NOTE: Please make sure that `Node` is in your `PATH` environment variable. You can also use the setting `leetcode.nodePath` to specify the location of your `Node.js` executable. ## Quick Start -![demo](https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/docs/gifs/demo.gif) +![demo](https://raw.githubusercontent.com/LeetCode-OpenSource/vscode-leetcode/master/docs/gifs/demo.gif) ## Features ### Sign In/Out

- Sign in + Sign in

- Simply click `Sign in to LeetCode` in the `LeetCode Explorer` will let you **sign in** with your LeetCode account. @@ -56,10 +56,10 @@ Thanks for [@yihong0618](https://github.com/yihong0618) provided a workaround wh ### Switch Endpoint

- Switch Endpoint + Switch Endpoint

-- By clicking the button ![btn_endpoint](https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/docs/imgs/btn_endpoint.png) at the **explorer's navigation bar**, you can switch between different endpoints. +- By clicking the button ![btn_endpoint](https://raw.githubusercontent.com/LeetCode-OpenSource/vscode-leetcode/master/docs/imgs/btn_endpoint.png) at the **explorer's navigation bar**, you can switch between different endpoints. - The supported endpoints are: - **leetcode.com** @@ -71,7 +71,7 @@ Thanks for [@yihong0618](https://github.com/yihong0618) provided a workaround wh ### Pick a Problem

- Pick a Problem + Pick a Problem

- Directly click on the problem or right click the problem in the `LeetCode Explorer` and select `Preview Problem` to see the problem description. @@ -87,12 +87,13 @@ Thanks for [@yihong0618](https://github.com/yihong0618) provided a workaround wh ### Editor Shortcuts

- Editor Shortcuts + Editor Shortcuts

-- The extension supports 4 editor shortcuts (aka Code Lens): +- The extension supports 5 editor shortcuts (aka Code Lens): - `Submit`: Submit your answer to LeetCode. - `Test`: Test your answer with customized test cases. + - `Star/Unstar`: Star or unstar the current problem. - `Solution`: Show the top voted solution for the current problem. - `Description`: Show the problem description page. @@ -102,48 +103,52 @@ Thanks for [@yihong0618](https://github.com/yihong0618) provided a workaround wh ### Search problems by Keywords

- Search problems by Keywords + Search problems by Keywords

-- By clicking the button ![btn_search](https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/docs/imgs/btn_search.png) at the **explorer's navigation bar**, you can search the problems by keywords. +- By clicking the button ![btn_search](https://raw.githubusercontent.com/LeetCode-OpenSource/vscode-leetcode/master/docs/imgs/btn_search.png) at the **explorer's navigation bar**, you can search the problems by keywords. --- ### Manage Session

- Manage Session + Manage Session

- To manage your LeetCode sessions, just clicking the `LeetCode: ***` at the bottom of the status bar. You can **switch** between sessions or **create**, **delete** a session. ## Settings -| Setting Name | Description | Default Value | -| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | -| `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`, `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.workspaceFolder` | Specify the path of the workspace folder to store the problem files. | `""` | -| `leetcode.filePath` | Specify the relative path under the workspace and the file name to save the problem files. More details can be found [here](https://github.com/jdneo/vscode-leetcode/wiki/Customize-the-Relative-Folder-and-the-File-Name-of-the-Problem-File). | | -| `leetcode.enableStatusBar` | Specify whether the LeetCode status bar will be shown 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. for example, C:\Program Files\nodejs\node.exe | `node` | -| `leetcode.showCommentDescription` | Specify whether to include the problem description in the comments | `false` | + +| Setting Name | Description | Default Value | +| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | +| `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`, `php`, `python`,`python3`,`ruby`,`rust`, `scala`, `swift`, `typescript` | `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.workspaceFolder` | Specify the path of the workspace folder to store the problem files. | `""` | +| `leetcode.filePath` | Specify the relative path under the workspace and the file name to save the problem files. More details can be found [here](https://github.com/LeetCode-OpenSource/vscode-leetcode/wiki/Customize-the-Relative-Folder-and-the-File-Name-of-the-Problem-File). | | +| `leetcode.enableStatusBar` | Specify whether the LeetCode status bar will be shown or not. | `true` | +| `leetcode.editor.shortcuts` | Specify the customized shortcuts in editors. Supported values are: `submit`, `test`, `star`, `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. for example, C:\Program Files\nodejs\node.exe | `node` | +| `leetcode.showCommentDescription` | Specify whether to include the problem description in the comments | `false` | +| `leetcode.useEndpointTranslation` | Use endpoint's translation (if available) | `true` | +| `leetcode.colorizeProblems` | Add difficulty badge and colorize problems files in explorer tree | `true` | +| `leetcode.problems.sortStrategy` | Specify sorting strategy for problems list | `None` | ## Want Help? -When you meet any problem, you can check out the [Troubleshooting](https://github.com/jdneo/vscode-leetcode/wiki/Troubleshooting) and [FAQ](https://github.com/jdneo/vscode-leetcode/wiki/FAQ) first. +When you meet any problem, you can check out the [Troubleshooting](https://github.com/LeetCode-OpenSource/vscode-leetcode/wiki/Troubleshooting) and [FAQ](https://github.com/LeetCode-OpenSource/vscode-leetcode/wiki/FAQ) first. -If your problem still cannot be addressed, feel free to reach us in the [Gitter Channel](https://gitter.im/vscode-leetcode/Lobby) or [file an issue](https://github.com/jdneo/vscode-leetcode/issues/new/choose). +If your problem still cannot be addressed, feel free to reach us in the [Gitter Channel](https://gitter.im/vscode-leetcode/Lobby) or [file an issue](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/new/choose). ## Release Notes -Refer to [CHANGELOG](https://github.com/jdneo/vscode-leetcode/blob/master/CHANGELOG.md) +Refer to [CHANGELOG](https://github.com/LeetCode-OpenSource/vscode-leetcode/blob/master/CHANGELOG.md) ## Acknowledgement - This extension is based on [@skygragon](https://github.com/skygragon)'s [leetcode-cli](https://github.com/skygragon/leetcode-cli) open source project. -- Special thanks to our [contributors](https://github.com/jdneo/vscode-leetcode/blob/master/ACKNOWLEDGEMENTS.md). +- Special thanks to our [contributors](https://github.com/LeetCode-OpenSource/vscode-leetcode/blob/master/ACKNOWLEDGEMENTS.md). diff --git a/docs/README_zh-CN.md b/docs/README_zh-CN.md index 8aced3a8..71ed04b6 100644 --- a/docs/README_zh-CN.md +++ b/docs/README_zh-CN.md @@ -3,49 +3,49 @@ > 在 VS Code 中练习 LeetCode

- +

- - + + - + - - + + - - + +

-- [English Document](https://github.com/jdneo/vscode-leetcode#requirements) | 中文文档 +- [English Document](https://github.com/LeetCode-OpenSource/vscode-leetcode#requirements) | 中文文档 ## ❗️ 注意 ❗️- 无法登录 LeetCode 节点的临时解决办法 > 注意:如果使用的是 `leetcode-cn.com` 账户,可以跳过此段落。 -近期我们发现插件出现了[无法登录 leetcode.com 节点的问题](https://github.com/jdneo/vscode-leetcode/issues/478)。原因是因为近期 leetcode.com 改变了登录机制,目前我们暂时没有找到解决该问题的完美解决方案。 +近期我们发现插件出现了[无法登录 leetcode.com 节点的问题](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/478)。原因是因为近期 leetcode.com 改变了登录机制,目前我们暂时没有找到解决该问题的完美解决方案。 感谢 [@yihong0618](https://github.com/yihong0618) 提供了一个临时解决办法。现在你可以直接点击登录按钮并选择第三方登录或者 `Cookie` 登录。 -> 注意:如果你希望使用第三方登录(**推荐**),请确保你的账户已经与第三方账户连接。如果你希望通过 `Cookie` 登录,请点击[该连接](https://github.com/jdneo/vscode-leetcode/issues/478#issuecomment-564757098)查看登录步骤。 +> 注意:如果你希望使用第三方登录(**推荐**),请确保你的账户已经与第三方账户连接。如果你希望通过 `Cookie` 登录,请点击[该连接](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/478#issuecomment-564757098)查看登录步骤。 ## 运行条件 - [VS Code 1.23.0+](https://code.visualstudio.com/) -- [Node.js 8+](https://nodejs.org) +- [Node.js 10+](https://nodejs.org) > 注意:请确保`Node`在`PATH`环境变量中。您也可以通过设定 `leetcode.nodePath` 选项来指定 `Node.js` 可执行文件的路径。 ## 快速开始 -![demo](https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/docs/gifs/demo.gif) +![demo](https://raw.githubusercontent.com/LeetCode-OpenSource/vscode-leetcode/master/docs/gifs/demo.gif) ## 功能 ### 登入登出

- 登入登出 + 登入登出

- 点击 `LeetCode Explorer` 中的 `Sign in to LeetCode` 即可登入。 @@ -57,10 +57,10 @@ ### 切换 LeetCode 版本

- 切换 LeetCode 版本 + 切换 LeetCode 版本

-- LeetCode 目前有**英文版**和**中文版**两种版本。点击 `LeetCode Explorer` 导航栏中的 ![btn_endpoint](https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/docs/imgs/btn_endpoint.png) 按钮可切换版本。 +- LeetCode 目前有**英文版**和**中文版**两种版本。点击 `LeetCode Explorer` 导航栏中的 ![btn_endpoint](https://raw.githubusercontent.com/LeetCode-OpenSource/vscode-leetcode/master/docs/imgs/btn_endpoint.png) 按钮可切换版本。 - 目前可切换的版本有: - **leetcode.com** @@ -72,7 +72,7 @@ ### 选择题目

- 选择题目 + 选择题目

- 直接点击题目或者在 `LeetCode Explorer` 中**右键**题目并选择 `Preview Problem` 可查看题目描述 @@ -88,12 +88,13 @@ ### 编辑器快捷方式

- Editor Shortcuts + Editor Shortcuts

-- 插件会在编辑区域内支持四种不同的快捷方式(Code Lens): +- 插件会在编辑区域内支持五种不同的快捷方式(Code Lens): - `Submit`: 提交你的答案至 LeetCode; - `Test`: 用给定的测试用例测试你的答案; + - `Star`: 收藏或取消收藏该问题; - `Solution`: 显示该问题的高票解答; - `Description`: 显示该问题的题目描述。 @@ -103,16 +104,16 @@ ### 通过关键字搜索题目

- 通过关键字搜索题目 + 通过关键字搜索题目

-- 点击 `LeetCode Explorer` 导航栏中的 ![btn_search](https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/docs/imgs/btn_search.png) 按钮可按照关键字搜索题目。 +- 点击 `LeetCode Explorer` 导航栏中的 ![btn_search](https://raw.githubusercontent.com/LeetCode-OpenSource/vscode-leetcode/master/docs/imgs/btn_search.png) 按钮可按照关键字搜索题目。 --- ### 管理存档

- 管理存档 + 管理存档

- 点击位于 VS Code 底部状态栏的 `LeetCode: ***` 管理 `LeetCode 存档`。你可以**切换**存档或者**创建**,**删除**存档。 @@ -123,27 +124,28 @@ | ---------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | | `leetcode.hideSolved` | 指定是否要隐藏已解决的问题 | `false` | | `leetcode.showLocked` | 指定是否显示付费题目,只有付费账户才可以打开付费题目 | `false` | -| `leetcode.defaultLanguage` | 指定答题时使用的默认语言,可选语言有:`bash`, `c`, `cpp`, `csharp`, `golang`, `java`, `javascript`, `kotlin`, `mysql`, `php`, `python`,`python3`,`ruby`, `rust`, `scala`,`swift` | `N/A` | +| `leetcode.defaultLanguage` | 指定答题时使用的默认语言,可选语言有:`bash`, `c`, `cpp`, `csharp`, `golang`, `java`, `javascript`, `kotlin`, `mysql`, `php`, `python`,`python3`,`ruby`, `rust`, `scala`, `swift`, `typescript` | `N/A` | | `leetcode.useWsl` | 指定是否启用 WSL | `false` | | `leetcode.endpoint` | 指定使用的终端,可用终端有:`leetcode`, `leetcode-cn` | `leetcode` | | `leetcode.workspaceFolder` | 指定保存文件的工作区目录 | `""` | -| `leetcode.filePath` | 指定生成题目文件的相对文件夹路径名和文件名。点击查看[更多详细用法](https://github.com/jdneo/vscode-leetcode/wiki/%E8%87%AA%E5%AE%9A%E4%B9%89%E9%A2%98%E7%9B%AE%E6%96%87%E4%BB%B6%E7%9A%84%E7%9B%B8%E5%AF%B9%E6%96%87%E4%BB%B6%E5%A4%B9%E8%B7%AF%E5%BE%84%E5%92%8C%E6%96%87%E4%BB%B6%E5%90%8D)。 | | +| `leetcode.filePath` | 指定生成题目文件的相对文件夹路径名和文件名。点击查看[更多详细用法](https://github.com/LeetCode-OpenSource/vscode-leetcode/wiki/%E8%87%AA%E5%AE%9A%E4%B9%89%E9%A2%98%E7%9B%AE%E6%96%87%E4%BB%B6%E7%9A%84%E7%9B%B8%E5%AF%B9%E6%96%87%E4%BB%B6%E5%A4%B9%E8%B7%AF%E5%BE%84%E5%92%8C%E6%96%87%E4%BB%B6%E5%90%8D)。 | | | `leetcode.enableStatusBar` | 指定是否在 VS Code 下方显示插件状态栏。 | `true` | -| `leetcode.editor.shortcuts` | 指定在编辑器内所自定义的快捷方式。可用的快捷方式有: `submit`, `test`, `solution`, `description`。 | `["submit, test"]` | +| `leetcode.editor.shortcuts` | 指定在编辑器内所自定义的快捷方式。可用的快捷方式有: `submit`, `test`, `star`, `solution`, `description`。 | `["submit, test"]` | | `leetcode.enableSideMode` | 指定在解决一道题时,是否将`问题预览`、`高票答案`与`提交结果`窗口集中在编辑器的第二栏。 | `true` | | `leetcode.nodePath` | 指定 `Node.js` 可执行文件的路径。如:C:\Program Files\nodejs\node.exe | `node` | | `leetcode.showCommentDescription` | 指定是否要在注释中显示题干。 | `false` | +| `leetcode.useEndpointTranslation` | 是否显示翻译版本内容。 | `true` | ## 需要帮助? -在遇到任何问题时,可以先查看一下[疑难解答](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)寻求帮助。 +在遇到任何问题时,可以先查看一下[疑难解答](https://github.com/LeetCode-OpenSource/vscode-leetcode/wiki/%E7%96%91%E9%9A%BE%E8%A7%A3%E7%AD%94)以及[常见问题](https://github.com/LeetCode-OpenSource/vscode-leetcode/wiki/%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98)寻求帮助。 -如果您的问题依然没有解决,可以在 [Gitter Channel](https://gitter.im/vscode-leetcode/Lobby) 联系我们,或者您也可以[记录一个新的 issue](https://github.com/jdneo/vscode-leetcode/issues/new/choose)。 +如果您的问题依然没有解决,可以在 [Gitter Channel](https://gitter.im/vscode-leetcode/Lobby) 联系我们,或者您也可以[记录一个新的 issue](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/new/choose)。 ## 更新日志 -请参考[更新日志](https://github.com/jdneo/vscode-leetcode/blob/master/CHANGELOG.md) +请参考[更新日志](https://github.com/LeetCode-OpenSource/vscode-leetcode/blob/master/CHANGELOG.md) ## 鸣谢 - 本插件基于[@skygragon](https://github.com/skygragon)的[leetcode-cli](https://github.com/skygragon/leetcode-cli)开源项目制作。 -- 特别鸣谢这些[贡献者们](https://github.com/jdneo/vscode-leetcode/blob/master/ACKNOWLEDGEMENTS.md)。 +- 特别鸣谢这些[贡献者们](https://github.com/LeetCode-OpenSource/vscode-leetcode/blob/master/ACKNOWLEDGEMENTS.md)。 diff --git a/package-lock.json b/package-lock.json index 0a555853..4ab065af 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,34 +1,54 @@ { "name": "vscode-leetcode", - "version": "0.16.1", + "version": "0.18.0", "lockfileVersion": 1, "requires": true, "dependencies": { - "@types/fs-extra": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-5.0.0.tgz", - "integrity": "sha512-qtxDULQKUenuaDLW003CgC+0T0eiAfH3BrH+vSt87GLzbz5EZ6Ox6mv9rMttvhDOatbb9nYh0E1m7ydoYwUrAg==", + "@babel/code-frame": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", + "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", "dev": true, "requires": { - "@types/node": "*" + "@babel/highlight": "^7.12.13" } }, - "@types/highlight.js": { - "version": "9.12.3", - "resolved": "https://registry.npmjs.org/@types/highlight.js/-/highlight.js-9.12.3.tgz", - "integrity": "sha512-pGF/zvYOACZ/gLGWdQH8zSwteQS1epp68yRcVLJMgUck/MjEn/FBYmPub9pXT8C1e4a8YZfHo1CKyV8q1vKUnQ==", + "@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", "dev": true }, + "@babel/highlight": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", + "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@types/fs-extra": { + "version": "9.0.11", + "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-9.0.11.tgz", + "integrity": "sha512-mZsifGG4QeQ7hlkhO56u7zt/ycBgGxSVsFI/6lGTU34VtwkiqrrSDgw0+ygs8kFGWcXnFQWMrzF2h7TtDFNixA==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "@types/linkify-it": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-2.0.4.tgz", - "integrity": "sha512-9o5piu3tP6DwqT+Cyf7S3BitsTc6Cl0pCPKUhIE5hzQbtueiBXdtBipTLLvaGfT11/8XHRmsagu4YfBesTaiCA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-3.0.1.tgz", + "integrity": "sha512-pQv3Sygwxxh6jYQzXaiyWDAHevJqWtqDUv6t11Sa9CPGiXny66II7Pl6PR8QO5OVysD6HYOkHMeBgIjLnk9SkQ==", "dev": true }, "@types/lodash": { - "version": "4.14.123", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.123.tgz", - "integrity": "sha512-pQvPkc4Nltyx7G1Ww45OjVqUsJP4UsZm+GWJpigXgkikZqJgRm4c48g027o6tdgubWHwFRF15iFd+Y4Pmqv6+Q==", + "version": "4.14.170", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.170.tgz", + "integrity": "sha512-bpcvu/MKHHeYX+qeEN8GE7DIravODWdACVA1ctevD8CN24RhPZIKMn9ntfAsrvLfSX3cR5RrBKAbYm9bGs0A+Q==", "dev": true }, "@types/markdown-it": { @@ -47,9 +67,9 @@ "dev": true }, "@types/node": { - "version": "7.10.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-7.10.3.tgz", - "integrity": "sha512-HeyK+csRk7Khhg9krpMGJeT9pLzjsmiJFHYRzYpPv/dQ5tPclQsbvceiX/HKynRt/9lMLorWUYTbBHC3hRI4sg==", + "version": "14.17.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.1.tgz", + "integrity": "sha512-/tpUyFD7meeooTRwl3sYlihx2BrJE7q9XF71EguPFIySj9B7qgnRtHsHTho+0AUm4m1SvWGm6uSncrR94q6Vtw==", "dev": true }, "@types/require-from-string": { @@ -59,9 +79,9 @@ "dev": true }, "@types/vscode": { - "version": "1.42.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.42.0.tgz", - "integrity": "sha512-ds6TceMsh77Fs0Mq0Vap6Y72JbGWB8Bay4DrnJlf5d9ui2RSe1wis13oQm+XhguOeH1HUfLGzaDAoupTUtgabw==", + "version": "1.57.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.57.0.tgz", + "integrity": "sha512-FeznBFtIDCWRluojTsi9c3LLcCHOXP5etQfBK42+ixo1CoEAchkw39tuui9zomjZuKfUVL33KZUDIwHZ/xvOkQ==", "dev": true }, "abab": { @@ -86,11 +106,11 @@ } }, "ajv": { - "version": "6.9.1", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.9.1.tgz", - "integrity": "sha512-XDN92U311aINL77ieWHmqCcNlwjoP5cHXDxIxbf2MaPYuCXOHS7gHH8jktxeK5omgd52XbSTX6a4Piwd1pQmzA==", + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "requires": { - "fast-deep-equal": "^2.0.1", + "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" @@ -146,52 +166,14 @@ "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" }, "aws4": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" - }, - "babel-code-frame": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", - "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "esutils": "^2.0.2", - "js-tokens": "^3.0.2" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", + "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==" }, "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "bcrypt-pbkdf": { "version": "1.0.2", @@ -306,17 +288,17 @@ "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==" }, "combined-stream": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", - "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "requires": { "delayed-stream": "~1.0.0" } }, "commander": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", - "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==", + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, "concat-map": { @@ -329,18 +311,6 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, "css-select": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz", @@ -415,9 +385,9 @@ "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" }, "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true }, "dom-serializer": { @@ -460,13 +430,10 @@ "safer-buffer": "^2.1.0" } }, - "end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "requires": { - "once": "^1.4.0" - } + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, "entities": { "version": "1.1.2", @@ -479,12 +446,12 @@ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, "escodegen": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.12.1.tgz", - "integrity": "sha512-Q8t2YZ+0e0pc7NRVj3B4tSQ9rim1oi4Fh46k2xhJ2qOiEwhQfdjyEQddWdj7ZFaKmU+5104vn1qrcjEPWq+bgQ==", + "version": "1.14.3", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz", + "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==", "optional": true, "requires": { - "esprima": "^3.1.3", + "esprima": "^4.0.1", "estraverse": "^4.2.0", "esutils": "^2.0.2", "optionator": "^0.8.1", @@ -492,10 +459,9 @@ } }, "esprima": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", - "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=", - "optional": true + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" }, "estraverse": { "version": "4.3.0", @@ -504,23 +470,10 @@ "optional": true }, "esutils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=" - }, - "execa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", - "requires": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - } + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "optional": true }, "extend": { "version": "3.0.2", @@ -538,14 +491,14 @@ "integrity": "sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A=" }, "fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=" + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, "fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" }, "fast-levenshtein": { "version": "2.0.6", @@ -554,11 +507,12 @@ "optional": true }, "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "requires": { - "locate-path": "^3.0.0" + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" } }, "forever-agent": { @@ -577,13 +531,13 @@ } }, "fs-extra": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-6.0.1.tgz", - "integrity": "sha512-GnyIkKhhzXZUWFCaJzvyDLEEgDkPfb4/TPvJCJVuS8MWZgoSsErf++QpiAlDnKFcqhRlm+tIOcencCjyJE6ZCA==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.0.tgz", + "integrity": "sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==", "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" } }, "fs.realpath": { @@ -591,18 +545,16 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, - "get-caller-file": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==" + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true }, - "get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", - "requires": { - "pump": "^3.0.0" - } + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" }, "getpass": { "version": "0.1.7", @@ -613,9 +565,9 @@ } }, "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -626,9 +578,9 @@ } }, "graceful-fs": { - "version": "4.1.15", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", - "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==" + "version": "4.2.6", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", + "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==" }, "har-schema": { "version": "2.0.0", @@ -636,21 +588,21 @@ "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" }, "har-validator": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", - "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", "requires": { - "ajv": "^6.5.5", + "ajv": "^6.12.3", "har-schema": "^2.0.0" } }, - "has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "dev": true, "requires": { - "ansi-regex": "^2.0.0" + "function-bind": "^1.1.1" } }, "has-flag": { @@ -664,9 +616,9 @@ "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==" }, "highlight.js": { - "version": "9.15.6", - "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-9.15.6.tgz", - "integrity": "sha512-zozTAWM1D6sozHo8kqhfYgsac+B+q0PmsjXeyDrYIHHcBN0zTVT66+s2GW1GZv7DbyaROdLXKdabwS/WqPyIdQ==" + "version": "10.7.2", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.2.tgz", + "integrity": "sha512-oFLl873u4usRM9K63j4ME9u3etNF0PLiJhSQ8rdfuL51Wn3zkD6drf9ZW0dOzjnZI22YYG24z30JcmfCZjMgYg==" }, "htmlparser2": { "version": "3.8.3", @@ -712,20 +664,29 @@ } }, "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "ini": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" }, "invert-kv": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" }, + "is-core-module": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.4.0.tgz", + "integrity": "sha512-6A2fkfq1rfeQZjxrZJGerpLCTHRNEBiSgnu0+obeJpEPZRUooHgsizvzv0ZjJwOz3iWIHdJtVWJ/tmPr3D21/A==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, "is-fullwidth-code-point": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", @@ -734,11 +695,6 @@ "number-is-nan": "^1.0.0" } }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" - }, "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", @@ -749,38 +705,25 @@ "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" - }, "isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" }, "js-tokens": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true }, "js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dev": true, "requires": { "argparse": "^1.0.7", "esprima": "^4.0.0" - }, - "dependencies": { - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true - } } }, "jsbn": { @@ -827,11 +770,12 @@ "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" }, "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", "requires": { - "graceful-fs": "^4.1.6" + "graceful-fs": "^4.1.6", + "universalify": "^2.0.0" } }, "jsprim": { @@ -864,26 +808,25 @@ } }, "linkify-it": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.1.0.tgz", - "integrity": "sha512-4REs8/062kV2DSHxNfq5183zrqXMl7WP0WzABH9IeJI+NLm429FgE1PDecltYfnOoFDFlZGh2T8PfZn0r+GTRg==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.2.0.tgz", + "integrity": "sha512-GnAl/knGn+i1U/wjBz3akz2stz+HrHLsxMwHQGofCDfPvlf+gDKN58UtfmUquTY4/MXeE2x7k19KQmeoZi94Iw==", "requires": { "uc.micro": "^1.0.1" } }, "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" + "p-locate": "^4.1.0" } }, "lodash": { - "version": "4.17.13", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.13.tgz", - "integrity": "sha512-vm3/XWXfWtRua0FkUyEHBZy8kCPjErNBT9fJx8Zvs+U6zjqPbTUOpkaoum3O5uiA8sm+yNMHXfYkTUHFoMxFNA==" + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, "log-symbols": { "version": "2.2.0", @@ -893,14 +836,6 @@ "chalk": "^2.0.1" } }, - "map-age-cleaner": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", - "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", - "requires": { - "p-defer": "^1.0.0" - } - }, "markdown-it": { "version": "8.4.2", "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-8.4.2.tgz", @@ -918,34 +853,17 @@ "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=" }, - "mem": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", - "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", - "requires": { - "map-age-cleaner": "^0.1.1", - "mimic-fn": "^2.0.0", - "p-is-promise": "^2.0.0" - }, - "dependencies": { - "mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" - } - } - }, "mime-db": { - "version": "1.38.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.38.0.tgz", - "integrity": "sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg==" + "version": "1.47.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.47.0.tgz", + "integrity": "sha512-QBmA/G2y+IfeS4oktet3qRZ+P5kPhCKRXxXnQEudYqUaEioAU1/Lq2us3D/t1Jfo4hE9REQPrbB7K5sOczJVIw==" }, "mime-types": { - "version": "2.1.22", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.22.tgz", - "integrity": "sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog==", + "version": "2.1.30", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.30.tgz", + "integrity": "sha512-crmjA4bLtR8m9qLpHvgxSChT+XoSlZi8J4n/aIdn3z92e/U47Z0V/yl+Wh9W046GgFVAmoNR/fmdbZYcSSIUeg==", "requires": { - "mime-db": "~1.38.0" + "mime-db": "1.47.0" } }, "mimic-fn": { @@ -962,22 +880,19 @@ } }, "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" }, "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "requires": { - "minimist": "0.0.8" - } + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" }, "moment": { - "version": "2.24.0", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz", - "integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==" + "version": "2.29.1", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz", + "integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==" }, "mute-stream": { "version": "0.0.8", @@ -1016,19 +931,6 @@ "resolved": "https://registry.npmjs.org/ncp/-/ncp-1.0.1.tgz", "integrity": "sha1-0VNn5cuHQyuhF9K/gP30Wuz7QkY=" }, - "nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" - }, - "npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", - "requires": { - "path-key": "^2.0.0" - } - }, "nth-check": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz", @@ -1119,35 +1021,20 @@ "lcid": "^1.0.0" } }, - "p-defer": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", - "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=" - }, - "p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" - }, - "p-is-promise": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", - "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==" - }, "p-limit": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.2.tgz", - "integrity": "sha512-WGR+xHecKTr7EbUEhyLSh5Dube9JtdiG78ufaeLxTgpudf/20KqyMioIUZJAezlTIi6evxuoUs9YXc11cU+yzQ==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "requires": { "p-try": "^2.0.0" } }, "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "requires": { - "p-limit": "^2.0.0" + "p-limit": "^2.2.0" } }, "p-try": { @@ -1162,24 +1049,19 @@ "optional": true }, "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" - }, "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, "performance-now": { @@ -1212,18 +1094,9 @@ } }, "psl": { - "version": "1.1.31", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz", - "integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==" - }, - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" }, "punycode": { "version": "2.1.1", @@ -1308,16 +1181,17 @@ "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==" }, "require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" }, "resolve": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", - "integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==", + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", + "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", "dev": true, "requires": { + "is-core-module": "^2.2.0", "path-parse": "^1.0.6" } }, @@ -1344,9 +1218,9 @@ } }, "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" }, "safer-buffer": { "version": "2.1.2", @@ -1365,32 +1239,20 @@ "integrity": "sha1-8MgtmKOxOah3aogIBQuCRDEIf8o=" }, "semver": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", - "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==" + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true }, "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "requires": { - "shebang-regex": "^1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" - }, "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==" }, "source-map": { "version": "0.6.1", @@ -1452,11 +1314,6 @@ "ansi-regex": "^2.0.0" } }, - "strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" - }, "supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -1488,29 +1345,41 @@ "optional": true }, "tslib": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", - "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", "dev": true }, "tslint": { - "version": "5.12.1", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.12.1.tgz", - "integrity": "sha512-sfodBHOucFg6egff8d1BvuofoOQ/nOeYNfbp7LDlKBcLNrL3lmS5zoiDGyOMdT7YsEXAwWpTdAHwOGOc8eRZAw==", + "version": "5.20.1", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.20.1.tgz", + "integrity": "sha512-EcMxhzCFt8k+/UP5r8waCf/lzmeSyVlqxqMEDQE7rWYiQky8KpIBz1JAoYXfROHrPZ1XXd43q8yQnULOLiBRQg==", "dev": true, "requires": { - "babel-code-frame": "^6.22.0", + "@babel/code-frame": "^7.0.0", "builtin-modules": "^1.1.1", "chalk": "^2.3.0", "commander": "^2.12.1", - "diff": "^3.2.0", + "diff": "^4.0.1", "glob": "^7.1.1", - "js-yaml": "^3.7.0", + "js-yaml": "^3.13.1", "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", "resolve": "^1.3.2", "semver": "^5.3.0", "tslib": "^1.8.0", - "tsutils": "^2.27.2" + "tsutils": "^2.29.0" + }, + "dependencies": { + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + } } }, "tsutils": { @@ -1545,9 +1414,9 @@ } }, "typescript": { - "version": "2.9.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.9.2.tgz", - "integrity": "sha512-Gr4p6nFNaoufRIY4NMdpQRNmgxVIGMs4Fcu/ujdYk3nAZqk7supzBE9idmvfZIlH/Cuj//dvi+019qEue9lV0w==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.2.tgz", + "integrity": "sha512-zZ4hShnmnoVnAHpVHWpTcxdv7dWP60S2FsydQLV8V5PbS3FifjWFFRiHSWpDJahly88PRyV5teTSLoq4eG7mKw==", "dev": true }, "uc.micro": { @@ -1561,22 +1430,22 @@ "integrity": "sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg==" }, "unescape-js": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/unescape-js/-/unescape-js-1.1.1.tgz", - "integrity": "sha512-2/6CdybfFt9fzYJhCD6SHfBnqCGNfjhMwPK9Pf+sJRloa/WmyAmxdBVOslOIYkvSIRKX+9xGePF5t1tugtZ63g==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/unescape-js/-/unescape-js-1.1.4.tgz", + "integrity": "sha512-42SD8NOQEhdYntEiUQdYq/1V/YHwr1HLwlHuTJB5InVVdOSbgI6xu8jK5q65yIzuFCfczzyDF/7hbGzVbyCw0g==", "requires": { "string.fromcodepoint": "^0.2.1" } }, "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==" }, "uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "requires": { "punycode": "^2.1.0" } @@ -1598,13 +1467,21 @@ "version": "0.9.2", "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=" + }, + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "requires": { + "minimist": "^1.2.5" + } } } }, "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" }, "verror": { "version": "1.10.0", @@ -1617,14 +1494,14 @@ } }, "vsc-leetcode-cli": { - "version": "2.6.22", - "resolved": "https://registry.npmjs.org/vsc-leetcode-cli/-/vsc-leetcode-cli-2.6.22.tgz", - "integrity": "sha512-/mKAQtwabtzZfbQlJO9k9qotx7qgtDFZnZ6TkO3NrfUyne2jTXLzDBN+/66fcXUyX5fpxKYBx81icChGRnT7CQ==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/vsc-leetcode-cli/-/vsc-leetcode-cli-2.8.0.tgz", + "integrity": "sha512-KcFzpk3OZ+wUCoeK1yjBK0hYpJItYd8WFC7pQfE1zxJGjQs4tUvadLI5imKfRjw5NicjNRFnVpVv6N7ig7ik4A==", "requires": { "ansi-styles": "3.2.1", "cheerio": "0.20.0", "he": "1.2.0", - "mkdirp": "0.5.1", + "mkdirp": "^1.0.4", "moment": "^2.20.1", "nconf": "0.10.0", "ora": "3.0.0", @@ -1633,7 +1510,7 @@ "supports-color": "5.5.0", "underscore": "1.9.1", "wordwrap": "1.0.0", - "yargs": "12.0.4" + "yargs": "^15.3.1" } }, "wcwidth": { @@ -1659,14 +1536,6 @@ "tr46": "~0.0.1" } }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "requires": { - "isexe": "^2.0.0" - } - }, "which-module": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", @@ -1740,95 +1609,108 @@ "optional": true }, "y18n": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=" + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz", + "integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==" }, "yargs": { - "version": "12.0.4", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.4.tgz", - "integrity": "sha512-f5esswlPO351AnejaO2A1ZZr0zesz19RehQKwiRDqWtrraWrJy16tsUIKgDXFMVytvNOHPVmTiaTh3wO67I0fQ==", + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", "requires": { - "cliui": "^4.0.0", + "cliui": "^6.0.0", "decamelize": "^1.2.0", - "find-up": "^3.0.0", - "get-caller-file": "^1.0.1", - "os-locale": "^3.0.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", + "require-main-filename": "^2.0.0", "set-blocking": "^2.0.0", - "string-width": "^2.0.0", + "string-width": "^4.2.0", "which-module": "^2.0.0", - "y18n": "^3.2.1 || ^4.0.0", - "yargs-parser": "^11.1.0" + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" }, "dependencies": { "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" }, - "cliui": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" + "color-convert": "^2.0.1" } }, - "invert-kv": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", - "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==" - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" - }, - "lcid": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", - "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", "requires": { - "invert-kv": "^2.0.0" + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" } }, - "os-locale": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", - "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "requires": { - "execa": "^1.0.0", - "lcid": "^2.0.0", - "mem": "^4.0.0" + "color-name": "~1.1.4" } }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + }, "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", + "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" } }, "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", "requires": { - "ansi-regex": "^3.0.0" + "ansi-regex": "^5.0.0" } + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" } } }, "yargs-parser": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", - "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", "requires": { "camelcase": "^5.0.0", "decamelize": "^1.2.0" diff --git a/package.json b/package.json index ddc54134..bcdb5c02 100644 --- a/package.json +++ b/package.json @@ -2,19 +2,19 @@ "name": "vscode-leetcode", "displayName": "LeetCode", "description": "Solve LeetCode problems in VS Code", - "version": "0.16.1", + "version": "0.18.0", "author": "Sheng Chen", - "publisher": "shengchen", + "publisher": "LeetCode", "license": "MIT", "icon": "resources/LeetCode.png", "engines": { - "vscode": "^1.42.0" + "vscode": "^1.57.0" }, "repository": { "type": "git", - "url": "https://github.com/jdneo/vscode-leetcode" + "url": "https://github.com/LeetCode-OpenSource/vscode-leetcode" }, - "homepage": "https://github.com/jdneo/vscode-leetcode/blob/master/README.md", + "homepage": "https://github.com/LeetCode-OpenSource/vscode-leetcode/blob/master/README.md", "categories": [ "Other", "Snippets" @@ -38,6 +38,7 @@ "onCommand:leetcode.testSolution", "onCommand:leetcode.submitSolution", "onCommand:leetcode.switchDefaultLanguage", + "onCommand:leetcode.problems.sort", "onView:leetCodeExplorer" ], "main": "./out/src/extension", @@ -134,6 +135,12 @@ "command": "leetcode.switchDefaultLanguage", "title": "Switch Default Language", "category": "LeetCode" + }, + { + "command": "leetcode.problems.sort", + "title": "Sort Problems", + "category": "LeetCode", + "icon": "$(sort-precedence)" } ], "viewsContainers": { @@ -179,6 +186,11 @@ "command": "leetcode.pickOne", "when": "view == leetCodeExplorer", "group": "overflow@0" + }, + { + "command": "leetcode.problems.sort", + "when": "view == leetCodeExplorer", + "group": "overflow@1" } ], "view/item/context": [ @@ -243,6 +255,11 @@ } ], "editor/context": [ + { + "submenu": "leetcode.editorAction" + } + ], + "leetcode.editorAction": [ { "command": "leetcode.testSolution", "group": "leetcode@1" @@ -261,6 +278,12 @@ } ] }, + "submenus": [ + { + "id": "leetcode.editorAction", + "label": "LeetCode" + } + ], "configuration": [ { "title": "LeetCode", @@ -295,7 +318,8 @@ "ruby", "rust", "scala", - "swift" + "swift", + "typescript" ], "scope": "application", "description": "Default language for solving the problems." @@ -363,6 +387,12 @@ ], "description": "Endpoint of the user account." }, + "leetcode.useEndpointTranslation": { + "type": "boolean", + "default": true, + "scope": "application", + "description": "Use endpoint's translation (if available)" + }, "leetcode.workspaceFolder": { "type": "string", "scope": "application", @@ -628,11 +658,19 @@ "enum": [ "submit", "test", + "star", "solution", "description" + ], + "enumDescriptions": [ + "Submit your answer to LeetCode.", + "Test your answer with customized test cases.", + "Star or unstar the current problem.", + "Show the top voted solution for the current problem.", + "Show the problem description page." ] }, - "description": "Customize the shorcuts in editors." + "description": "Customize the shortcuts in editors." }, "leetcode.enableSideMode": { "type": "boolean", @@ -645,6 +683,23 @@ "default": "node", "scope": "application", "description": "The Node.js executable path. for example, C:\\Program Files\\nodejs\\node.exe" + }, + "leetcode.colorizeProblems": { + "type": "boolean", + "default": true, + "scope": "application", + "description": "Add difficulty badge and colorize problems files in explorer tree." + }, + "leetcode.problems.sortStrategy": { + "type": "string", + "default": "None", + "scope": "application", + "enum": [ + "None", + "Acceptance Rate (Ascending)", + "Acceptance Rate (Descending)" + ], + "description": "Sorting strategy for problems list." } } } @@ -657,24 +712,23 @@ "lint": "tslint --project tsconfig.json -e src/*.d.ts -t verbose" }, "devDependencies": { - "@types/fs-extra": "5.0.0", - "@types/highlight.js": "^9.12.3", - "@types/lodash": "^4.14.123", + "@types/fs-extra": "^9.0.11", + "@types/lodash": "^4.14.170", "@types/markdown-it": "0.0.7", "@types/mocha": "^2.2.42", - "@types/node": "^7.0.43", - "@types/vscode": "1.42.0", + "@types/node": "^14.14.33", "@types/require-from-string": "^1.2.0", - "tslint": "^5.9.1", - "typescript": "^2.6.1" + "@types/vscode": "1.57.0", + "tslint": "^5.20.1", + "typescript": "^4.3.2" }, "dependencies": { - "fs-extra": "^6.0.1", - "highlight.js": "^9.15.6", - "lodash": "^4.17.13", + "fs-extra": "^10.0.0", + "highlight.js": "^10.7.2", + "lodash": "^4.17.21", "markdown-it": "^8.4.2", "require-from-string": "^2.0.2", - "unescape-js": "^1.1.1", - "vsc-leetcode-cli": "2.6.22" + "unescape-js": "^1.1.4", + "vsc-leetcode-cli": "2.8.0" } } diff --git a/resources/LeetCode.png b/resources/LeetCode.png index d068e697..35461b5f 100644 Binary files a/resources/LeetCode.png and b/resources/LeetCode.png differ diff --git a/resources/LeetCode.svg b/resources/LeetCode.svg index a3bac1f0..3a80c1b4 100644 --- a/resources/LeetCode.svg +++ b/resources/LeetCode.svg @@ -1,11 +1,9 @@ - - - Combined Shape - Created with Sketch. - - - + + LeetCode + + + \ No newline at end of file diff --git a/resources/check.png b/resources/check.png index ad7077df..84d2d100 100644 Binary files a/resources/check.png and b/resources/check.png differ diff --git a/resources/dark/dislike.png b/resources/dark/dislike.png index 4a4fe020..47f17c57 100644 Binary files a/resources/dark/dislike.png and b/resources/dark/dislike.png differ diff --git a/resources/dark/like.png b/resources/dark/like.png index 613fccd4..d7789612 100644 Binary files a/resources/dark/like.png and b/resources/dark/like.png differ diff --git a/resources/light/dislike.png b/resources/light/dislike.png index b514f0f3..4ced195d 100644 Binary files a/resources/light/dislike.png and b/resources/light/dislike.png differ diff --git a/resources/light/like.png b/resources/light/like.png index 0f7081d2..92b845de 100644 Binary files a/resources/light/like.png and b/resources/light/like.png differ diff --git a/resources/lock.png b/resources/lock.png index 8c6fa7fd..c9ce3774 100644 Binary files a/resources/lock.png and b/resources/lock.png differ diff --git a/resources/x.png b/resources/x.png index 57709cdb..64a5fc7e 100644 Binary files a/resources/x.png and b/resources/x.png differ diff --git a/src/codelens/CodeLensController.ts b/src/codelens/CodeLensController.ts index 8e2fa3c9..b41f28f0 100644 --- a/src/codelens/CodeLensController.ts +++ b/src/codelens/CodeLensController.ts @@ -2,7 +2,7 @@ // Licensed under the MIT license. import { ConfigurationChangeEvent, Disposable, languages, workspace } from "vscode"; -import { CustomCodeLensProvider } from "./CustomCodeLensProvider"; +import { customCodeLensProvider, CustomCodeLensProvider } from "./CustomCodeLensProvider"; class CodeLensController implements Disposable { private internalProvider: CustomCodeLensProvider; @@ -10,7 +10,7 @@ class CodeLensController implements Disposable { private configurationChangeListener: Disposable; constructor() { - this.internalProvider = new CustomCodeLensProvider(); + this.internalProvider = customCodeLensProvider; this.configurationChangeListener = workspace.onDidChangeConfiguration((event: ConfigurationChangeEvent) => { if (event.affectsConfiguration("leetcode.editor.shortcuts")) { diff --git a/src/codelens/CustomCodeLensProvider.ts b/src/codelens/CustomCodeLensProvider.ts index 4764e999..4b9b6491 100644 --- a/src/codelens/CustomCodeLensProvider.ts +++ b/src/codelens/CustomCodeLensProvider.ts @@ -2,6 +2,8 @@ // Licensed under the MIT license. import * as vscode from "vscode"; +import { explorerNodeManager } from "../explorer/explorerNodeManager"; +import { LeetCodeNode } from "../explorer/LeetCodeNode"; import { getEditorShortcuts } from "../utils/settingUtils"; export class CustomCodeLensProvider implements vscode.CodeLensProvider { @@ -23,10 +25,15 @@ export class CustomCodeLensProvider implements vscode.CodeLensProvider { } const content: string = document.getText(); - const matchResult: RegExpMatchArray | null = content.match(/@lc app=.* id=.* lang=.*/); + const matchResult: RegExpMatchArray | null = content.match(/@lc app=.* id=(.*) lang=.*/); if (!matchResult) { return undefined; } + const nodeId: string | undefined = matchResult[1]; + let node: LeetCodeNode | undefined; + if (nodeId) { + node = explorerNodeManager.getNodeById(nodeId); + } let codeLensLine: number = document.lineCount - 1; for (let i: number = document.lineCount - 1; i >= 0; i--) { @@ -56,6 +63,14 @@ export class CustomCodeLensProvider implements vscode.CodeLensProvider { })); } + if (shortcuts.indexOf("star") >= 0 && node) { + codeLens.push(new vscode.CodeLens(range, { + title: node.isFavorite ? "Unstar" : "Star", + command: node.isFavorite ? "leetcode.removeFavorite" : "leetcode.addFavorite", + arguments: [node], + })); + } + if (shortcuts.indexOf("solution") >= 0) { codeLens.push(new vscode.CodeLens(range, { title: "Solution", @@ -75,3 +90,5 @@ export class CustomCodeLensProvider implements vscode.CodeLensProvider { return codeLens; } } + +export const customCodeLensProvider: CustomCodeLensProvider = new CustomCodeLensProvider(); diff --git a/src/commands/list.ts b/src/commands/list.ts index 5cb44137..7e7b36a7 100644 --- a/src/commands/list.ts +++ b/src/commands/list.ts @@ -5,6 +5,7 @@ import * as vscode from "vscode"; import { leetCodeExecutor } from "../leetCodeExecutor"; import { leetCodeManager } from "../leetCodeManager"; import { IProblem, ProblemState, UserStatus } from "../shared"; +import * as settingUtils from "../utils/settingUtils"; import { DialogType, promptForOpenOutputChannel } from "../utils/uiUtils"; export async function listProblems(): Promise { @@ -14,7 +15,8 @@ export async function listProblems(): Promise { } const leetCodeConfig: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration("leetcode"); const showLocked: boolean = !!leetCodeConfig.get("showLocked"); - const result: string = await leetCodeExecutor.listProblems(showLocked); + const useEndpointTranslation: boolean = settingUtils.shouldUseEndpointTranslation(); + const result: string = await leetCodeExecutor.listProblems(showLocked, useEndpointTranslation); const problems: IProblem[] = []; const lines: string[] = result.split("\n"); const reg: RegExp = /^(.)\s(.{1,2})\s(.)\s\[\s*(\d*)\s*\]\s*(.*)\s*(Easy|Medium|Hard)\s*\((\s*\d+\.\d+ %)\)/; diff --git a/src/commands/plugin.ts b/src/commands/plugin.ts index 481bd6dd..040f8321 100644 --- a/src/commands/plugin.ts +++ b/src/commands/plugin.ts @@ -2,9 +2,10 @@ // Licensed under the MIT license. import * as vscode from "vscode"; +import { leetCodeTreeDataProvider } from "../explorer/LeetCodeTreeDataProvider"; import { leetCodeExecutor } from "../leetCodeExecutor"; import { IQuickItemEx } from "../shared"; -import { Endpoint } from "../shared"; +import { Endpoint, SortingStrategy } from "../shared"; import { DialogType, promptForOpenOutputChannel, promptForSignIn } from "../utils/uiUtils"; import { deleteCache } from "./cache"; @@ -52,3 +53,36 @@ export function getLeetCodeEndpoint(): string { const leetCodeConfig: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration("leetcode"); return leetCodeConfig.get("endpoint", Endpoint.LeetCode); } + +const SORT_ORDER: SortingStrategy[] = [ + SortingStrategy.None, + SortingStrategy.AcceptanceRateAsc, + SortingStrategy.AcceptanceRateDesc, +]; + +export async function switchSortingStrategy(): Promise { + const currentStrategy: SortingStrategy = getSortingStrategy(); + const picks: Array> = []; + picks.push( + ...SORT_ORDER.map((s: SortingStrategy) => { + return { + label: `${currentStrategy === s ? "$(check)" : " "} ${s}`, + value: s, + }; + }), + ); + + const choice: IQuickItemEx | undefined = await vscode.window.showQuickPick(picks); + if (!choice || choice.value === currentStrategy) { + return; + } + + const leetCodeConfig: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration("leetcode"); + await leetCodeConfig.update("problems.sortStrategy", choice.value, true); + await leetCodeTreeDataProvider.refresh(); +} + +export function getSortingStrategy(): SortingStrategy { + const leetCodeConfig: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration("leetcode"); + return leetCodeConfig.get("problems.sortStrategy", SortingStrategy.None); +} diff --git a/src/commands/show.ts b/src/commands/show.ts index 70474426..3aebce8f 100644 --- a/src/commands/show.ts +++ b/src/commands/show.ts @@ -41,8 +41,8 @@ export async function previewProblem(input: IProblem | vscode.Uri, isSideMode: b } else { node = input; } - - const descString: string = await leetCodeExecutor.getDescription(node.id); + const needTranslation: boolean = settingUtils.shouldUseEndpointTranslation(); + const descString: string = await leetCodeExecutor.getDescription(node.id, needTranslation); leetCodePreviewProvider.show(descString, node, isSideMode); } @@ -97,7 +97,8 @@ export async function showSolution(input: LeetCodeNode | vscode.Uri): Promise { finalPath = wsl.useWsl() ? await wsl.toWinPath(finalPath) : finalPath; const descriptionConfig: IDescriptionConfiguration = settingUtils.getDescriptionConfiguration(); - await leetCodeExecutor.showProblem(node, language, finalPath, descriptionConfig.showInComment); + const needTranslation: boolean = settingUtils.shouldUseEndpointTranslation(); + + await leetCodeExecutor.showProblem(node, language, finalPath, descriptionConfig.showInComment, needTranslation); const promises: any[] = [ vscode.window.showTextDocument(vscode.Uri.file(finalPath), { preview: false, viewColumn: vscode.ViewColumn.One }), promptHintMessage( diff --git a/src/commands/star.ts b/src/commands/star.ts index baae0b07..36611499 100644 --- a/src/commands/star.ts +++ b/src/commands/star.ts @@ -2,15 +2,20 @@ // Copyright (c) jdneo. All rights reserved. // Licensed under the MIT license. +import { customCodeLensProvider } from "../codelens/CustomCodeLensProvider"; import { LeetCodeNode } from "../explorer/LeetCodeNode"; import { leetCodeTreeDataProvider } from "../explorer/LeetCodeTreeDataProvider"; import { leetCodeExecutor } from "../leetCodeExecutor"; +import { hasStarShortcut } from "../utils/settingUtils"; import { DialogType, promptForOpenOutputChannel } from "../utils/uiUtils"; export async function addFavorite(node: LeetCodeNode): Promise { try { await leetCodeExecutor.toggleFavorite(node, true); - leetCodeTreeDataProvider.refresh(); + await leetCodeTreeDataProvider.refresh(); + if (hasStarShortcut()) { + customCodeLensProvider.refresh(); + } } catch (error) { await promptForOpenOutputChannel("Failed to add the problem to favorite. Please open the output channel for details.", DialogType.error); } @@ -19,7 +24,10 @@ export async function addFavorite(node: LeetCodeNode): Promise { export async function removeFavorite(node: LeetCodeNode): Promise { try { await leetCodeExecutor.toggleFavorite(node, false); - leetCodeTreeDataProvider.refresh(); + await leetCodeTreeDataProvider.refresh(); + if (hasStarShortcut()) { + customCodeLensProvider.refresh(); + } } catch (error) { await promptForOpenOutputChannel("Failed to remove the problem from favorite. Please open the output channel for details.", DialogType.error); } diff --git a/src/explorer/LeetCodeNode.ts b/src/explorer/LeetCodeNode.ts index 67aad324..3d2cc74f 100644 --- a/src/explorer/LeetCodeNode.ts +++ b/src/explorer/LeetCodeNode.ts @@ -1,7 +1,7 @@ // Copyright (c) jdneo. All rights reserved. // Licensed under the MIT license. -import { Command } from "vscode"; +import { Command, Uri } from "vscode"; import { IProblem, ProblemState } from "../shared"; export class LeetCodeNode { @@ -55,4 +55,17 @@ export class LeetCodeNode { }; } + public get acceptanceRate(): number { + return Number(this.passRate.slice(0, -1).trim()); + } + + public get uri(): Uri { + return Uri.from({ + scheme: "leetcode", + authority: this.isProblem ? "problems" : "tree-node", + path: `/${this.id}`, // path must begin with slash / + query: `difficulty=${this.difficulty}`, + }); + } + } diff --git a/src/explorer/LeetCodeTreeDataProvider.ts b/src/explorer/LeetCodeTreeDataProvider.ts index 69445bbb..4764934a 100644 --- a/src/explorer/LeetCodeTreeDataProvider.ts +++ b/src/explorer/LeetCodeTreeDataProvider.ts @@ -23,7 +23,7 @@ export class LeetCodeTreeDataProvider implements vscode.TreeDataProvider { await explorerNodeManager.refreshCache(); - this.onDidChangeTreeDataEvent.fire(); + this.onDidChangeTreeDataEvent.fire(null); } public getTreeItem(element: LeetCodeNode): vscode.TreeItem | Thenable { @@ -51,6 +51,7 @@ export class LeetCodeTreeDataProvider implements vscode.TreeDataProvider { + if (!this.isDifficultyBadgeEnabled()) { + return; + } + + if (uri.scheme !== "leetcode" && uri.authority !== "problems") { + return; + } + + const params: URLSearchParams = new URLSearchParams(uri.query); + const difficulty: string = params.get("difficulty")!.toLowerCase(); + return { + badge: this.DIFFICULTY_BADGE_LABEL[difficulty], + color: this.ITEM_COLOR[difficulty], + }; + } + + private isDifficultyBadgeEnabled(): boolean { + const configuration: WorkspaceConfiguration = workspace.getConfiguration(); + return configuration.get("leetcode.colorizeProblems", false); + } +} + +export const leetCodeTreeItemDecorationProvider: LeetCodeTreeItemDecorationProvider = new LeetCodeTreeItemDecorationProvider(); diff --git a/src/explorer/explorerNodeManager.ts b/src/explorer/explorerNodeManager.ts index 95053263..a04ad55c 100644 --- a/src/explorer/explorerNodeManager.ts +++ b/src/explorer/explorerNodeManager.ts @@ -4,7 +4,8 @@ import * as _ from "lodash"; import { Disposable } from "vscode"; import * as list from "../commands/list"; -import { Category, defaultProblem, ProblemState } from "../shared"; +import { getSortingStrategy } from "../commands/plugin"; +import { Category, defaultProblem, ProblemState, SortingStrategy } from "../shared"; import { shouldHideSolvedProblem } from "../utils/settingUtils"; import { LeetCodeNode } from "./LeetCodeNode"; @@ -56,7 +57,9 @@ class ExplorerNodeManager implements Disposable { } public getAllNodes(): LeetCodeNode[] { - return Array.from(this.explorerNodeMap.values()); + return this.applySortingStrategy( + Array.from(this.explorerNodeMap.values()), + ); } public getAllDifficultyNodes(): LeetCodeNode[] { @@ -114,7 +117,7 @@ class ExplorerNodeManager implements Disposable { res.push(node); } } - return res; + return this.applySortingStrategy(res); } public getChildrenNodesById(id: string): LeetCodeNode[] { @@ -142,7 +145,7 @@ class ExplorerNodeManager implements Disposable { break; } } - return res; + return this.applySortingStrategy(res); } public dispose(): void { @@ -186,6 +189,15 @@ class ExplorerNodeManager implements Disposable { break; } } + + private applySortingStrategy(nodes: LeetCodeNode[]): LeetCodeNode[] { + const strategy: SortingStrategy = getSortingStrategy(); + switch (strategy) { + case SortingStrategy.AcceptanceRateAsc: return nodes.sort((x: LeetCodeNode, y: LeetCodeNode) => Number(x.acceptanceRate) - Number(y.acceptanceRate)); + case SortingStrategy.AcceptanceRateDesc: return nodes.sort((x: LeetCodeNode, y: LeetCodeNode) => Number(y.acceptanceRate) - Number(x.acceptanceRate)); + default: return nodes; + } + } } export const explorerNodeManager: ExplorerNodeManager = new ExplorerNodeManager(); diff --git a/src/extension.ts b/src/extension.ts index 9bb3ad41..dfd91683 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -14,6 +14,7 @@ import * as test from "./commands/test"; import { explorerNodeManager } from "./explorer/explorerNodeManager"; import { LeetCodeNode } from "./explorer/LeetCodeNode"; import { leetCodeTreeDataProvider } from "./explorer/LeetCodeTreeDataProvider"; +import { leetCodeTreeItemDecorationProvider } from "./explorer/LeetCodeTreeItemDecorationProvider"; import { leetCodeChannel } from "./leetCodeChannel"; import { leetCodeExecutor } from "./leetCodeExecutor"; import { leetCodeManager } from "./leetCodeManager"; @@ -26,7 +27,7 @@ import { markdownEngine } from "./webview/markdownEngine"; export async function activate(context: vscode.ExtensionContext): Promise { try { - if (!await leetCodeExecutor.meetRequirements()) { + if (!await leetCodeExecutor.meetRequirements(context)) { throw new Error("The environment doesn't meet requirements."); } @@ -47,6 +48,7 @@ export async function activate(context: vscode.ExtensionContext): Promise markdownEngine, codeLensController, explorerNodeManager, + vscode.window.registerFileDecorationProvider(leetCodeTreeItemDecorationProvider), vscode.window.createTreeView("leetCodeExplorer", { treeDataProvider: leetCodeTreeDataProvider, showCollapseAll: true }), vscode.commands.registerCommand("leetcode.deleteCache", () => cache.deleteCache()), vscode.commands.registerCommand("leetcode.toggleLeetCodeCn", () => plugin.switchEndpoint()), @@ -64,6 +66,7 @@ export async function activate(context: vscode.ExtensionContext): Promise vscode.commands.registerCommand("leetcode.switchDefaultLanguage", () => switchDefaultLanguage()), vscode.commands.registerCommand("leetcode.addFavorite", (node: LeetCodeNode) => star.addFavorite(node)), vscode.commands.registerCommand("leetcode.removeFavorite", (node: LeetCodeNode) => star.removeFavorite(node)), + vscode.commands.registerCommand("leetcode.problems.sort", () => plugin.switchSortingStrategy()), ); await leetCodeExecutor.switchEndpoint(plugin.getLeetCodeEndpoint()); diff --git a/src/leetCodeExecutor.ts b/src/leetCodeExecutor.ts index 4c0aa312..d2332c7a 100644 --- a/src/leetCodeExecutor.ts +++ b/src/leetCodeExecutor.ts @@ -3,10 +3,12 @@ import * as cp from "child_process"; import * as fse from "fs-extra"; +import * as os from "os"; import * as path from "path"; import * as requireFromString from "require-from-string"; +import { ExtensionContext } from "vscode"; import { ConfigurationChangeEvent, Disposable, MessageItem, window, workspace, WorkspaceConfiguration } from "vscode"; -import { Endpoint, IProblem, supportedPlugins } from "./shared"; +import { Endpoint, IProblem, leetcodeHasInited, supportedPlugins } from "./shared"; import { executeCommand, executeCommandWithProgress } from "./utils/cpUtils"; import { DialogOptions, openUrl } from "./utils/uiUtils"; import * as wsl from "./utils/wslUtils"; @@ -34,7 +36,11 @@ class LeetCodeExecutor implements Disposable { return `"${path.join(this.leetCodeRootPath, "bin", "leetcode")}"`; } - public async meetRequirements(): Promise { + public async meetRequirements(context: ExtensionContext): Promise { + const hasInited: boolean | undefined = context.globalState.get(leetcodeHasInited); + if (!hasInited) { + await this.removeOldCache(); + } if (this.nodeExecutable !== "node") { if (!await fse.pathExists(this.nodeExecutable)) { throw new Error(`The Node.js executable does not exist on path ${this.nodeExecutable}`); @@ -60,10 +66,13 @@ class LeetCodeExecutor implements Disposable { for (const plugin of supportedPlugins) { try { // Check plugin await this.executeCommandEx(this.nodeExecutable, [await this.getLeetCodeBinaryPath(), "plugin", "-e", plugin]); - } catch (error) { // Download plugin and activate + } catch (error) { // Remove old cache that may cause the error download plugin and activate + await this.removeOldCache(); await this.executeCommandEx(this.nodeExecutable, [await this.getLeetCodeBinaryPath(), "plugin", "-i", plugin]); } } + // Set the global state HasInited true to skip delete old cache after init + context.globalState.update(leetcodeHasInited, true); return true; } @@ -76,33 +85,65 @@ class LeetCodeExecutor implements Disposable { } public async signOut(): Promise { - return await await this.executeCommandEx(this.nodeExecutable, [await this.getLeetCodeBinaryPath(), "user", "-L"]); + return await this.executeCommandEx(this.nodeExecutable, [await this.getLeetCodeBinaryPath(), "user", "-L"]); } - public async listProblems(showLocked: boolean): Promise { - return await this.executeCommandEx(this.nodeExecutable, showLocked ? - [await this.getLeetCodeBinaryPath(), "list"] : - [await this.getLeetCodeBinaryPath(), "list", "-q", "L"], - ); + public async listProblems(showLocked: boolean, needTranslation: boolean): Promise { + const cmd: string[] = [await this.getLeetCodeBinaryPath(), "list"]; + if (!needTranslation) { + cmd.push("-T"); // use -T to prevent translation + } + if (!showLocked) { + cmd.push("-q"); + cmd.push("L"); + } + return await this.executeCommandEx(this.nodeExecutable, cmd); } - public async showProblem(problemNode: IProblem, language: string, filePath: string, showDescriptionInComment: boolean = false): Promise { + public async showProblem(problemNode: IProblem, language: string, filePath: string, showDescriptionInComment: boolean = false, needTranslation: boolean): Promise { const templateType: string = showDescriptionInComment ? "-cx" : "-c"; + const cmd: string[] = [await this.getLeetCodeBinaryPath(), "show", problemNode.id, templateType, "-l", language]; + + if (!needTranslation) { + cmd.push("-T"); // use -T to force English version + } if (!await fse.pathExists(filePath)) { await fse.createFile(filePath); - const codeTemplate: string = await this.executeCommandWithProgressEx("Fetching problem data...", this.nodeExecutable, [await this.getLeetCodeBinaryPath(), "show", problemNode.id, templateType, "-l", language]); + const codeTemplate: string = await this.executeCommandWithProgressEx("Fetching problem data...", this.nodeExecutable, cmd); await fse.writeFile(filePath, codeTemplate); } } - public async showSolution(input: string, language: string): Promise { - const solution: string = await this.executeCommandWithProgressEx("Fetching top voted solution from discussions...", this.nodeExecutable, [await this.getLeetCodeBinaryPath(), "show", input, "--solution", "-l", language]); + /** + * This function returns solution of a problem identified by input + * + * @remarks + * Even though this function takes the needTranslation flag, it is important to note + * that as of vsc-leetcode-cli 2.8.0, leetcode-cli doesn't support querying solution + * on CN endpoint yet. So this flag doesn't have any effect right now. + * + * @param input - parameter to pass to cli that can identify a problem + * @param language - the source code language of the solution desired + * @param needTranslation - whether or not to use endPoint translation on solution query + * @returns promise of the solution string + */ + public async showSolution(input: string, language: string, needTranslation: boolean): Promise { + // solution don't support translation + const cmd: string[] = [await this.getLeetCodeBinaryPath(), "show", input, "--solution", "-l", language]; + if (!needTranslation) { + cmd.push("-T"); + } + const solution: string = await this.executeCommandWithProgressEx("Fetching top voted solution from discussions...", this.nodeExecutable, cmd); return solution; } - public async getDescription(problemNodeId: string): Promise { - return await this.executeCommandWithProgressEx("Fetching problem description...", this.nodeExecutable, [await this.getLeetCodeBinaryPath(), "show", problemNodeId, "-x"]); + public async getDescription(problemNodeId: string, needTranslation: boolean): Promise { + const cmd: string[] = [await this.getLeetCodeBinaryPath(), "show", problemNodeId, "-x"]; + if (!needTranslation) { + cmd.push("-T"); + } + return await this.executeCommandWithProgressEx("Fetching problem description...", this.nodeExecutable, cmd); } public async listSessions(): Promise { @@ -194,6 +235,14 @@ class LeetCodeExecutor implements Disposable { } return await executeCommandWithProgress(message, command, args, options); } + + private async removeOldCache(): Promise { + const oldPath: string = path.join(os.homedir(), ".lc"); + if (await fse.pathExists(oldPath)) { + await fse.remove(oldPath); + } + } + } export const leetCodeExecutor: LeetCodeExecutor = new LeetCodeExecutor(); diff --git a/src/leetCodeManager.ts b/src/leetCodeManager.ts index 44be87a9..089390d3 100644 --- a/src/leetCodeManager.ts +++ b/src/leetCodeManager.ts @@ -83,7 +83,7 @@ class LeetCodeManager extends EventEmitter { env: createEnvOption(), }); - childProc.stdout.on("data", async (data: string | Buffer) => { + childProc.stdout?.on("data", async (data: string | Buffer) => { data = data.toString(); leetCodeChannel.append(data); if (data.includes("twoFactorCode")) { @@ -96,19 +96,19 @@ class LeetCodeManager extends EventEmitter { childProc.kill(); return resolve(undefined); } - childProc.stdin.write(`${twoFactor}\n`); + childProc.stdin?.write(`${twoFactor}\n`); } const successMatch: RegExpMatchArray | null = data.match(this.successRegex); if (successMatch && successMatch[1]) { - childProc.stdin.end(); + childProc.stdin?.end(); return resolve(successMatch[1]); } else if (data.match(this.failRegex)) { - childProc.stdin.end(); + childProc.stdin?.end(); return reject(new Error("Faile to login")); } }); - childProc.stderr.on("data", (data: string | Buffer) => leetCodeChannel.append(data.toString())); + childProc.stderr?.on("data", (data: string | Buffer) => leetCodeChannel.append(data.toString())); childProc.on("error", reject); const name: string | undefined = await vscode.window.showInputBox({ @@ -120,7 +120,7 @@ class LeetCodeManager extends EventEmitter { childProc.kill(); return resolve(undefined); } - childProc.stdin.write(`${name}\n`); + childProc.stdin?.write(`${name}\n`); const pwd: string | undefined = await vscode.window.showInputBox({ prompt: isByCookie ? "Enter cookie" : "Enter password.", password: true, @@ -131,7 +131,7 @@ class LeetCodeManager extends EventEmitter { childProc.kill(); return resolve(undefined); } - childProc.stdin.write(`${pwd}\n`); + childProc.stdin?.write(`${pwd}\n`); }); if (userName) { vscode.window.showInformationMessage(`Successfully ${inMessage}.`); diff --git a/src/shared.ts b/src/shared.ts index d9d156d8..84b529cc 100644 --- a/src/shared.ts +++ b/src/shared.ts @@ -36,6 +36,7 @@ export const languages: string[] = [ "rust", "scala", "swift", + "typescript", ]; export const langExt: Map = new Map([ @@ -55,6 +56,7 @@ export const langExt: Map = new Map([ ["rust", "rs"], ["scala", "scala"], ["swift", "swift"], + ["typescript", "ts"], ]); export enum ProblemState { @@ -112,3 +114,13 @@ export enum DescriptionConfiguration { Both = "Both", None = "None", } + +export const leetcodeHasInited: string = "leetcode.hasInited"; + +export enum SortingStrategy { + None = "None", + AcceptanceRateAsc = "Acceptance Rate (Ascending)", + AcceptanceRateDesc = "Acceptance Rate (Descending)", + FrequencyAsc = "Frequency (Ascending)", + FrequencyDesc = "Frequency (Descending)", +} diff --git a/src/utils/cpUtils.ts b/src/utils/cpUtils.ts index 59e907b6..c71ae61c 100644 --- a/src/utils/cpUtils.ts +++ b/src/utils/cpUtils.ts @@ -15,13 +15,13 @@ export async function executeCommand(command: string, args: string[], options: c const childProc: cp.ChildProcess = cp.spawn(command, args, { ...options, env: createEnvOption() }); - childProc.stdout.on("data", (data: string | Buffer) => { + childProc.stdout?.on("data", (data: string | Buffer) => { data = data.toString(); result = result.concat(data); leetCodeChannel.append(data); }); - childProc.stderr.on("data", (data: string | Buffer) => leetCodeChannel.append(data.toString())); + childProc.stderr?.on("data", (data: string | Buffer) => leetCodeChannel.append(data.toString())); childProc.on("error", reject); @@ -42,7 +42,7 @@ export async function executeCommand(command: string, args: string[], options: c export async function executeCommandWithProgress(message: string, command: string, args: string[], options: cp.SpawnOptions = { shell: true }): Promise { let result: string = ""; await vscode.window.withProgress({ location: vscode.ProgressLocation.Notification }, async (p: vscode.Progress<{}>) => { - return new Promise(async (resolve: () => void, reject: (e: Error) => void): Promise => { + return new Promise(async (resolve: () => void, reject: (e: Error) => void): Promise => { p.report({ message }); try { result = await executeCommand(command, args, options); diff --git a/src/utils/settingUtils.ts b/src/utils/settingUtils.ts index 8c94a95f..7b6eb6c2 100644 --- a/src/utils/settingUtils.ts +++ b/src/utils/settingUtils.ts @@ -20,6 +20,15 @@ export function getEditorShortcuts(): string[] { return getWorkspaceConfiguration().get("editor.shortcuts", ["submit", "test"]); } +export function hasStarShortcut(): boolean { + const shortcuts: string[] = getWorkspaceConfiguration().get("editor.shortcuts", ["submit", "test"]); + return shortcuts.indexOf("star") >= 0; +} + +export function shouldUseEndpointTranslation(): boolean { + return getWorkspaceConfiguration().get("useEndpointTranslation", true); +} + export function getDescriptionConfiguration(): IDescriptionConfiguration { const setting: string = getWorkspaceConfiguration().get("showDescription", DescriptionConfiguration.InWebView); const config: IDescriptionConfiguration = { diff --git a/src/utils/workspaceUtils.ts b/src/utils/workspaceUtils.ts index c129f8db..48105d5a 100644 --- a/src/utils/workspaceUtils.ts +++ b/src/utils/workspaceUtils.ts @@ -1,6 +1,7 @@ // Copyright (c) jdneo. All rights reserved. // Licensed under the MIT license. +import * as fse from "fs-extra"; import * as os from "os"; import * as path from "path"; import * as vscode from "vscode"; @@ -18,9 +19,9 @@ export async function selectWorkspaceFolder(): Promise { return workspaceFolderSetting; } } - const workspaceFolders: vscode.WorkspaceFolder[] = vscode.workspace.workspaceFolders || []; let needAsk: boolean = true; - for (const folder of workspaceFolders) { + await fse.ensureDir(workspaceFolderSetting); + for (const folder of vscode.workspace.workspaceFolders || []) { if (isSubFolder(folder.uri.fsPath, workspaceFolderSetting)) { needAsk = false; } @@ -37,6 +38,7 @@ export async function selectWorkspaceFolder(): Promise { { placeHolder: "The LeetCode workspace folder is not opened in VS Code, would you like to open it?" }, ); + // Todo: generate file first switch (choice) { case OpenOption.justOpenFile: return workspaceFolderSetting; @@ -47,7 +49,7 @@ export async function selectWorkspaceFolder(): Promise { await vscode.commands.executeCommand("vscode.openFolder", vscode.Uri.file(workspaceFolderSetting), true); return ""; case OpenOption.addToWorkspace: - vscode.workspace.updateWorkspaceFolders(workspaceFolders.length, 0, { uri: vscode.Uri.file(workspaceFolderSetting) }); + vscode.workspace.updateWorkspaceFolders(vscode.workspace.workspaceFolders?.length ?? 0, 0, { uri: vscode.Uri.file(workspaceFolderSetting) }); break; default: return ""; diff --git a/src/webview/leetCodePreviewProvider.ts b/src/webview/leetCodePreviewProvider.ts index fba17728..78b40991 100644 --- a/src/webview/leetCodePreviewProvider.ts +++ b/src/webview/leetCodePreviewProvider.ts @@ -130,8 +130,6 @@ class LeetCodePreviewProvider extends LeetCodeWebview { protected onDidDisposeWebview(): void { super.onDidDisposeWebview(); - delete this.node; - delete this.description; this.sideMode = false; } diff --git a/src/webview/leetCodeSolutionProvider.ts b/src/webview/leetCodeSolutionProvider.ts index d888b3bd..1fad6e22 100644 --- a/src/webview/leetCodeSolutionProvider.ts +++ b/src/webview/leetCodeSolutionProvider.ts @@ -64,7 +64,6 @@ class LeetCodeSolutionProvider extends LeetCodeWebview { protected onDidDisposeWebview(): void { super.onDidDisposeWebview(); - delete this.solution; } private parseSolution(raw: string): Solution { diff --git a/src/webview/leetCodeSubmissionProvider.ts b/src/webview/leetCodeSubmissionProvider.ts index f4f18fd4..62d07291 100644 --- a/src/webview/leetCodeSubmissionProvider.ts +++ b/src/webview/leetCodeSubmissionProvider.ts @@ -59,7 +59,6 @@ class LeetCodeSubmissionProvider extends LeetCodeWebview { protected onDidDisposeWebview(): void { super.onDidDisposeWebview(); - delete this.result; } private async showKeybindingsHint(): Promise { diff --git a/thirdpartynotice.txt b/thirdpartynotice.txt index 1f33cded..93c1b0f0 100644 --- a/thirdpartynotice.txt +++ b/thirdpartynotice.txt @@ -11,6 +11,7 @@ are grateful to these developers for their contribution to open source. 4. lodash (https://github.com/lodash/lodash) 5. markdown-it (https://github.com/markdown-it/markdown-it) 6. leetcode-cli (https://github.com/skygragon/leetcode-cli) +7. unescape-js (https://github.com/iamakulov/unescape-js) fs-extra NOTICES BEGIN HERE ============================= @@ -205,3 +206,31 @@ SOFTWARE. END OF leetcode-cli NOTICES AND INFORMATION ================================== + +unescape-js NOTICES BEGIN HERE +============================= + +The MIT License (MIT) + +Copyright (c) Ivan Akulov (http://iamakulov.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +END OF unescape-js NOTICES AND INFORMATION +==================================