Send a `WorkDoneProgressReport` notification with a percentage and optional message. `percentage` should be in the range 0..=100. `message` replaces the previous detail line when `Some`.
(
&self,
token: &NumberOrString,
percentage: u32,
message: Option<String>,
)
| 1795 | /// `percentage` should be in the range 0..=100. `message` replaces |
| 1796 | /// the previous detail line when `Some`. |
| 1797 | pub(crate) async fn progress_report( |
| 1798 | &self, |
| 1799 | token: &NumberOrString, |
| 1800 | percentage: u32, |
| 1801 | message: Option<String>, |
| 1802 | ) { |
| 1803 | use tower_lsp::lsp_types::notification::Progress; |
| 1804 | |
| 1805 | let Some(client) = &self.client else { return }; |
| 1806 | client |
| 1807 | .send_notification::<Progress>(ProgressParams { |
| 1808 | token: token.clone(), |
| 1809 | value: ProgressParamsValue::WorkDone(WorkDoneProgress::Report( |
| 1810 | WorkDoneProgressReport { |
| 1811 | cancellable: Some(false), |
| 1812 | message, |
| 1813 | percentage: Some(percentage), |
| 1814 | }, |
| 1815 | )), |
| 1816 | }) |
| 1817 | .await; |
| 1818 | } |
| 1819 | |
| 1820 | /// Send a `WorkDoneProgressEnd` notification. |
| 1821 | /// |
no test coverage detected