File tree 6 files changed +32
-5
lines changed
6 files changed +32
-5
lines changed Original file line number Diff line number Diff line change @@ -28,19 +28,20 @@ pub enum CargoTestMessage {
28
28
} ,
29
29
Suite ,
30
30
Finished ,
31
+ Custom {
32
+ text : String ,
33
+ } ,
31
34
}
32
35
33
36
impl ParseFromLine for CargoTestMessage {
34
- fn from_line ( line : & str , error : & mut String ) -> Option < Self > {
37
+ fn from_line ( line : & str , _ : & mut String ) -> Option < Self > {
35
38
let mut deserializer = serde_json:: Deserializer :: from_str ( line) ;
36
39
deserializer. disable_recursion_limit ( ) ;
37
40
if let Ok ( message) = CargoTestMessage :: deserialize ( & mut deserializer) {
38
41
return Some ( message) ;
39
42
}
40
43
41
- error. push_str ( line) ;
42
- error. push ( '\n' ) ;
43
- None
44
+ Some ( CargoTestMessage :: Custom { text : line. to_owned ( ) } )
44
45
}
45
46
46
47
fn from_eof ( ) -> Option < Self > {
Original file line number Diff line number Diff line change @@ -234,6 +234,13 @@ impl Notification for EndRunTest {
234
234
const METHOD : & ' static str = "experimental/endRunTest" ;
235
235
}
236
236
237
+ pub enum AppendOutputToRunTest { }
238
+
239
+ impl Notification for AppendOutputToRunTest {
240
+ type Params = String ;
241
+ const METHOD : & ' static str = "experimental/appendOutputToRunTest" ;
242
+ }
243
+
237
244
pub enum AbortRunTest { }
238
245
239
246
impl Notification for AbortRunTest {
Original file line number Diff line number Diff line change @@ -799,6 +799,9 @@ impl GlobalState {
799
799
self . send_notification :: < lsp_ext:: EndRunTest > ( ( ) ) ;
800
800
self . test_run_session = None ;
801
801
}
802
+ flycheck:: CargoTestMessage :: Custom { text } => {
803
+ self . send_notification :: < lsp_ext:: AppendOutputToRunTest > ( text) ;
804
+ }
802
805
}
803
806
}
804
807
Original file line number Diff line number Diff line change 1
1
<!-- -
2
- lsp/ext.rs hash: 6bc140531b403717
2
+ lsp/ext.rs hash: 61f485497d6e8e88
3
3
4
4
If you need to change the above hash to make the test pass, please check if you
5
5
need to adjust this doc as well and ping this issue:
@@ -509,6 +509,13 @@ interface ChangeTestStateParams {
509
509
}
510
510
```
511
511
512
+ ** Method:** ` experimental/appendOutputToRunTest `
513
+
514
+ ** Notification:** ` string `
515
+
516
+ This notification is used for reporting messages independent of any single test and related to the run session
517
+ in general, e.g. cargo compiling progress messages or warnings.
518
+
512
519
## Open External Documentation
513
520
514
521
This request is sent from the client to the server to obtain web and local URL(s) for documentation related to the symbol under the cursor, if available.
Original file line number Diff line number Diff line change @@ -100,6 +100,9 @@ export const discoveredTests = new lc.NotificationType<DiscoverTestResults>(
100
100
export const runTest = new lc . RequestType < RunTestParams , void , void > ( "experimental/runTest" ) ;
101
101
export const abortRunTest = new lc . NotificationType0 ( "experimental/abortRunTest" ) ;
102
102
export const endRunTest = new lc . NotificationType0 ( "experimental/endRunTest" ) ;
103
+ export const appendOutputToRunTest = new lc . NotificationType < string > (
104
+ "experimental/appendOutputToRunTest" ,
105
+ ) ;
103
106
export const changeTestState = new lc . NotificationType < ChangeTestStateParams > (
104
107
"experimental/changeTestState" ,
105
108
) ;
Original file line number Diff line number Diff line change @@ -141,6 +141,12 @@ export const prepareTestExplorer = (
141
141
} ) ,
142
142
) ;
143
143
144
+ ctx . pushClientCleanup (
145
+ client . onNotification ( ra . appendOutputToRunTest , ( output ) => {
146
+ currentTestRun ! . appendOutput ( `${ output } \r\n` ) ;
147
+ } ) ,
148
+ ) ;
149
+
144
150
ctx . pushClientCleanup (
145
151
client . onNotification ( ra . changeTestState , ( results ) => {
146
152
const test = idToTestMap . get ( results . testId ) ! ;
You can’t perform that action at this time.
0 commit comments