feat(file-icons): 文件树按扩展名区分图标 + 对外 registerFileIcon API

- 新增内置扩展名→glyph 映射(md/媒体/pdf/json/代码/配置/数据库/压缩包,
  单色 currentColor 遵循皮肤契约,未知扩展回退 VscFile)
- ctx.betterSidebar 新增 registerFileIcon/getFileIcons/matchFileIcon
  (priority 降序,同优先级 catch-all 垫底),features 增加 'fileIcons'
- FileTree 文件行消费注册表:注册图标优先(可为彩色 ReactNode,
  工厂抛错回退内置),注册/注销即时生效
- 同步 docs/external-plugin-guide.md §7 与 tests/file-icons.spec.ts
This commit is contained in:
Menghuan1918
2026-09-08 21:11:32 +08:00
parent 146840bb4f
commit 05773e0f2a
7 changed files with 323 additions and 5 deletions
+2
View File
@@ -402,6 +402,7 @@ export function EditorHost(props: {
onReferenceFile={onReferenceFile}
onPathRenamed={onPathRenamed}
onPathDeleted={onPathDeleted}
service={ctx.get('betterSidebar')}
/>
</div>
)
@@ -526,6 +527,7 @@ export function EditorHost(props: {
onReferenceFile={onReferenceFile}
onPathRenamed={onPathRenamed}
onPathDeleted={onPathDeleted}
service={ctx.get('betterSidebar')}
/>
</div>
)}