- 方法级审查:CodeLens 触发 + 单次 AI 调用(规则匹配 + 6 维度深度审查),新增 method-extractor / status-cache / codeLensProvider - 模板导入:severity 保留原始值 + 占位 id、去重对照统一 known-rules、重复提示条双语翻译、箭头展开/折叠 UI、520 条静态规则补 zh/ja 翻译 - SQL:sql-lint 重命名 sqlfluff + sqlfluff.dialect 方言可配置 + 默认方言调整 - ESLint:v9 flat config 接线修复(overrideConfigFile)+ legacy 迁移提示 - AI:空响应 EmptyContentError + 重试一次 + max_tokens 截断专用报错 - JSP:整文件检查走 PMD JSP 规则集 + scriptlet 包装解析 + 行号映射 - 诊断按 severity + 行号排序
349 lines
9.8 KiB
JSON
349 lines
9.8 KiB
JSON
{
|
|
"name": "vscode-code-reviewer",
|
|
"displayName": "净码特工 · Code Purifier",
|
|
"description": "AI 驱动的代码审查与规范检查一体化 VSCode 插件",
|
|
"version": "1.2.0",
|
|
"engines": {
|
|
"vscode": "^1.120.0"
|
|
},
|
|
"categories": [
|
|
"Other"
|
|
],
|
|
"activationEvents": [],
|
|
"main": "./out/extension.js",
|
|
"contributes": {
|
|
"commands": [
|
|
{
|
|
"command": "codeReviewer.review",
|
|
"title": "Code Purifier: 运行代码审查"
|
|
},
|
|
{
|
|
"command": "codeReviewer.reviewSelection",
|
|
"title": "Code Purifier: 审查选中代码"
|
|
},
|
|
{
|
|
"command": "codeReviewer.openPanel",
|
|
"title": "Code Purifier: 打开审查面板"
|
|
},
|
|
{
|
|
"command": "codeReviewer.exportReport",
|
|
"title": "Code Purifier: 导出报告"
|
|
},
|
|
{
|
|
"command": "codeReviewer.addCustomRule",
|
|
"title": "Code Purifier: 添加自定义规则"
|
|
},
|
|
{
|
|
"command": "codeReviewer.fixIssue",
|
|
"title": "Code Purifier: 修复此问题"
|
|
},
|
|
{
|
|
"command": "codeReviewer.fixAll",
|
|
"title": "Code Purifier: 批量修复"
|
|
},
|
|
{
|
|
"command": "codeReviewer.openSetup",
|
|
"title": "Code Purifier: 打开设置面板"
|
|
},
|
|
{
|
|
"command": "codeReviewer.exportTemplate",
|
|
"title": "Code Purifier: 导出规则模板"
|
|
},
|
|
{
|
|
"command": "codeReviewer.reviewMethod",
|
|
"title": "Code Purifier: 审查此方法"
|
|
}
|
|
],
|
|
"keybindings": [
|
|
{
|
|
"command": "codeReviewer.review",
|
|
"key": "ctrl+shift+r",
|
|
"when": "editorTextFocus"
|
|
}
|
|
],
|
|
"viewsContainers": {
|
|
"activitybar": [
|
|
{
|
|
"id": "code-reviewer",
|
|
"title": "Code Purifier",
|
|
"icon": "images/icon.png"
|
|
}
|
|
]
|
|
},
|
|
"views": {
|
|
"code-reviewer": [
|
|
{
|
|
"type": "webview",
|
|
"id": "codeReviewer.setupView",
|
|
"name": "设置"
|
|
}
|
|
]
|
|
},
|
|
"menus": {
|
|
"editor/context": [
|
|
{
|
|
"command": "codeReviewer.review",
|
|
"group": "navigation"
|
|
},
|
|
{
|
|
"command": "codeReviewer.reviewSelection",
|
|
"when": "editorHasSelection"
|
|
},
|
|
{
|
|
"command": "codeReviewer.reviewMethod",
|
|
"when": "editorTextFocus"
|
|
}
|
|
]
|
|
},
|
|
"configuration": {
|
|
"title": "Code Purifier",
|
|
"properties": {
|
|
"vscode-code-reviewer.ai.provider": {
|
|
"type": "string",
|
|
"default": "deepseek",
|
|
"description": "AI 模型提供商"
|
|
},
|
|
"vscode-code-reviewer.ai.model": {
|
|
"type": "string",
|
|
"default": "deepseek-chat",
|
|
"description": "AI 模型名称"
|
|
},
|
|
"vscode-code-reviewer.ai.baseUrl": {
|
|
"type": "string",
|
|
"default": "https://api.deepseek.com/v1",
|
|
"description": "API Base URL"
|
|
},
|
|
"vscode-code-reviewer.ai.temperature": {
|
|
"type": "number",
|
|
"default": 0.2,
|
|
"description": "AI 温度参数"
|
|
},
|
|
"vscode-code-reviewer.ai.maxTokens": {
|
|
"type": "number",
|
|
"default": 8192,
|
|
"description": "AI 单次请求最大输出 Token 数"
|
|
},
|
|
"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": "插件语言"
|
|
},
|
|
"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.html": {
|
|
"type": "string",
|
|
"default": "jsp",
|
|
"enum": [
|
|
"",
|
|
"jsp"
|
|
],
|
|
"description": "HTML linter"
|
|
},
|
|
"vscode-code-reviewer.linters.css": {
|
|
"type": "string",
|
|
"default": "stylelint",
|
|
"enum": [
|
|
"",
|
|
"stylelint"
|
|
],
|
|
"description": "CSS linter"
|
|
},
|
|
"vscode-code-reviewer.linters.sql": {
|
|
"type": "string",
|
|
"default": "sqlfluff",
|
|
"enum": [
|
|
"",
|
|
"sqlfluff"
|
|
],
|
|
"description": "SQL linter"
|
|
},
|
|
"vscode-code-reviewer.linters.plsql": {
|
|
"type": "string",
|
|
"default": "sqlfluff",
|
|
"enum": [
|
|
"",
|
|
"sqlfluff"
|
|
],
|
|
"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.sqlfluff.configFile": {
|
|
"type": "string",
|
|
"default": "",
|
|
"description": "sqlfluff 配置文件路径"
|
|
},
|
|
"vscode-code-reviewer.sqlfluff.dialect": {
|
|
"type": "string",
|
|
"default": "",
|
|
"enum": [
|
|
"",
|
|
"ansi",
|
|
"athena",
|
|
"bigquery",
|
|
"clickhouse",
|
|
"databricks",
|
|
"db2",
|
|
"doris",
|
|
"duckdb",
|
|
"exasol",
|
|
"flink",
|
|
"greenplum",
|
|
"hive",
|
|
"impala",
|
|
"mariadb",
|
|
"materialize",
|
|
"mysql",
|
|
"oracle",
|
|
"postgres",
|
|
"redshift",
|
|
"snowflake",
|
|
"soql",
|
|
"sparksql",
|
|
"sqlite",
|
|
"starrocks",
|
|
"teradata",
|
|
"trino",
|
|
"tsql",
|
|
"vertica"
|
|
],
|
|
"description": "SQLFluff 方言(空=自动:全局/项目配置 > 语言映射)"
|
|
},
|
|
"vscode-code-reviewer.linters.eslintConfigPath": {
|
|
"type": "string",
|
|
"default": "",
|
|
"description": "ESLint 自定义配置文件路径(绝对路径)。留空则使用项目 eslint.config.* 或内置规则"
|
|
},
|
|
"vscode-code-reviewer.linters.stylelintConfigPath": {
|
|
"type": "string",
|
|
"default": "",
|
|
"description": "Stylelint 自定义配置文件路径(绝对路径)。留空则使用项目 .stylelintrc 或内置规则"
|
|
},
|
|
"vscode-code-reviewer.linter.pmd.enabled": {
|
|
"type": "boolean",
|
|
"default": true,
|
|
"description": "启用/禁用 PMD 适配器"
|
|
},
|
|
"vscode-code-reviewer.linter.sqlfluff.enabled": {
|
|
"type": "boolean",
|
|
"default": true,
|
|
"description": "启用/禁用 SQLFluff 适配器"
|
|
},
|
|
"vscode-code-reviewer.linter.eslint.enabled": {
|
|
"type": "boolean",
|
|
"default": true,
|
|
"description": "启用/禁用 ESLint 适配器"
|
|
},
|
|
"vscode-code-reviewer.linter.stylelint.enabled": {
|
|
"type": "boolean",
|
|
"default": true,
|
|
"description": "启用/禁用 Stylelint 适配器"
|
|
},
|
|
"vscode-code-reviewer.fixer.contextLines": {
|
|
"type": "number",
|
|
"default": 5,
|
|
"description": "AI 修复时提取的上下文行数"
|
|
},
|
|
"vscode-code-reviewer.codelens.enabled": {
|
|
"type": "boolean",
|
|
"default": true,
|
|
"description": "在函数声明上方显示方法级审查按钮"
|
|
},
|
|
"vscode-code-reviewer.codelens.languages": {
|
|
"type": "array",
|
|
"default": ["typescript", "javascript", "java", "python"],
|
|
"description": "启用方法级 CodeLens 的语言列表"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"scripts": {
|
|
"compile": "tsc -p ./ && node scripts/copy-webview-js.mjs",
|
|
"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/js": "^9.39.3",
|
|
"eslint": "^9.39.3",
|
|
"mammoth": "^1.12.0",
|
|
"officeparser": "^7.5.0",
|
|
"stylelint": "^17.14.0",
|
|
"stylelint-config-recommended": "^18.0.0",
|
|
"typescript-eslint": "^8.56.1",
|
|
"xlsx": "^0.18.5"
|
|
},
|
|
"devDependencies": {
|
|
"@types/mocha": "^10.0.10",
|
|
"@types/node": "22.x",
|
|
"@types/vscode": "^1.120.0",
|
|
"@vscode/test-cli": "^0.0.12",
|
|
"@vscode/test-electron": "^2.5.2",
|
|
"@vscode/vsce": "^3.9.2",
|
|
"esbuild": "^0.28.1",
|
|
"typescript": "^5.9.3"
|
|
}
|
|
}
|