@@ -3,7 +3,7 @@ use mlua::prelude::*;
33
44use super :: ext:: a_sync:: a_sync;
55
6- super :: ext:: impl_lua_serde! { CodempEvent }
6+ super :: ext:: impl_lua_serde! { CodempEvent CodempWorkspaceInfo }
77
88impl LuaUserData for CodempWorkspace {
99 fn add_methods < M : LuaUserDataMethods < Self > > ( methods : & mut M ) {
@@ -12,7 +12,7 @@ impl LuaUserData for CodempWorkspace {
1212 } ) ;
1313 methods. add_method (
1414 "create_buffer" ,
15- |_, this, ( name, ) : ( String , ) | a_sync ! { this => this. create_buffer( & name) . await ? } ,
15+ |_, this, ( name, ephemeral ) : ( String , bool ) | a_sync ! { this => this. create_buffer( & name, ephemeral ) . await ? } ,
1616 ) ;
1717
1818 methods. add_method (
@@ -34,25 +34,25 @@ impl LuaUserData for CodempWorkspace {
3434 } ) ;
3535
3636 methods. add_method (
37- "fetch_buffers " ,
38- |_, this, ( ) | a_sync ! { this => this. fetch_buffers ( ) . await ? } ,
37+ "list_buffers " ,
38+ |_, this, ( filter , ) : ( String , ) | a_sync ! { this => this. list_buffers ( filter ) . await ? } ,
3939 ) ;
4040 methods. add_method (
41- "fetch_users " ,
42- |_, this, ( ) | a_sync ! { this => this. fetch_users ( ) . await ? } ,
41+ "list_users " ,
42+ |_, this, ( ) | a_sync ! { this => this. list_users ( ) . await ? } ,
4343 ) ;
4444
4545 methods. add_method ( "search_buffers" , |_, this, ( filter, ) : ( Option < String > , ) | {
4646 Ok ( this. search_buffers ( filter. as_deref ( ) ) )
4747 } ) ;
4848
49- methods. add_method ( "fetch_buffer_users " , |_, this, ( path, ) : ( String , ) | {
49+ methods. add_method ( "list_buffer_users " , |_, this, ( path, ) : ( String , ) | {
5050 a_sync ! {
51- this => this. fetch_buffer_users ( & path) . await ?
51+ this => this. list_buffer_users ( & path) . await ?
5252 }
5353 } ) ;
5454
55- methods. add_method ( "id" , |_, this, ( ) | Ok ( this. id ( ) ) ) ;
55+ methods. add_method ( "id" , |_, this, ( ) | Ok ( this. id ( ) . to_string ( ) ) ) ;
5656 methods. add_method ( "cursor" , |_, this, ( ) | Ok ( this. cursor ( ) ) ) ;
5757 methods. add_method ( "active_buffers" , |_, this, ( ) | Ok ( this. active_buffers ( ) ) ) ;
5858 methods. add_method ( "user_list" , |_, this, ( ) | Ok ( this. user_list ( ) ) ) ;
0 commit comments