File tree Expand file tree Collapse file tree 5 files changed +20
-5
lines changed
Expand file tree Collapse file tree 5 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -315,6 +315,17 @@ impl StreamHandler<Stdout> for ProjectLsp {
315315 }
316316 LspOutput :: Request ( req) => {
317317 local_log:: request:: trace!( target: self . project_id, "{req:?}" ) ;
318+ match serde_json:: to_value ( req) {
319+ Ok ( data) => {
320+ _ = self . broadcast . send ( InternalMessage :: Lsp {
321+ client_id : None ,
322+ data,
323+ } ) ;
324+ }
325+ Err ( err) => {
326+ local_log:: request:: error!( target: self . project_id, "Cannot serialize {err:?}" ) ;
327+ }
328+ }
318329 }
319330 LspOutput :: Notify ( noti) => {
320331 local_log:: notify:: trace!( target: self . project_id, "{noti:?}" ) ;
Original file line number Diff line number Diff line change @@ -85,8 +85,6 @@ pub async fn create_project(
8585
8686 project. permit_access ( user_info. id . clone ( ) , AccessLevel :: Editor ) ;
8787
88- project. start_lsp ( ) . await ;
89-
9088 Ok ( HttpResponse :: Created ( ) . json ( json ! ( {
9189 "id" : project. id
9290 } ) ) )
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ pub use async_default::AsyncDefault;
99pub use async_from:: AsyncInto ;
1010pub use expect_var:: expect_var;
1111pub ( crate ) use logger:: define_local_logger;
12- pub use printers:: { Truncate , Truncated } ;
12+ pub use printers:: Truncate ;
1313pub use to_stream:: ToStream ;
1414
1515use std:: sync:: { Arc , LazyLock } ;
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ use uuid::Uuid;
99
1010use crate :: collab:: { Document , DocumentInfo , UserOperation } ;
1111use crate :: project:: AccessLevel ;
12- use crate :: utils:: { ArcStr , Truncate , Truncated } ;
12+ use crate :: utils:: { ArcStr , Truncate } ;
1313
1414#[ derive( Serialize , Deserialize ) ]
1515#[ serde( tag = "action" , rename_all = "snake_case" ) ]
Original file line number Diff line number Diff line change @@ -40,10 +40,16 @@ impl RgWebsocket {
4040 } ;
4141 let mut project = project. write ( ) . await ;
4242
43+ let access = project. join_project ( user_info. id . clone ( ) , password) ?;
44+
45+ if access. can_read ( ) {
46+ project. start_lsp ( ) . await ;
47+ }
48+
4349 (
4450 project. internal . subscribe ( ) ,
4551 project. broadcast . subscribe ( ) ,
46- project . join_project ( user_info . id . clone ( ) , password ) ? ,
52+ access ,
4753 )
4854 } ;
4955
You can’t perform that action at this time.
0 commit comments