File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -214,7 +214,11 @@ pub trait LanguagePlugin: Send + Sync {
214214 }
215215
216216 // 后执行钩子
217- fn post_execute_hook ( & self , _result : & mut ExecutionResult ) -> Result < ( ) , String > {
217+ fn post_execute_hook ( & self , result : & mut ExecutionResult ) -> Result < ( ) , String > {
218+ if result. success && result. stdout . is_empty ( ) && result. stderr . is_empty ( ) {
219+ result. stdout = "代码执行成功 (无输出)" . to_string ( ) ;
220+ }
221+
218222 Ok ( ( ) )
219223 }
220224}
Original file line number Diff line number Diff line change 1- use super :: { ExecutionResult , LanguagePlugin , PluginConfig } ;
1+ use super :: { LanguagePlugin , PluginConfig } ;
22
33pub struct Python3Plugin ;
44
@@ -39,20 +39,4 @@ impl LanguagePlugin for Python3Plugin {
3939 fn get_default_command ( & self ) -> String {
4040 self . get_config ( ) . unwrap ( ) . run_command . unwrap ( )
4141 }
42-
43- fn post_execute_hook ( & self , result : & mut ExecutionResult ) -> Result < ( ) , String > {
44- // Python 特定的后处理
45- if result. success && result. stdout . is_empty ( ) && result. stderr . is_empty ( ) {
46- result. stdout = "代码执行成功 (无输出)" . to_string ( ) ;
47- }
48-
49- // 清理 Python 特定的错误信息
50- if !result. stderr . is_empty ( ) {
51- result. stderr = result
52- . stderr
53- . replace ( "Traceback (most recent call last):" , "Error:" ) ;
54- }
55-
56- Ok ( ( ) )
57- }
5842}
Original file line number Diff line number Diff line change 11<template >
22 <div class =" -mt-2" >
3- <Tabs v-model =" activeTab" type =" card" size =" md" position =" left" :tabs =" tabsData" @change =" handleTabChange" >
3+ <Tabs v-model =" activeTab" type =" card" size =" md" position =" left" :tab-button-class = " ['w-36'] " : tabs =" tabsData" @change =" handleTabChange" >
44 <template #[activeTab ]=" { tab } " >
55 <h3 class =" text-lg font-semibold text-gray-900 dark:text-white mb-4 flex items-center" >
66 <Settings2 class =" w-5 h-5 mr-2" />
You can’t perform that action at this time.
0 commit comments