feat: implement core code review extension
This commit is contained in:
+214
-9
@@ -14,27 +14,232 @@
|
||||
"contributes": {
|
||||
"commands": [
|
||||
{
|
||||
"command": "vscode-code-reviewer.helloWorld",
|
||||
"title": "Hello World"
|
||||
"command": "codeReviewer.review",
|
||||
"title": "CodeGuard: 运行代码审查"
|
||||
},
|
||||
{
|
||||
"command": "codeReviewer.reviewSelection",
|
||||
"title": "CodeGuard: 审查选中代码"
|
||||
},
|
||||
{
|
||||
"command": "codeReviewer.openPanel",
|
||||
"title": "CodeGuard: 打开审查面板"
|
||||
},
|
||||
{
|
||||
"command": "codeReviewer.exportReport",
|
||||
"title": "CodeGuard: 导出报告"
|
||||
},
|
||||
{
|
||||
"command": "codeReviewer.addCustomRule",
|
||||
"title": "CodeGuard: 添加自定义规则"
|
||||
},
|
||||
{
|
||||
"command": "codeReviewer.fixIssue",
|
||||
"title": "CodeGuard: 修复此问题"
|
||||
},
|
||||
{
|
||||
"command": "codeReviewer.fixAll",
|
||||
"title": "CodeGuard: 批量修复"
|
||||
},
|
||||
{
|
||||
"command": "codeReviewer.openSetup",
|
||||
"title": "CodeGuard: 打开设置面板"
|
||||
}
|
||||
]
|
||||
],
|
||||
"keybindings": [
|
||||
{
|
||||
"command": "codeReviewer.review",
|
||||
"key": "ctrl+shift+r",
|
||||
"when": "editorTextFocus"
|
||||
}
|
||||
],
|
||||
"viewsContainers": {
|
||||
"activitybar": [
|
||||
{
|
||||
"id": "code-reviewer",
|
||||
"title": "CodeGuard 代码审查",
|
||||
"icon": "images/icon.png"
|
||||
}
|
||||
]
|
||||
},
|
||||
"views": {
|
||||
"code-reviewer": [
|
||||
{
|
||||
"type": "tree",
|
||||
"id": "codeReviewer.setupView",
|
||||
"name": "设置"
|
||||
}
|
||||
]
|
||||
},
|
||||
"menus": {
|
||||
"editor/context": [
|
||||
{
|
||||
"command": "codeReviewer.review",
|
||||
"group": "navigation"
|
||||
},
|
||||
{
|
||||
"command": "codeReviewer.reviewSelection",
|
||||
"when": "editorHasSelection"
|
||||
}
|
||||
]
|
||||
},
|
||||
"configuration": {
|
||||
"title": "CodeGuard",
|
||||
"properties": {
|
||||
"vscode-code-reviewer.ai.provider": {
|
||||
"type": "string",
|
||||
"default": "deepseek",
|
||||
"enum": [
|
||||
"deepseek",
|
||||
"openai"
|
||||
],
|
||||
"description": "AI 模型提供商"
|
||||
},
|
||||
"vscode-code-reviewer.ai.model": {
|
||||
"type": "string",
|
||||
"default": "deepseek-chat",
|
||||
"description": "AI 模型名称"
|
||||
},
|
||||
"vscode-code-reviewer.ai.endpoint": {
|
||||
"type": "string",
|
||||
"default": "https://api.deepseek.com/v1",
|
||||
"description": "API 端点"
|
||||
},
|
||||
"vscode-code-reviewer.ai.temperature": {
|
||||
"type": "number",
|
||||
"default": 0.2,
|
||||
"description": "AI 温度参数"
|
||||
},
|
||||
"vscode-code-reviewer.ai.timeout": {
|
||||
"type": "number",
|
||||
"default": 300,
|
||||
"description": "AI 请求超时(秒)"
|
||||
},
|
||||
"vscode-code-reviewer.ai.outputLanguage": {
|
||||
"type": "string",
|
||||
"default": "zh-CN",
|
||||
"enum": [
|
||||
"zh-CN",
|
||||
"en",
|
||||
"ja"
|
||||
],
|
||||
"description": "AI 输出语言"
|
||||
},
|
||||
"vscode-code-reviewer.linters.javascript": {
|
||||
"type": "string",
|
||||
"default": "eslint",
|
||||
"enum": [
|
||||
"",
|
||||
"eslint"
|
||||
],
|
||||
"description": "JavaScript linter"
|
||||
},
|
||||
"vscode-code-reviewer.linters.typescript": {
|
||||
"type": "string",
|
||||
"default": "eslint",
|
||||
"enum": [
|
||||
"",
|
||||
"eslint"
|
||||
],
|
||||
"description": "TypeScript linter"
|
||||
},
|
||||
"vscode-code-reviewer.linters.java": {
|
||||
"type": "string",
|
||||
"default": "pmd",
|
||||
"enum": [
|
||||
"",
|
||||
"pmd"
|
||||
],
|
||||
"description": "Java linter"
|
||||
},
|
||||
"vscode-code-reviewer.linters.jsp": {
|
||||
"type": "string",
|
||||
"default": "jsp",
|
||||
"enum": [
|
||||
"",
|
||||
"jsp"
|
||||
],
|
||||
"description": "JSP linter"
|
||||
},
|
||||
"vscode-code-reviewer.linters.css": {
|
||||
"type": "string",
|
||||
"default": "stylelint",
|
||||
"enum": [
|
||||
"",
|
||||
"stylelint"
|
||||
],
|
||||
"description": "CSS linter"
|
||||
},
|
||||
"vscode-code-reviewer.linters.sql": {
|
||||
"type": "string",
|
||||
"default": "sql-lint",
|
||||
"enum": [
|
||||
"",
|
||||
"sql-lint"
|
||||
],
|
||||
"description": "SQL linter"
|
||||
},
|
||||
"vscode-code-reviewer.linters.plsql": {
|
||||
"type": "string",
|
||||
"default": "sql-lint",
|
||||
"enum": [
|
||||
"",
|
||||
"sql-lint"
|
||||
],
|
||||
"description": "PL/SQL linter"
|
||||
},
|
||||
"vscode-code-reviewer.pmd.jarPath": {
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"description": "PMD jar 路径(空=使用插件内置)"
|
||||
},
|
||||
"vscode-code-reviewer.pmd.rulesetPath": {
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"description": "Java 规则集 XML 路径(空=使用内置)"
|
||||
},
|
||||
"vscode-code-reviewer.pmd.jspRulesetPath": {
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"description": "JSP 规则集 XML 路径(空=使用内置)"
|
||||
},
|
||||
"vscode-code-reviewer.sql-lint.configFile": {
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"description": "sqlfluff 配置文件路径"
|
||||
},
|
||||
"vscode-code-reviewer.fixer.contextLines": {
|
||||
"type": "number",
|
||||
"default": 5,
|
||||
"description": "AI 修复时提取的上下文行数"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"vscode:prepublish": "npm run compile",
|
||||
"compile": "tsc -p ./",
|
||||
"watch": "tsc -watch -p ./",
|
||||
"build": "node scripts/build.mjs",
|
||||
"vscode:prepublish": "npm run build",
|
||||
"download-pmd": "node scripts/download-pmd.mjs",
|
||||
"package-prod": "node scripts/package-prod.mjs",
|
||||
"pretest": "npm run compile && npm run lint",
|
||||
"lint": "eslint src",
|
||||
"test": "vscode-test"
|
||||
},
|
||||
"dependencies": {
|
||||
"eslint": "^9.39.3",
|
||||
"stylelint": "^17.14.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/vscode": "^1.120.0",
|
||||
"@types/mocha": "^10.0.10",
|
||||
"@types/node": "22.x",
|
||||
"typescript-eslint": "^8.56.1",
|
||||
"eslint": "^9.39.3",
|
||||
"typescript": "^5.9.3",
|
||||
"@types/vscode": "^1.120.0",
|
||||
"@vscode/test-cli": "^0.0.12",
|
||||
"@vscode/test-electron": "^2.5.2"
|
||||
"@vscode/test-electron": "^2.5.2",
|
||||
"@vscode/vsce": "^3.9.2",
|
||||
"esbuild": "^0.28.1",
|
||||
"typescript": "^5.9.3",
|
||||
"typescript-eslint": "^8.56.1"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user