@@ -54,34 +54,29 @@ class ChatPreviewFileSystemProvider implements vscode.FileSystemProvider {
5454
5555export function registerCvbContextMenu ( context : vscode . ExtensionContext ) {
5656
57- // 注册右键菜单命令
5857 const applyCvbCommand = vscode . commands . registerCommand ( 'codeReDesign.applyThisCvb' , ( cvb : CvbFile ) => {
59- // 获取文件路径
6058 const filePath = cvb . resourceUri ?. fsPath || "" ;
61- // 调用处理函数
6259 applyThisCvb ( filePath ) ;
6360 } ) ;
61+ context . subscriptions . push ( applyCvbCommand ) ;
6462
65- // 注册上传 CVB 命令
6663 const uploadCvbCommand = vscode . commands . registerCommand ( 'codeReDesign.uploadThisCvb' , async ( cvb : CvbFile ) => {
6764 const filePath = cvb . resourceUri ?. fsPath || "" ;
6865 await uploadThisCvb ( filePath ) ;
6966 } ) ;
67+ context . subscriptions . push ( uploadCvbCommand ) ;
7068
71- // 注册分析 CVB 命令
7269 const analyzeCvbCommand = vscode . commands . registerCommand ( 'codeReDesign.analyzeThisCvb' , async ( cvb : CvbFile ) => {
7370 const filePath = cvb . resourceUri ?. fsPath || "" ;
7471 await analyzeThisCvb ( filePath ) ;
7572 } ) ;
73+ context . subscriptions . push ( analyzeCvbCommand ) ;
7674
77- // 注册分析 CVB 命令
7875 const compressCvbCommand = vscode . commands . registerCommand ( 'codeReDesign.compressThisCvb' , async ( cvb : CvbFile ) => {
7976 const filePath = cvb . resourceUri ?. fsPath || "" ;
8077 await compressThisCvb ( filePath ) ;
8178 } ) ;
82-
83- // 将命令添加到订阅中
84- context . subscriptions . push ( applyCvbCommand , uploadCvbCommand , analyzeCvbCommand ) ;
79+ context . subscriptions . push ( compressCvbCommand ) ;
8580
8681 // 注册 TreeDataProvider
8782 const cvbViewProvider = new CvbViewProvider ( ) ;
@@ -117,9 +112,9 @@ export function registerCvbContextMenu(context: vscode.ExtensionContext) {
117112
118113 const previewUri = vscode . Uri . parse ( `${ scheme } :/chat-preview.md` ) ;
119114
115+ // markdown 自定义渲染显示
120116 context . subscriptions . push (
121117 vscode . commands . registerCommand ( 'codeReDesign.showFile' , async ( uri : vscode . Uri ) => {
122- // 读取文件内容
123118 const content = await vscode . workspace . fs . readFile ( uri ) ;
124119 const rawText = Buffer . from ( content ) . toString ( 'utf-8' ) ;
125120
0 commit comments