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 64
64
"type" : " lldb" ,
65
65
"request" : " attach" ,
66
66
"name" : " debug lsp" ,
67
- "program " : " plc " ,
67
+ "pid " : " ${command:pickProcess} "
68
68
},
69
69
{
70
70
"type" : " lldb" ,
Original file line number Diff line number Diff line change @@ -22,11 +22,11 @@ impl Future<()> for Delay{
22
22
thread::spawn(||=>{
23
23
let sec = self.sec - (unixtime() - self.start);
24
24
if sec <= 0 {
25
- wk.wake(wk.ch );
25
+ wk.wake();
26
26
return;
27
27
}
28
28
thread::sleep(sec);
29
- wk.wake(wk.ch );
29
+ wk.wake();
30
30
return;
31
31
});
32
32
return Pending{};
Original file line number Diff line number Diff line change @@ -21,11 +21,10 @@ impl Executor {
21
21
while true {
22
22
let work: |Waker|=>void = self.ch.recv();
23
23
let waker = Waker{
24
- wake: |ch | => void {
25
- ch.send(work);
24
+ wake: || => void {
25
+ self. ch.send(work);
26
26
return;
27
27
},
28
- ch: self.ch,
29
28
};
30
29
work(waker);
31
30
}
Original file line number Diff line number Diff line change 1
1
use std::chan;
2
2
pub struct Waker {
3
- pub wake:|*chan::Chan<|Waker|=>void>|=>void;
4
- pub ch:*chan::Chan<|Waker|=>void>;
3
+ pub wake:||=>void;
5
4
}
6
5
7
6
pub struct Pending {}
@@ -39,30 +38,28 @@ impl <T> Future<T> for FnFuture<T> {
39
38
40
39
use std::io;
41
40
41
+
42
42
impl <T|R> FutureExt<T|R> for Future<T> {
43
43
fn continue_with(f:|T|=>Future<R>) Future<R> {
44
44
let re = Pending{} as Poll<R>;
45
45
let ff = FnFuture<R>{};
46
46
ff.re = re;
47
47
ff.f = |wk:Waker|=> {
48
- let re = self.poll(Waker{wake:|ch |=>{
48
+ let re = self.poll(Waker{wake:||=>{
49
49
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
+ }
61
56
return;
62
- },ch:wk.ch });
57
+ }});
63
58
if re is Ready<T> {
64
59
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;
66
63
}
67
64
return Pending{} as Poll<R>;
68
65
};
Original file line number Diff line number Diff line change @@ -120,7 +120,8 @@ impl Ctx<'_> {
120
120
. push ( range. to_diag_range ( ) , type_index ( tp) , modifiers)
121
121
}
122
122
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 {
124
125
return ;
125
126
}
126
127
let colon = InlayHintLabelPart {
@@ -151,7 +152,8 @@ impl Ctx<'_> {
151
152
self . plmod . hints . borrow_mut ( ) . push ( hint) ;
152
153
}
153
154
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 {
155
157
return ;
156
158
}
157
159
let hint = InlayHint {
Original file line number Diff line number Diff line change @@ -13,12 +13,18 @@ pub fn test_future() void {
13
13
let ff1 = f.continue_with(|r:()| => {
14
14
println!("Hello from future");
15
15
return future::nothing_future();
16
+ }).continue_with(|r:()| => {
17
+ println!("continue Hello from future");
18
+ return future::nothing_future();
16
19
});
17
20
18
21
let f2:future::Future<()> = future::delay(1 as u64);
19
22
let ff2 = f2.continue_with(|r:()| => {
20
23
println!("Hello from future2");
21
24
return future::nothing_future();
25
+ }).continue_with(|r:()| => {
26
+ println!("continue Hello from future2");
27
+ return future::nothing_future();
22
28
});
23
29
exe.spawn(ff1);
24
30
exe.spawn(ff2);
You can’t perform that action at this time.
0 commit comments