MCPcopy Index your code
hub / github.com/ccagml/leetcode-extension

github.com/ccagml/leetcode-extension @v3.1.17

Chat with this repo
repository ↗ · DeepWiki ↗ · release v3.1.17 ↗ · + Follow
1,284 symbols 2,929 edges 109 files 30 documented · 2%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

概要设计

关于本项目

快速开始

quickstart

tag 分类

tag

查询功能

search

区块测试用例

例子(cpp 文件为例)

// @lcpr case=start
// "PAYPALISHIRINGGGG"\n3\n
// @lcpr case=end

说明

  • 以 @lcpr case=start 开头
  • 第二行存放原本手动填写测试用例
  • 以 @lcpr case=end 结尾

一键提交的用例去重

  • 简单的比较这些用例字符串是否相同

状态栏增加简易计时器

  • 查看一个题目时会开始计时,提交一个题目通过后会停止计时

区域调试参数的一些说明

如果有些题目无法 debug,请尝试配置 diy 参数区

  1. 例子 cpp 2544 题为例 // @lcpr-div-debug-arg-start // funName= alternateDigitSum // paramTypes= ["number"] // @lcpr-div-debug-arg-end
  2. diy 参数说明

  3. funName:函数名,既本次解决方法的函数名

  4. paramTypes:函数的输入参数,是一个字符串数组类型
  5. 可填入内容为以下字符串
    • "number"
    • 类型说明:数字
    • "number[]"
    • 类型说明:数字数组
    • "number[][]"
    • 类型说明:数字二维数组
    • "string"
    • 类型说明:字符串
    • "string[]"
    • 类型说明:字符串数组
    • "string[][]"
    • 类型说明:字符串二维数组
    • "ListNode"
    • 类型说明:链表
    • "ListNode[]"
    • 类型说明:链表数组
    • "character"
    • 类型说明:字节
    • "character[]"
    • 类型说明:字节数组
    • "character[][]"
    • 类型说明:字节二维数组
    • "NestedInteger[]"
    • 类型说明:数组
    • "MountainArray"
    • 类型说明:数组
    • "TreeNode"
    • 类型说明:树节点

搬砖功能的说明

功能设想

  • 重复做 x 天之前的题目(正确提交后 x 天再做本题)
  • 重复练习可以提高水平?(待定验证)
  • 有什么学习方法可以与我交流,这个方法我也不知道有没有用

新增在工作目录存放数据

  • 目录说明

workspace/ 工作目录

.lcpr_data/ 存数据

bricks.json

remark 备注数据

qid 备注 remark 数据

group.json

bricks.json 存放格式

{
   version: 1,
   all_bricks: {
     [qid]: {
        submit_time: [], // 上次提交的时间
        type: 1, // 类型
     },
   },
 };

group.json 存放格式

{
    "version": 1,
    "all_group": [
        {
            "name": "www",  // 分类名称
            "time": 1669791273308, // 分类编号
            "qid_list": [   // 该分类的题目qid
                "1000229",
                "1000231"
            ]
        }
    ]
}

运行条件

  • VS Code 1.57.0+
  • Node.js 10+

    注意:请确保NodePATH环境变量中。您也可以通过设定 leetcode.nodePath 选项来指定 Node.js 可执行文件的路径。

插件配置项

配置项名称显示红色为与官方配置有不同的地方 描述 默认值
leetcode-problem-rating.hideSolved 指定是否要隐藏已解决的问题 false
leetcode-problem-rating.showLocked</font> | 指定是否显示付费题目,只有付费账户才可以打开付费题目 |false`
leetcode-problem-rating.defaultLanguage 指定答题时使用的默认语言,可选语言有:bash, c, cpp, csharp, golang, java, javascript, kotlin, mysql, php, python,python3,ruby, rust, scala, swift, typescript N/A
leetcode-problem-rating.useWsl 指定是否启用 WSL false
leetcode-problem-rating.endpoint 指定使用的终端,可用终端有:leetcode, leetcode-cn leetcode.cn
leetcode-problem-rating.workspaceFolder 指定保存文件的工作区目录例如/home/${USERNAME}/leetcode, 现在会尝试从系统环境变量读取 USERNAME 对应的值, 例如环境变量中 USERNAME 是 ccagml,那么就会是/home/ccagml/leetcode 录 ""
leetcode-problem-rating.workspaceFolderList 多个等待选择的工作区目录,如果 workspaceFolder 目录不存在,尝试从 workspaceFolderList 选取可用目录 ["path1", "path2"]
leetcode-problem-rating.filePath 指定生成题目文件的相对文件夹路径名和文件名。点击查看更多详细用法。 额外拓展\${yyyymmdd}对应年月日 20230720、\${timestamp}对应时间戳格式、\${cn_name}题目的中文名称
leetcode-problem-rating.enableStatusBar 指定是否在 VS Code 下方显示插件状态栏。 增加周赛分数据 true
leetcode-problem-rating.editor.shortcuts 指定在编辑器内所自定义的快捷方式。可用的快捷方式有: submit, test, star, solution, description, case, allcase 。 ["submit, case, allcase, test, solution"]
leetcode-problem-rating.enableSideMode 指定在解决一道题时,是否将问题预览高票答案提交结果窗口集中在编辑器的第二栏。 true
leetcode-problem-rating.nodePath 指定 Node.js 可执行文件的路径。如:C:\Program Files\nodejs\node.exe node
leetcode-problem-rating.showCommentDescription 指定是否要在注释中显示题干。 false
leetcode-problem-rating.useEndpointTranslation 是否显示翻译版本内容。 true
leetcode-problem-rating.sortStrategy 排序的选项。Acceptance Rate (Ascending):通过率递增 Acceptance Rate (Descending):通过率递减 Score (Ascending):分数递增 Score (Descending):分数递减 None
leetcode-problem-rating.pickOneByRankRangeMin 随机一题的最小浮动,随机一题最低分(你的竞赛分+本配置)。 50
leetcode-problem-rating.pickOneByRankRangeMax 随机一题的最大浮动,随机一题最高分(你的竞赛分+本配置)。

Extension points exported contracts — how you extend this code

ICommand (Interface)
(no doc) [8 implementers]
src/utils/BaseCC.ts
IApi (Interface)
(no doc) [10 implementers]
src/rpc/factory/apiBase.ts
IQuickItemEx (Interface)
(no doc)
src/model/ConstDefind.ts
IDescription (Interface)
(no doc)
src/preView/PreviewModule.ts
IResult (Interface)
(no doc)
src/commitResult/CommitResultModule.ts
INotifier (Interface)
(no doc) [6 implementers]
src/utils/BaseCC.ts
IMETA (Interface)
(no doc)
src/rpc/utils/storageUtils.ts
ITestSolutionData (Interface)
(no doc)
src/model/ConstDefind.ts

Core symbols most depended-on inside this repo

getProxy
called by 114
src/BABA.ts
sendNotification
called by 89
src/utils/BaseCC.ts
get
called by 69
resources/debug/entry/cpp/problems/common.cpp
toString
called by 57
src/utils/BaseCC.ts
registerCommand
called by 49
src/utils/BaseCC.ts
info
called by 46
src/rpc/utils/ReplyUtils.ts
append
called by 45
src/logOutput/logOutputModule.ts
ShowMessage
called by 39
src/utils/OutputUtils.ts

Shape

Method 748
Function 259
Class 225
Interface 35
Enum 17

Languages

TypeScript89%
Python7%
C++4%

Modules by API surface

src/utils/BaseCC.ts175 symbols
src/controller/TreeViewController.ts49 symbols
src/model/TreeNodeModel.ts40 symbols
src/childCall/childCallModule.ts40 symbols
src/utils/ConfigUtils.ts39 symbols
resources/debug/entry/python3/entry.py37 symbols
src/rpc/utils/storageUtils.ts36 symbols
src/rpc/actionChain/chainNodeBase.ts35 symbols
src/treeData/TreeDataService.ts30 symbols
resources/debug/entry/javascript/entry.js30 symbols
src/model/ConstDefind.ts28 symbols
src/statusBar/StatusBarModule.ts27 symbols

For agents

$ claude mcp add leetcode-extension \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page