Files
2026Technology-Competition/package.json
T
范智鹏 3d8119d9c9 feat: 自动修复重构与审查面板交互修复 + 静态分析 AI 翻译配对 + SQLFluff 方言显示
- 自动修复:废弃 AI 修复,改 linter 原生 fix 多轮收敛;CodeAction hover + 面板修复/全部修复 + 快照 diff 撤销;hover 修复不入「已修复」列表、重新审查清空;修复/撤销后自动保存;单条修复只修目标问题(区间重叠收敛,不再连带相邻同规则)
- 审查面板:内联 JS 外部化(reviewPanel.js)修复 CSP 屏蔽导致的修复按钮/行号跳转/tab 失效;面板操作不依赖文件焦点(resolveFixDocument);行号跳转定位已打开编辑器,不在面板列新开副本
- 静态分析:translatedDiagnostics 规则 ID 归一化配对 + 深度审查 prompt 强化,静态分析条目显示中文翻译与逐条 AI 建议
- 波浪线:诊断补 source/code,hover 显示快速修复链接
- SQLFluff:设置面板方言徽章(显式/全局/项目/内置来源配色)
2026-08-18 21:41:51 +08:00

361 lines
10 KiB
JSON

{
"name": "vscode-code-reviewer",
"displayName": "净码特工 · Code Purifier",
"description": "AI 驱动的代码审查与规范检查一体化 VSCode 插件",
"version": "1.3.0",
"engines": {
"vscode": "^1.120.0"
},
"categories": [
"Other"
],
"activationEvents": [
"onStartupFinished"
],
"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.pmd.autoAuxClasspath": {
"type": "boolean",
"default": true,
"description": "自动探测 Maven/Gradle 依赖并传给 PMD 作为辅助 classpath"
},
"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.maxIterations": {
"type": "number",
"default": 3,
"description": "单条问题自动修复的最大循环轮次"
},
"vscode-code-reviewer.codelens.enabled": {
"type": "boolean",
"default": true,
"description": "在函数声明上方显示方法级审查按钮"
},
"vscode-code-reviewer.codelens.languages": {
"type": "array",
"default": ["typescript", "javascript", "java", "python"],
"description": "启用方法级 CodeLens 的语言列表"
},
"vscode-code-reviewer.markers.enabled": {
"type": "boolean",
"default": true,
"description": "在编辑器中显示代码审查波浪线标记"
}
}
}
},
"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"
}
}