Send a `WorkDoneProgressBegin` notification for the given token. `title` is the short label shown by the editor (e.g. "Indexing"). `message` is an optional detail line (e.g. "Scanning subprojects").
(
&self,
token: &NumberOrString,
title: &str,
message: Option<String>,
)
| 1766 | /// `title` is the short label shown by the editor (e.g. "Indexing"). |
| 1767 | /// `message` is an optional detail line (e.g. "Scanning subprojects"). |
| 1768 | pub(crate) async fn progress_begin( |
| 1769 | &self, |
| 1770 | token: &NumberOrString, |
| 1771 | title: &str, |
| 1772 | message: Option<String>, |
| 1773 | ) { |
| 1774 | use tower_lsp::lsp_types::notification::Progress; |
| 1775 | |
| 1776 | let Some(client) = &self.client else { return }; |
| 1777 | client |
| 1778 | .send_notification::<Progress>(ProgressParams { |
| 1779 | token: token.clone(), |
| 1780 | value: ProgressParamsValue::WorkDone(WorkDoneProgress::Begin( |
| 1781 | WorkDoneProgressBegin { |
| 1782 | title: title.to_string(), |
| 1783 | cancellable: Some(false), |
| 1784 | message, |
| 1785 | percentage: Some(0), |
| 1786 | }, |
| 1787 | )), |
| 1788 | }) |
| 1789 | .await; |
| 1790 | } |
| 1791 | |
| 1792 | /// Send a `WorkDoneProgressReport` notification with a percentage |
| 1793 | /// and optional message. |
no test coverage detected