Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb5a6396

Browse files
authored
Update the readme (LeetCode-OpenSource#98)
1 parentd9dc046 commitb5a6396

20 files changed

+237
-121
lines changed

‎.vscodeignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ tsconfig.json
1111
tslint.json
1212
**/*.gif
1313
ACKNOWLEDGEMENTS.md
14+
docs

‎README.md

Lines changed: 105 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,116 @@
11
#LeetCode
2-
[![Travis CI](https://travis-ci.org/jdneo/vscode-leetcode.svg?branch=master)](https://travis-ci.org/jdneo/vscode-leetcode)
3-
[![Marketplace Version](https://vsmarketplacebadge.apphb.com/version-short/shengchen.vscode-leetcode.svg)](https://marketplace.visualstudio.com/items?itemName=shengchen.vscode-leetcode)
4-
[![license](https://img.shields.io/github/license/jdneo/vscode-leetcode.svg)](https://github.com/jdneo/vscode-leetcode/blob/master/LICENSE)
5-
[![Gitter](https://badges.gitter.im/vscode-leetcode/Lobby.svg)](https://gitter.im/vscode-leetcode/Lobby)
62

7-
Solve LeetCode problems in VS Code.
8-
-[中文](#中文)
9-
-[English](#english)
3+
>Solve LeetCode problems in VS Code
4+
5+
<palign="center">
6+
<imgsrc="https://github.com/jdneo/vscode-leetcode/blob/master/resources/LeetCode.png"alt="">
7+
</p>
8+
<palign="center">
9+
<ahref="https://travis-ci.org/jdneo/vscode-leetcode">
10+
<img src="https://img.shields.io/travis/jdneo/vscode-leetcode.svg?style=flat-square" alt="">
11+
</a>
12+
<ahref="https://gitter.im/vscode-leetcode/Lobby">
13+
<img src="https://img.shields.io/gitter/room/jdneo/vscode-leetcode.svg?style=flat-square" alt="">
14+
</a>
15+
<ahref="https://marketplace.visualstudio.com/items?itemName=shengchen.vscode-leetcode">
16+
<img src="https://img.shields.io/visual-studio-marketplace/d/shengchen.vscode-leetcode.svg?style=flat-square" alt="">
17+
</a>
18+
<ahref="https://github.com/jdneo/vscode-leetcode/blob/master/LICENSE">
19+
<img src="https://img.shields.io/github/license/jdneo/vscode-leetcode.svg?style=flat-square" alt="">
20+
</a>
21+
</p>
22+
23+
-[English Document](#Requirements)
24+
-[中文文档](https://github.com/jdneo/vscode-leetcode/blob/master/docs/README_zh-CN.md)
1025

11-
#English
1226
##Requirements
1327
-[Node.js 8+](https://nodejs.org)
1428
>NOTE: Please make sure that`Node` is in your`PATH` environment variable. You can check this by running:`node -v`.
1529
30+
##Quick Start
31+
32+
![demo](https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/docs/gifs/demo.gif)
33+
1634
##Features
17-
- Sign in/out to LeetCode
18-
- Switch and create session
19-
- Show problems in explorer
20-
>Note: To show the locked problems, please set`leetcode.showLocked` to**true**
21-
- Search problems by keywords
22-
- Test solutions by customized test case
23-
- Submit solutions to LeetCode
24-
25-
###Sign In and Sign Out
26-
![SignInOut](https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/resources/gif/signinout.gif)
27-
28-
###Switch and Create Session
29-
![SwitchSession](https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/resources/gif/switchsession.gif)
30-
31-
###Show Problems in Explorer <sup>1</sup>
32-
![ShowProblem](https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/resources/gif/showproblem.gif)
33-
34-
###Search Problems by Keywords <sup>1</sup>
35-
![SearchProblem](https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/resources/gif/searchproblem.gif)
36-
37-
###Test solutions by customized test case <sup>2</sup>
38-
![TestSolution](https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/resources/gif/testsolution.gif)
39-
40-
###Submit Solutions to LeetCode <sup>2</sup>
41-
![SubmitSolution](https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/resources/gif/solveproblem.gif)
42-
43-
<sup>1</sup> If no folder is opened in VS Code, the extension will save the problem files in`$HOME/.leetcode/`. <br/>
44-
<sup>2</sup> If you trigger the`Submit to LeetCode` and`Test in LeetCode` commands in the Command Palette, the extension will upload the current active file in editor.
45-
46-
##Commands
47-
This extension provides several commands in the Command Palette (F1 or Ctrl + Shift + P):
48-
-**LeetCode: Sign in** - Sign in to LeetCode
49-
-**LeetCode: Sign out** - Sign out to LeetCode
50-
-**LeetCode: Select session** - Select one session and make it active
51-
-**LeetCode: Create new session** - Create a new session
52-
-**LeetCode: Refresh** - Refresh the LeetCode Explorer
53-
-**LeetCode: Search Problem** - Search for problems by keywords
54-
-**LeetCode: Test in LeetCode** - Test solution file by customized test case
55-
-**LeetCode: Submit to LeetCode** - Submit the solution file to LeetCode
56-
-**LeetCode: Switch endpoint** - Switch the LeetCode endpoint. (LeetCode or LeetCode-cn)
35+
36+
###Sign In/Out
37+
<palign="center">
38+
<imgsrc="https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/docs/imgs/sign_in.png"alt="Sign in" />
39+
</p>
40+
41+
- Simply click`Sign in to LeetCode` in the`LeetCode Explorer` will let you**sign in** with your LeetCode account.
42+
43+
- You can also use the following command to sign in/out:
44+
-**LeetCode: Sign in**
45+
-**LeetCode: Sign out**
46+
47+
---
48+
49+
###Switch Endpoint
50+
<palign="center">
51+
<imgsrc="https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/docs/imgs/endpoint.png"alt="Switch Endpoint" />
52+
</p>
53+
54+
- 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.
55+
56+
- The supported endpoints are:
57+
-**leetcode.com**
58+
-**leetcode-cn.com**
59+
60+
>Note: The accounts of different endpoints are**not** shared. Please make sure you are using the right endpoint. The extension will use`leetcode.com` by default.
61+
62+
---
63+
64+
###Pick a Problem
65+
<palign="center">
66+
<imgsrc="https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/docs/imgs/pick_problem.png"alt="Pick a problem" />
67+
</p>
68+
69+
- Right click the problem in the`LeetCode Explorer` and select`Show Problem` will generate a new file with the problem description for you.
70+
71+
>Note: If no folder is opened in VS Code, the extension will save the problem files in**$HOME/.leetcode/**.
72+
73+
---
74+
75+
###Submit the Answer
76+
<palign="center">
77+
<imgsrc="https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/docs/imgs/submit.png"alt="Switch Endpoint" />
78+
</p>
79+
80+
- You can submit the answer by clicking`🙏 Submit to LeetCode` at the bottom of the file. Or you can trigger the command:**LeetCode: Submit to LeetCode** to submit the**active** file as the answer.
81+
82+
---
83+
84+
###Test the Answer
85+
<palign="center">
86+
<imgsrc="https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/docs/imgs/test.png"alt="Switch Endpoint" />
87+
</p>
88+
89+
- To**test** your answer, right click in the editor and select`Test in LeetCode`.
90+
91+
- There are 3 ways to test the answer:
92+
-**Test with the default cases**
93+
-**Write test cases in input box**
94+
-**Test with the writen cases in file**
95+
96+
---
97+
98+
###Search problems by Keywords
99+
<palign="center">
100+
<imgsrc="https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/docs/imgs/search.png"alt="Switch Endpoint" />
101+
</p>
102+
103+
- 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.
104+
105+
---
106+
107+
###Manage Session
108+
<palign="center">
109+
<imgsrc="https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/docs/imgs/session.png"alt="Switch Endpoint" />
110+
</p>
111+
112+
- To manage your LeetCode sessions, just clicking the`LeetCode: ***` at the bottom of the status bar. You can**switch** between sessions or**create** a new session.
113+
57114

58115
##Settings
59116
| Setting Name| Description| Default Value|
@@ -64,9 +121,6 @@ This extension provides several commands in the Command Palette (F1 or Ctrl + Sh
64121
|`leetcode.useWsl`| Specify whether to use WSL or not|`false`|
65122
|`leetcode.endpoint`| Specify the active endpoint. Supported endpoints are:`leetcode`,`leetcode-cn`|`leetcode`|
66123

67-
##Known Issues:
68-
- This extension will infer the current target problem according to the active editing file. Please do not change the file name.
69-
70124
##Release Notes
71125

72126
Refer to[CHANGELOG](https://github.com/jdneo/vscode-leetcode/blob/master/CHANGELOG.md)
@@ -75,73 +129,3 @@ Refer to [CHANGELOG](https://github.com/jdneo/vscode-leetcode/blob/master/CHANGE
75129

76130
- This extension is based on[@skygragon](https://github.com/skygragon)'s[leetcode-cli](https://github.com/skygragon/leetcode-cli) open source project.
77131
- Special thanks to our[contributors](https://github.com/jdneo/vscode-leetcode/blob/master/ACKNOWLEDGEMENTS.md).
78-
79-
80-
81-
#中文
82-
##运行条件
83-
-[Node.js 8+](https://nodejs.org)
84-
>注意: 请确保`Node``PATH`环境变量中,您可以通过执行:`node -v`进行查看。
85-
86-
##功能
87-
- 登入 / 登出 LeetCode
88-
- 切换及创建 session
89-
- 在 Explorer 中展示题目
90-
>注意: 如果想要展示付费题目,您需要将`leetcode.showLocked` 设置为**true**
91-
- 根据关键字搜索题目
92-
- 用自定义测试用例测试答案
93-
- 向 LeetCode 提交答案
94-
95-
###登入及登出
96-
![SignInOut](https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/resources/gif/signinout.gif)
97-
98-
###切换及创建 session
99-
![SwitchSession](https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/resources/gif/switchsession.gif)
100-
101-
###在 Explorer 中展示题目 <sup>1</sup>
102-
![ShowProblem](https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/resources/gif/showproblem.gif)
103-
104-
###根据关键字搜索题目 <sup>1</sup>
105-
![SearchProblem](https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/resources/gif/searchproblem.gif)
106-
107-
###用自定义测试用例测试答案 <sup>2</sup>
108-
![TestSolution](https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/resources/gif/testsolution.gif)
109-
110-
###向 LeetCode 提交答案 <sup>2</sup>
111-
![SubmitSolution](https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/resources/gif/solveproblem.gif)
112-
113-
<sup>1</sup> 如果 VS Code 中没有已打开的文件夹,插件会将题目文件存储于`$HOME/.leetcode/` 目录下。<br/>
114-
<sup>2</sup> 如果您通过命令面板触发`Submit to LeetCode``Test in LeetCode` 命令,本插件将会提交当前文件至 LeetCode。
115-
116-
##命令
117-
该插件在命令面板(F1 或 Ctrl + Shift + P)中支持下列命令:
118-
-**LeetCode: Sign in** - 登入 LeetCode
119-
-**LeetCode: Sign out** - 登出 LeetCode
120-
-**LeetCode: Select session** - 激活一个已有的答题进度存档
121-
-**LeetCode: Create new session** - 创建一个新的答题进度存档
122-
-**LeetCode: Refresh** - 刷新左侧题目列表视图
123-
-**LeetCode: Search Problem** - 根据关键字搜索题目
124-
-**LeetCode: Test in LeetCode** - 用自定义测试用例进行测试
125-
-**LeetCode: Submit to LeetCode** - 提交答案到 LeetCode
126-
-**LeetCode: Switch endpoint** - 变更 LeetCode 终端(LeetCode 或 领扣)
127-
128-
##插件配置项
129-
| 配置项名称| 描述| 默认值|
130-
|---|---|---|
131-
|`leetcode.hideSolved`| 指定是否要隐藏已解决的问题|`false`|
132-
|`leetcode.showLocked`| 指定是否显示付费题目,只有付费账户才可以打开付费题目|`false`|
133-
|`leetcode.defaultLanguage`| 指定答题时使用的默认语言,可选语言有:`bash`,`c`,`cpp`,`csharp`,`golang`,`java`,`javascript`,`kotlin`,`mysql`,`python`,`python3`,`ruby`,`scala`,`swift`|`N/A`|
134-
|`leetcode.useWsl`| 指定是否启用 WSL|`false`|
135-
|`leetcode.endpoint`| 指定使用的终端,可用终端有:`leetcode`,`leetcode-cn`|`leetcode`|
136-
137-
##已知问题
138-
- 本插件会根据文件名称推测当前的目标题目,因此建议不要改变文件名。
139-
140-
##更新日志
141-
142-
请参考[更新日志](https://github.com/jdneo/vscode-leetcode/blob/master/CHANGELOG.md)
143-
144-
##鸣谢
145-
146-
- 本插件基于[@skygragon](https://github.com/skygragon)[leetcode-cli](https://github.com/skygragon/leetcode-cli)开源项目制作。
147-
- 特别鸣谢这些[贡献者们](https://github.com/jdneo/vscode-leetcode/blob/master/ACKNOWLEDGEMENTS.md)

‎docs/README_zh-CN.md

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
#LeetCode
2+
3+
>在 VS Code 中练习 LeetCode
4+
5+
<palign="center">
6+
<imgsrc="https://github.com/jdneo/vscode-leetcode/blob/master/resources/LeetCode.png"alt="">
7+
</p>
8+
<palign="center">
9+
<ahref="https://travis-ci.org/jdneo/vscode-leetcode">
10+
<img src="https://img.shields.io/travis/jdneo/vscode-leetcode.svg?style=flat-square" alt="">
11+
</a>
12+
<ahref="https://gitter.im/vscode-leetcode/Lobby">
13+
<img src="https://img.shields.io/gitter/room/jdneo/vscode-leetcode.svg?style=flat-square" alt="">
14+
</a>
15+
<ahref="https://marketplace.visualstudio.com/items?itemName=shengchen.vscode-leetcode">
16+
<img src="https://img.shields.io/visual-studio-marketplace/d/shengchen.vscode-leetcode.svg?style=flat-square" alt="">
17+
</a>
18+
<ahref="https://github.com/jdneo/vscode-leetcode/blob/master/LICENSE">
19+
<img src="https://img.shields.io/github/license/jdneo/vscode-leetcode.svg?style=flat-square" alt="">
20+
</a>
21+
</p>
22+
23+
-[English Document](#Requirements)
24+
-[中文文档](https://github.com/jdneo/vscode-leetcode/blob/master/docs/README_zh-CN.md)
25+
26+
##运行条件
27+
-[Node.js 8+](https://nodejs.org)
28+
>注意:请确保`Node``PATH`环境变量中,您可以通过执行:`node -v`进行查看。
29+
30+
##快速开始
31+
32+
![demo](https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/docs/gifs/demo.gif)
33+
34+
##功能
35+
36+
###登入登出
37+
<palign="center">
38+
<imgsrc="https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/docs/imgs/sign_in.png"alt="Sign in" />
39+
</p>
40+
41+
- 点击`LeetCode Explorer` 中的`Sign in to LeetCode` 即可登入。
42+
43+
- 你也可以使用下来命令登入或登出:
44+
-**LeetCode: Sign in**
45+
-**LeetCode: Sign out**
46+
47+
---
48+
49+
###切换 LeetCode 版本
50+
<palign="center">
51+
<imgsrc="https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/docs/imgs/endpoint.png"alt="Switch Endpoint" />
52+
</p>
53+
54+
- LeetCode 目前有**英文版****中文版**两种版本。点击`LeetCode Explorer` 导航栏中的![btn_endpoint](https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/docs/imgs/btn_endpoint.png) 按钮可切换版本。
55+
56+
- 目前可切换的版本有:
57+
-**leetcode.com**
58+
-**leetcode-cn.com**
59+
60+
>注意:两种版本的 LeetCode 账户并**不通用**,请确保当前激活的版本是正确的。插件默认激活的是**英文版**
61+
62+
---
63+
64+
###选择题目
65+
<palign="center">
66+
<imgsrc="https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/docs/imgs/pick_problem.png"alt="Pick a problem" />
67+
</p>
68+
69+
-`LeetCode Explorer`**右键**题目并选择`Show Problem` 进行答题。
70+
71+
>注意:若当前 VS Code 没有已打开的文件夹,则生成的题目文件会存储于**$HOME/.leetcode/** 目录下。
72+
73+
---
74+
75+
###提交答案
76+
<palign="center">
77+
<imgsrc="https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/docs/imgs/submit.png"alt="Switch Endpoint" />
78+
</p>
79+
80+
- 通过点击文件最下方的`🙏 Submit to LeetCode` 可提交答案。 你也可以触发**LeetCode: Submit to LeetCode** 命令将**当前**文件作为答案进行提交。
81+
82+
---
83+
84+
###测试答案
85+
<palign="center">
86+
<imgsrc="https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/docs/imgs/test.png"alt="Switch Endpoint" />
87+
</p>
88+
89+
- 在编辑区内右键并选择`Test in LeetCode`,可对**当前**答案进行测试。
90+
91+
- 有下列三种测试集来源:
92+
-**默认测试集**:Test with the default cases
93+
-**在输入框内输入测试集**:Write test cases in input box
94+
-**提供自定义测试集文件**:Test with the writen cases in file
95+
96+
---
97+
98+
###通过关键字搜索题目
99+
<palign="center">
100+
<imgsrc="https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/docs/imgs/search.png"alt="Switch Endpoint" />
101+
</p>
102+
103+
- 点击`LeetCode Explorer` 导航栏中的![btn_search](https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/docs/imgs/btn_search.png) 按钮可按照关键字搜索题目。
104+
105+
---
106+
107+
###管理存档
108+
<palign="center">
109+
<imgsrc="https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/docs/imgs/session.png"alt="Switch Endpoint" />
110+
</p>
111+
112+
- 点击位于 VS Code 底部状态栏的`LeetCode: ***` 管理`LeetCode 存档`。你可以**切换**存档或者**创建**新的存档。
113+
114+
115+
##插件配置项
116+
| 配置项名称| 描述| 默认值|
117+
|---|---|---|
118+
|`leetcode.hideSolved`| 指定是否要隐藏已解决的问题|`false`|
119+
|`leetcode.showLocked`| 指定是否显示付费题目,只有付费账户才可以打开付费题目|`false`|
120+
|`leetcode.defaultLanguage`| 指定答题时使用的默认语言,可选语言有:`bash`,`c`,`cpp`,`csharp`,`golang`,`java`,`javascript`,`kotlin`,`mysql`,`python`,`python3`,`ruby`,`scala`,`swift`|`N/A`|
121+
|`leetcode.useWsl`| 指定是否启用 WSL|`false`|
122+
|`leetcode.endpoint`| 指定使用的终端,可用终端有:`leetcode`,`leetcode-cn`|`leetcode`|
123+
124+
##更新日志
125+
126+
请参考[更新日志](https://github.com/jdneo/vscode-leetcode/blob/master/CHANGELOG.md)
127+
128+
##鸣谢
129+
130+
- 本插件基于[@skygragon](https://github.com/skygragon)[leetcode-cli](https://github.com/skygragon/leetcode-cli)开源项目制作。
131+
- 特别鸣谢这些[贡献者们](https://github.com/jdneo/vscode-leetcode/blob/master/ACKNOWLEDGEMENTS.md)

‎docs/gifs/demo.gif

4.76 MB
Loading

‎docs/imgs/btn_endpoint.png

618 Bytes
Loading

‎docs/imgs/btn_search.png

544 Bytes
Loading

‎docs/imgs/endpoint.png

29.5 KB
Loading

‎docs/imgs/pick_problem.png

55.5 KB
Loading

‎docs/imgs/search.png

41.6 KB
Loading

‎docs/imgs/session.png

22.2 KB
Loading

‎docs/imgs/sign_in.png

17.2 KB
Loading

‎docs/imgs/submit.png

19.4 KB
Loading

‎docs/imgs/test.png

144 KB
Loading

‎resources/LeetCode.png

-34 KB
Loading

‎resources/gif/searchproblem.gif

-454 KB
Binary file not shown.

‎resources/gif/showproblem.gif

-579 KB
Binary file not shown.

‎resources/gif/signinout.gif

-263 KB
Binary file not shown.

‎resources/gif/solveproblem.gif

-207 KB
Binary file not shown.

‎resources/gif/switchsession.gif

-194 KB
Binary file not shown.

‎resources/gif/testsolution.gif

-676 KB
Binary file not shown.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp