File tree Expand file tree Collapse file tree 6 files changed +28
-24
lines changed Expand file tree Collapse file tree 6 files changed +28
-24
lines changed Original file line number Diff line number Diff line change 6464            "type" : " lldb"  ,
6565            "request" : " attach"  ,
6666            "name" : " debug lsp"  ,
67-             "program " : " plc " , 
67+             "pid " : " ${command:pickProcess} " 
6868        },
6969        {
7070            "type" : " lldb"  ,
Original file line number Diff line number Diff line change @@ -22,11 +22,11 @@ impl Future<()> for Delay{
2222        thread::spawn(||=>{
2323            let sec = self.sec - (unixtime() - self.start);
2424            if sec <= 0 {
25-                 wk.wake(wk.ch );
25+                 wk.wake();
2626                return;
2727            }
2828            thread::sleep(sec);
29-             wk.wake(wk.ch );
29+             wk.wake();
3030            return;
3131        });
3232        return Pending{};
Original file line number Diff line number Diff line change @@ -21,11 +21,10 @@ impl Executor {
2121        while true {
2222            let work: |Waker|=>void = self.ch.recv();
2323            let waker = Waker{
24-                 wake: |ch | => void {
25-                     ch.send(work);
24+                 wake: || => void {
25+                     self. ch.send(work);
2626                    return;  
2727                },
28-                 ch: self.ch,
2928            };
3029            work(waker);
3130        }
Original file line number Diff line number Diff line change 11use std::chan;
22pub struct Waker {
3-     pub wake:|*chan::Chan<|Waker|=>void>|=>void;
4-     pub ch:*chan::Chan<|Waker|=>void>;
3+     pub wake:||=>void;
54}
65
76pub struct Pending {}
@@ -39,30 +38,28 @@ impl <T> Future<T> for FnFuture<T> {
3938
4039use std::io;
4140
41+ 
4242impl <T|R> FutureExt<T|R> for Future<T> {
4343    fn continue_with(f:|T|=>Future<R>) Future<R> {
4444        let re = Pending{} as Poll<R>;
4545        let ff = FnFuture<R>{};
4646        ff.re = re;
4747        ff.f = |wk:Waker|=> {
48-             let re = self.poll(Waker{wake:|ch |=>{
48+             let re = self.poll(Waker{wake:||=>{
4949                let re = self.poll(Waker{}) as Ready<T>!;
50- 
51-                 ch.send(|_wk:Waker|=>{
52-                     let re1 = f(re.v);
53-                     let result = re1.poll(wk);
54-                     ff.re = result;
55-                     if result is Ready<R>{
56-                         wk.wake(wk.ch);
57-                     }
58-                     return;
59-                 });
60- 
50+                 let re1 = f(re.v);
51+                 let result = re1.poll(wk);
52+                 ff.re = result;
53+                 if result is Ready<R>{
54+                     wk.wake();
55+                 }
6156                return;
62-             },ch:wk.ch });
57+             }});
6358            if re is Ready<T> {
6459                let re = f((re as Ready<T>!).v);
65-                 return re.poll(wk);
60+                 let result = re.poll(wk);
61+                 ff.re = result;
62+                 return result;
6663            }
6764            return Pending{} as Poll<R>;
6865        };
Original file line number Diff line number Diff line change @@ -120,7 +120,8 @@ impl Ctx<'_> {
120120            . push ( range. to_diag_range ( ) ,  type_index ( tp) ,  modifiers) 
121121    } 
122122    pub  fn  push_type_hints ( & self ,  range :  Range ,  pltype :  Arc < RefCell < PLType > > )  { 
123-         if  self . need_highlight . borrow ( ) . ne ( & 0 )  || self . in_macro  { 
123+         let  ori_mod = unsafe  {  & * self . origin_mod  as  & crate :: ast:: plmod:: Mod  } ; 
124+         if  self . need_highlight . borrow ( ) . ne ( & 0 )  || self . in_macro  || ori_mod. path  != self . plmod . path  { 
124125            return ; 
125126        } 
126127        let  colon = InlayHintLabelPart  { 
@@ -151,7 +152,8 @@ impl Ctx<'_> {
151152        self . plmod . hints . borrow_mut ( ) . push ( hint) ; 
152153    } 
153154    pub  fn  push_param_hint ( & self ,  range :  Range ,  name :  Ustr )  { 
154-         if  self . need_highlight . borrow ( ) . ne ( & 0 )  || self . in_macro  { 
155+         let  ori_mod = unsafe  {  & * self . origin_mod  as  & crate :: ast:: plmod:: Mod  } ; 
156+         if  self . need_highlight . borrow ( ) . ne ( & 0 )  || self . in_macro  || ori_mod. path  != self . plmod . path  { 
155157            return ; 
156158        } 
157159        let  hint = InlayHint  { 
Original file line number Diff line number Diff line change @@ -13,12 +13,18 @@ pub fn test_future() void {
1313    let ff1 = f.continue_with(|r:()| => {
1414        println!("Hello from future");
1515        return future::nothing_future();
16+     }).continue_with(|r:()| => {
17+         println!("continue Hello from future");
18+         return future::nothing_future();
1619    });
1720
1821    let f2:future::Future<()> = future::delay(1 as u64);
1922    let ff2 = f2.continue_with(|r:()| => {
2023        println!("Hello from future2");
2124        return future::nothing_future();
25+     }).continue_with(|r:()| => {
26+         println!("continue Hello from future2");
27+         return future::nothing_future();
2228    });
2329    exe.spawn(ff1);
2430    exe.spawn(ff2);
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments