File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -343,6 +343,20 @@ pub async fn execute_code(
343343
344344 let _ = plugin. post_execute_hook ( & mut result) ;
345345
346+ if result. success
347+ && result. stdout == String :: from ( "END-NO-OUTPUT" )
348+ && result. stderr == String :: from ( "END-NO-OUTPUT" )
349+ {
350+ let _ = app. emit (
351+ "code-output" ,
352+ serde_json:: json!( {
353+ "type" : "stdout" ,
354+ "content" : "代码执行成功 (无输出)" ,
355+ "language" : request. language
356+ } ) ,
357+ ) ;
358+ }
359+
346360 let _ = app. emit (
347361 "code-execution-complete" ,
348362 serde_json:: json!( {
Original file line number Diff line number Diff line change @@ -295,10 +295,20 @@ pub trait LanguagePlugin: Send + Sync {
295295
296296 // 后执行钩子
297297 fn post_execute_hook ( & self , result : & mut ExecutionResult ) -> Result < ( ) , String > {
298+ info ! (
299+ "执行代码 -> 插件 [ {} ] 处理 post_execute_hook 开始" ,
300+ self . get_language_key( )
301+ ) ;
302+
298303 if result. success && result. stdout . is_empty ( ) && result. stderr . is_empty ( ) {
299- result. stdout = "代码执行成功 (无输出)" . to_string ( ) ;
304+ result. stdout = String :: from ( "END-NO-OUTPUT" ) ;
305+ result. stderr = String :: from ( "END-NO-OUTPUT" ) ;
300306 }
301307
308+ info ! (
309+ "执行代码 -> 插件 [ {} ] 处理 post_execute_hook 结束" ,
310+ self . get_language_key( )
311+ ) ;
302312 Ok ( ( ) )
303313 }
304314}
Original file line number Diff line number Diff line change @@ -338,6 +338,7 @@ const clearOutput = () => {
338338// 处理实时输出
339339const handleRealtimeOutput = (event : any ) => {
340340 const data: CodeOutputEvent = event .payload
341+ console .log (' 实时输出:' , data )
341342
342343 // 只处理当前语言的输出
343344 if (data .language !== currentLanguage .value ) {
@@ -415,7 +416,7 @@ const handleExecutionError = (event: any) => {
415416}
416417
417418// 禁用右键菜单
418- window .addEventListener (' contextmenu' , (e ) => e .preventDefault (), false )
419+ // window.addEventListener('contextmenu', (e) => e.preventDefault(), false)
419420
420421onMounted (async () => {
421422 await getSupportedLanguages ()
You can’t perform that action at this time.
0 commit comments