This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +32
-5
lines changed Expand file tree Collapse file tree 6 files changed +32
-5
lines changed Original file line number Diff line number Diff line change @@ -28,19 +28,20 @@ pub enum CargoTestMessage {
2828 } ,
2929 Suite ,
3030 Finished ,
31+ Custom {
32+ text : String ,
33+ } ,
3134}
3235
3336impl ParseFromLine for CargoTestMessage {
34- fn from_line ( line : & str , error : & mut String ) -> Option < Self > {
37+ fn from_line ( line : & str , _ : & mut String ) -> Option < Self > {
3538 let mut deserializer = serde_json:: Deserializer :: from_str ( line) ;
3639 deserializer. disable_recursion_limit ( ) ;
3740 if let Ok ( message) = CargoTestMessage :: deserialize ( & mut deserializer) {
3841 return Some ( message) ;
3942 }
4043
41- error. push_str ( line) ;
42- error. push ( '\n' ) ;
43- None
44+ Some ( CargoTestMessage :: Custom { text : line. to_owned ( ) } )
4445 }
4546
4647 fn from_eof ( ) -> Option < Self > {
Original file line number Diff line number Diff line change @@ -234,6 +234,13 @@ impl Notification for EndRunTest {
234234 const METHOD : & ' static str = "experimental/endRunTest" ;
235235}
236236
237+ pub enum AppendOutputToRunTest { }
238+
239+ impl Notification for AppendOutputToRunTest {
240+ type Params = String ;
241+ const METHOD : & ' static str = "experimental/appendOutputToRunTest" ;
242+ }
243+
237244pub enum AbortRunTest { }
238245
239246impl Notification for AbortRunTest {
Original file line number Diff line number Diff line change @@ -799,6 +799,9 @@ impl GlobalState {
799799 self . send_notification :: < lsp_ext:: EndRunTest > ( ( ) ) ;
800800 self . test_run_session = None ;
801801 }
802+ flycheck:: CargoTestMessage :: Custom { text } => {
803+ self . send_notification :: < lsp_ext:: AppendOutputToRunTest > ( text) ;
804+ }
802805 }
803806 }
804807
Original file line number Diff line number Diff line change 11<!-- -
2- lsp/ext.rs hash: 6bc140531b403717
2+ lsp/ext.rs hash: 61f485497d6e8e88
33
44If you need to change the above hash to make the test pass, please check if you
55need to adjust this doc as well and ping this issue:
@@ -509,6 +509,13 @@ interface ChangeTestStateParams {
509509}
510510```
511511
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+
512519## Open External Documentation
513520
514521This 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>(
100100export const runTest = new lc . RequestType < RunTestParams , void , void > ( "experimental/runTest" ) ;
101101export const abortRunTest = new lc . NotificationType0 ( "experimental/abortRunTest" ) ;
102102export const endRunTest = new lc . NotificationType0 ( "experimental/endRunTest" ) ;
103+ export const appendOutputToRunTest = new lc . NotificationType < string > (
104+ "experimental/appendOutputToRunTest" ,
105+ ) ;
103106export const changeTestState = new lc . NotificationType < ChangeTestStateParams > (
104107 "experimental/changeTestState" ,
105108) ;
Original file line number Diff line number Diff line change @@ -141,6 +141,12 @@ export const prepareTestExplorer = (
141141 } ) ,
142142 ) ;
143143
144+ ctx . pushClientCleanup (
145+ client . onNotification ( ra . appendOutputToRunTest , ( output ) => {
146+ currentTestRun ! . appendOutput ( `${ output } \r\n` ) ;
147+ } ) ,
148+ ) ;
149+
144150 ctx . pushClientCleanup (
145151 client . onNotification ( ra . changeTestState , ( results ) => {
146152 const test = idToTestMap . get ( results . testId ) ! ;
You can’t perform that action at this time.
0 commit comments