|
1 | 1 | #LeetCode
|
2 | 2 |
|
3 |
| ->Solve LeetCode problems in VS Code |
4 |
| -
|
5 |
| -<palign="center"> |
6 |
| - <imgsrc="https://raw.githubusercontent.com/LeetCode-OpenSource/vscode-leetcode/master/resources/LeetCode.png"alt=""> |
7 |
| -</p> |
8 |
| -<palign="center"> |
9 |
| - <ahref="https://github.com/LeetCode-OpenSource/vscode-leetcode/actions?query=workflow%3ACI+branch%3Amaster"> |
10 |
| -<img src="https://img.shields.io/github/workflow/status/LeetCode-OpenSource/vscode-leetcode/CI/master?style=flat-square" alt=""> |
11 |
| - </a> |
12 |
| - <ahref="https://gitter.im/vscode-leetcode/Lobby"> |
13 |
| -<img src="https://img.shields.io/gitter/room/LeetCode-OpenSource/vscode-leetcode.svg?style=flat-square" alt=""> |
14 |
| - </a> |
15 |
| - <ahref="https://marketplace.visualstudio.com/items?itemName=LeetCode.vscode-leetcode"> |
16 |
| -<img src="https://img.shields.io/visual-studio-marketplace/d/LeetCode.vscode-leetcode.svg?style=flat-square" alt=""> |
17 |
| - </a> |
18 |
| - <ahref="https://github.com/LeetCode-OpenSource/vscode-leetcode/blob/master/LICENSE"> |
19 |
| -<img src="https://img.shields.io/github/license/LeetCode-OpenSource/vscode-leetcode.svg?style=flat-square" alt=""> |
20 |
| - </a> |
21 |
| -</p> |
22 |
| - |
23 |
| -- English Document |[中文文档](https://github.com/LeetCode-OpenSource/vscode-leetcode/blob/master/docs/README_zh-CN.md) |
24 |
| - |
25 |
| -##❗️ Attention ❗️- Workaround to login to LeetCode endpoint |
26 |
| ->Note: If you are using`leetcode.cn`, you can just ignore this section. |
27 |
| -
|
28 |
| -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. |
29 |
| - |
30 |
| -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. |
31 |
| - |
32 |
| ->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. |
33 |
| -
|
34 |
| -##Requirements |
35 |
| --[VS Code 1.30.1+](https://code.visualstudio.com/) |
36 |
| --[Node.js 10+](https://nodejs.org) |
37 |
| - >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. |
38 |
| -
|
39 |
| -##Quick Start |
40 |
| - |
41 |
| - |
42 |
| - |
43 |
| -##Features |
44 |
| - |
45 |
| -###Sign In/Out |
46 |
| -<palign="center"> |
47 |
| - <imgsrc="https://raw.githubusercontent.com/LeetCode-OpenSource/vscode-leetcode/master/docs/imgs/sign_in.png"alt="Sign in" /> |
48 |
| -</p> |
49 |
| - |
50 |
| -- Simply click`Sign in to LeetCode` in the`LeetCode Explorer` will let you**sign in** with your LeetCode account. |
51 |
| - |
52 |
| -- You can also use the following command to sign in/out: |
53 |
| --**LeetCode: Sign in** |
54 |
| --**LeetCode: Sign out** |
55 |
| ---- |
56 |
| - |
57 |
| -###Switch Endpoint |
58 |
| -<palign="center"> |
59 |
| - <imgsrc="https://raw.githubusercontent.com/LeetCode-OpenSource/vscode-leetcode/master/docs/imgs/endpoint.png"alt="Switch Endpoint" /> |
60 |
| -</p> |
61 |
| - |
62 |
| -- By clicking the button at the**explorer's navigation bar**, you can switch between different endpoints. |
63 |
| - |
64 |
| -- The supported endpoints are: |
65 |
| --**leetcode.com** |
66 |
| --**leetcode.cn** |
67 |
| - |
68 |
| ->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. |
69 |
| -
|
70 |
| ---- |
71 |
| - |
72 |
| -###Pick a Problem |
73 |
| -<palign="center"> |
74 |
| - <imgsrc="https://raw.githubusercontent.com/LeetCode-OpenSource/vscode-leetcode/master/docs/imgs/pick_problem.png"alt="Pick a Problem" /> |
75 |
| -</p> |
76 |
| - |
77 |
| -- Directly click on the problem or right click the problem in the`LeetCode Explorer` and select`Preview Problem` to see the problem description. |
78 |
| -- Select`Show Problem` to directly open the file with the problem description. |
79 |
| - |
80 |
| ->Note:You can specify the path of the workspace folder to store the problem files by updating the setting`leetcode.workspaceFolder`. The default value is:**$HOME/.leetcode/**. |
81 |
| -
|
82 |
| ->You can specify whether including the problem description in comments or not by updating the setting`leetcode.showCommentDescription`. |
83 |
| -
|
84 |
| ->You can switch the default language by triggering the command:`LeetCode: Switch Default Language`. |
85 |
| -
|
86 |
| ---- |
87 |
| - |
88 |
| -###Editor Shortcuts |
89 |
| -<palign="center"> |
90 |
| - <imgsrc="https://raw.githubusercontent.com/LeetCode-OpenSource/vscode-leetcode/master/docs/imgs/shortcuts.png"alt="Editor Shortcuts" /> |
91 |
| -</p> |
92 |
| - |
93 |
| -- The extension supports 5 editor shortcuts (aka Code Lens): |
94 |
| --`Submit`: Submit your answer to LeetCode. |
95 |
| --`Test`: Test your answer with customized test cases. |
96 |
| --`Star/Unstar`: Star or unstar the current problem. |
97 |
| --`Solution`: Show the top voted solution for the current problem. |
98 |
| --`Description`: Show the problem description page. |
99 |
| - |
100 |
| ->Note: You can customize the shortcuts using the setting:`leetcode.editor.shortcuts`. By default, only`Submit` and`Test` shortcuts are enabled. |
101 |
| -
|
102 |
| ---- |
103 |
| - |
104 |
| -###Search problems by Keywords |
105 |
| -<palign="center"> |
106 |
| - <imgsrc="https://raw.githubusercontent.com/LeetCode-OpenSource/vscode-leetcode/master/docs/imgs/search.png"alt="Search problems by Keywords" /> |
107 |
| -</p> |
108 |
| - |
109 |
| -- By clicking the button at the**explorer's navigation bar**, you can search the problems by keywords. |
110 |
| - |
111 |
| ---- |
112 |
| - |
113 |
| -###Manage Session |
114 |
| -<palign="center"> |
115 |
| - <imgsrc="https://raw.githubusercontent.com/LeetCode-OpenSource/vscode-leetcode/master/docs/imgs/session.png"alt="Manage Session" /> |
116 |
| -</p> |
117 |
| - |
118 |
| -- 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. |
119 |
| - |
120 |
| - |
121 |
| -##Settings |
122 |
| - |
123 |
| -| Setting Name| Description| Default Value| |
124 |
| -| ---------------------------------| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| ------------------| |
125 |
| -|`leetcode.hideSolved`| Specify to hide the solved problems or not|`false`| |
126 |
| -|`leetcode.showLocked`| Specify to show the locked problems or not. Only Premium users could open the locked problems|`false`| |
127 |
| -|`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`| |
128 |
| -|`leetcode.useWsl`| Specify whether to use WSL or not|`false`| |
129 |
| -|`leetcode.endpoint`| Specify the active endpoint. Supported endpoints are:`leetcode`,`leetcode-cn`|`leetcode`| |
130 |
| -|`leetcode.workspaceFolder`| Specify the path of the workspace folder to store the problem files.|`""`| |
131 |
| -|`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).|| |
132 |
| -|`leetcode.enableStatusBar`| Specify whether the LeetCode status bar will be shown or not.|`true`| |
133 |
| -|`leetcode.editor.shortcuts`| Specify the customized shortcuts in editors. Supported values are:`submit`,`test`,`star`,`solution` and`description`.|`["submit, test"]`| |
134 |
| -|`leetcode.enableSideMode`| Specify whether`preview`,`solution` and`submission` tab should be grouped into the second editor column when solving a problem.|`true`| |
135 |
| -|`leetcode.nodePath`| Specify the`Node.js` executable path. for example, C:\Program Files\nodejs\node.exe|`node`| |
136 |
| -|`leetcode.showCommentDescription`| Specify whether to include the problem description in the comments|`false`| |
137 |
| -|`leetcode.useEndpointTranslation`| Use endpoint's translation (if available)|`true`| |
138 |
| -|`leetcode.colorizeProblems`| Add difficulty badge and colorize problems files in explorer tree|`true`| |
139 |
| -|`leetcode.problems.sortStrategy`| Specify sorting strategy for problems list|`None`| |
140 |
| - |
141 |
| -##Want Help? |
142 |
| - |
143 |
| -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. |
144 |
| - |
145 |
| -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). |
146 |
| - |
147 |
| -##Release Notes |
148 |
| - |
149 |
| -Refer to[CHANGELOG](https://github.com/LeetCode-OpenSource/vscode-leetcode/blob/master/CHANGELOG.md) |
150 |
| - |
151 |
| -##Acknowledgement |
152 |
| - |
153 |
| -- This extension is based on[@skygragon](https://github.com/skygragon)'s[leetcode-cli](https://github.com/skygragon/leetcode-cli) open source project. |
154 |
| -- Special thanks to our[contributors](https://github.com/LeetCode-OpenSource/vscode-leetcode/blob/master/ACKNOWLEDGEMENTS.md). |
| 3 | +自用leetcode插件,支持custom list |