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

Solve LeetCode problems in VS Code

License

NotificationsYou must be signed in to change notification settings

cgb-algorithm/vscode-leetcode

 
 

Repository files navigation

Solve LeetCode problems in VS Code

❗️ Attention ❗️- Workaround to login to LeetCode endpoint

Note: If you are usingleetcode.cn, you can just ignore this section.

Recently we observed thatthe extension cannot login to leetcode.com endpoint anymore. 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 provided a workaround which can somehow mitigate this. Now you can simply click theSign In button and then selectThird Party login orCookie login.

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 useCookie login, clickhere to see the steps.

Requirements

  • VS Code 1.30.1+
  • Node.js 10+

    NOTE: Please make sure thatNode is in yourPATH environment variable. You can also use the settingleetcode.nodePath to specify the location of yourNode.js executable.

Quick Start

demo

Features

Sign In/Out

Sign in

  • Simply clickSign in to LeetCode in theLeetCode Explorer will let yousign in with your LeetCode account.

  • You can also use the following command to sign in/out:

    • LeetCode: Sign in
    • LeetCode: Sign out

Switch Endpoint

Switch Endpoint

  • By clicking the buttonbtn_endpoint at theexplorer's navigation bar, you can switch between different endpoints.

  • The supported endpoints are:

    • leetcode.com
    • leetcode.cn

    Note: The accounts of different endpoints arenot shared. Please make sure you are using the right endpoint. The extension will useleetcode.com by default.


Pick a Problem

Pick a Problem

  • Directly click on the problem or right click the problem in theLeetCode Explorer and selectPreview Problem to see the problem description.

  • SelectShow Problem to directly open the file with the problem description.

    Note:You can specify the path of the workspace folder to store the problem files by updating the settingleetcode.workspaceFolder. The default value is:$HOME/.leetcode/.

    You can specify whether including the problem description in comments or not by updating the settingleetcode.showCommentDescription.

    You can switch the default language by triggering the command:LeetCode: Switch Default Language.


Editor Shortcuts

Editor Shortcuts

  • 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.

    Note: You can customize the shortcuts using the setting:leetcode.editor.shortcuts. By default, onlySubmit andTest shortcuts are enabled.


Search problems by Keywords

Search problems by Keywords

  • By clicking the buttonbtn_search at theexplorer's navigation bar, you can search the problems by keywords.

Manage Session

Manage Session

  • To manage your LeetCode sessions, just clicking theLeetCode: *** at the bottom of the status bar. You canswitch between sessions orcreate,delete a session.

Settings

Setting NameDescriptionDefault Value
leetcode.hideSolvedSpecify to hide the solved problems or notfalse
leetcode.defaultLanguageSpecify 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,typescriptN/A
leetcode.useWslSpecify whether to use WSL or notfalse
leetcode.endpointSpecify the active endpoint. Supported endpoints are:leetcode,leetcode-cnleetcode
leetcode.workspaceFolderSpecify the path of the workspace folder to store the problem files.""
leetcode.filePathSpecify the relative path under the workspace and the file name to save the problem files. More details can be foundhere.
leetcode.enableStatusBarSpecify whether the LeetCode status bar will be shown or not.true
leetcode.editor.shortcutsSpecify the customized shortcuts in editors. Supported values are:submit,test,star,solution anddescription.["submit, test"]
leetcode.enableSideModeSpecify whetherpreview,solution andsubmission tab should be grouped into the second editor column when solving a problem.true
leetcode.nodePathSpecify theNode.js executable path. for example, C:\Program Files\nodejs\node.exenode
leetcode.showCommentDescriptionSpecify whether to include the problem description in the commentsfalse
leetcode.useEndpointTranslationUse endpoint's translation (if available)true
leetcode.colorizeProblemsAdd difficulty badge and colorize problems files in explorer treetrue
leetcode.problems.sortStrategySpecify sorting strategy for problems listNone
leetcode.allowReportDataAllow LeetCode to report anonymous usage data to improve the product. listtrue

Want Help?

When you meet any problem, you can check out theTroubleshooting andFAQ first.

If your problem still cannot be addressed, feel free to reach us in theGitter Channel orfile an issue.

Release Notes

Refer toCHANGELOG

Acknowledgement

Packages

No packages published

Languages

  • TypeScript100.0%

[8]ページ先頭

©2009-2025 Movatter.jp