✨ feat(vscode): 代码阅读入口、文件树与预览编辑器

This commit is contained in:
cruldra committed 2026-09-24 21:36:00 +08:00
1 parent 4d34b8c715
commit 2b823a32ca
24 files changed
+768 -72

No files matched your search

+83 -2
View File
@@ -33,7 +33,12 @@
"onView:superpowers.kanban",
"onCommand:superpowers.openKanban",
"onCommand:superpowers.setGiteaToken",
"onUri"
"onUri",
"onView:superpowers.codeReader.files",
"onCustomEditor:superpowers.codeReader.preview",
"onCommand:superpowers.codeReader.open",
"onCommand:superpowers.codeReader.showPreview",
"onCommand:superpowers.codeReader.showSource"
],
"contributes": {
"viewsContainers": {
@@ -42,6 +47,11 @@
"id": "superpowers",
"title": "Superpowers",
"icon": "res/icon.svg"
},
{
"id": "superpowers-reader",
"title": "代码阅读",
"icon": "res/reader.svg"
}
]
},
@@ -51,8 +61,26 @@
"id": "superpowers.kanban",
"name": "Kanban"
}
],
"superpowers-reader": [
{
"id": "superpowers.codeReader.files",
"name": "代码阅读"
}
]
},
"customEditors": [
{
"viewType": "superpowers.codeReader.preview",
"displayName": "代码阅读预览",
"selector": [
{
"filenamePattern": "*"
}
],
"priority": "option"
}
],
"viewsWelcome": [
{
"view": "superpowers.kanban",
@@ -74,6 +102,27 @@
"command": "superpowers.setGiteaToken",
"title": "Set Gitea Token",
"category": "Superpowers"
},
{
"command": "superpowers.codeReader.refresh",
"title": "刷新",
"category": "代码阅读",
"icon": "$(refresh)"
},
{
"command": "superpowers.codeReader.open",
"title": "打开",
"category": "代码阅读"
},
{
"command": "superpowers.codeReader.showPreview",
"title": "预览",
"category": "代码阅读"
},
{
"command": "superpowers.codeReader.showSource",
"title": "编辑",
"category": "代码阅读"
}
],
"menus": {
@@ -92,6 +141,37 @@
"command": "superpowers.setGiteaToken",
"when": "view == superpowers.kanban",
"group": "navigation"
},
{
"command": "superpowers.codeReader.refresh",
"when": "view == superpowers.codeReader.files",
"group": "navigation"
}
],
"editor/title": [
{
"command": "superpowers.codeReader.showPreview",
"when": "activeEditor == workbench.editors.files.textFileEditor && (resourceLangId =~ /^(typescript|typescriptreact|javascript|javascriptreact|python)$/ || resourceLangId in superpowers.codeReader.languageIds)",
"group": "navigation"
},
{
"command": "superpowers.codeReader.showSource",
"when": "activeCustomEditorId == superpowers.codeReader.preview",
"group": "navigation"
}
],
"commandPalette": [
{
"command": "superpowers.codeReader.open",
"when": "false"
},
{
"command": "superpowers.codeReader.showPreview",
"when": "activeEditor == workbench.editors.files.textFileEditor && (resourceLangId =~ /^(typescript|typescriptreact|javascript|javascriptreact|python)$/ || resourceLangId in superpowers.codeReader.languageIds)"
},
{
"command": "superpowers.codeReader.showSource",
"when": "activeCustomEditorId == superpowers.codeReader.preview"
}
]
}
@@ -110,7 +190,8 @@
"dependencies": {
"@vscode/tree-sitter-wasm": "^0.3.1",
"diff": "^9.0.0",
"handlebars": "^4.7.9"
"handlebars": "^4.7.9",
"minimatch": "^10.2.6"
},
"devDependencies": {
"@antfu/eslint-config": "^6.7.3",