Skip to content

Commit d8ddde2

Browse files
committed
Make cancelFlycheck request a notification
1 parent cdfe98f commit d8ddde2

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

crates/rust-analyzer/src/lsp_ext.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,8 @@ pub struct ExpandedMacro {
132132

133133
pub enum CancelFlycheck {}
134134

135-
impl Request for CancelFlycheck {
135+
impl Notification for CancelFlycheck {
136136
type Params = ();
137-
type Result = ();
138137
const METHOD: &'static str = "rust-analyzer/cancelFlycheck";
139138
}
140139

crates/rust-analyzer/src/main_loop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,6 @@ impl GlobalState {
635635
.on_sync_mut::<lsp_ext::ReloadWorkspace>(handlers::handle_workspace_reload)
636636
.on_sync_mut::<lsp_ext::MemoryUsage>(handlers::handle_memory_usage)
637637
.on_sync_mut::<lsp_ext::ShuffleCrateGraph>(handlers::handle_shuffle_crate_graph)
638-
.on_sync_mut::<lsp_ext::CancelFlycheck>(handlers::handle_cancel_flycheck)
639638
.on_sync::<lsp_ext::JoinLines>(handlers::handle_join_lines)
640639
.on_sync::<lsp_ext::OnEnter>(handlers::handle_on_enter)
641640
.on_sync::<lsp_types::request::SelectionRangeRequest>(handlers::handle_selection_range)
@@ -822,6 +821,7 @@ impl GlobalState {
822821
}
823822
Ok(())
824823
})?
824+
.on::<lsp_ext::CancelFlycheck>(handlers::handle_cancel_flycheck)?
825825
.on::<lsp_types::notification::DidChangeTextDocument>(|this, params| {
826826
if let Ok(path) = from_proto::vfs_path(&params.text_document.uri) {
827827
match this.mem_docs.get_mut(&path) {

editors/code/src/commands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ export function openDocs(ctx: CtxInit): Cmd {
788788

789789
export function cancelFlycheck(ctx: CtxInit): Cmd {
790790
return async () => {
791-
await ctx.client.sendRequest(ra.cancelFlycheck);
791+
await ctx.client.sendNotification(ra.cancelFlycheck);
792792
};
793793
}
794794

editors/code/src/lsp_ext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export const relatedTests = new lc.RequestType<lc.TextDocumentPositionParams, Te
7979
"rust-analyzer/relatedTests"
8080
);
8181

82-
export const cancelFlycheck = new lc.RequestType0<void, void>("rust-analyzer/cancelFlycheck");
82+
export const cancelFlycheck = new lc.NotificationType0("rust-analyzer/cancelFlycheck");
8383

8484
export const runFlycheck = new lc.NotificationType<{
8585
textDocument: lc.TextDocumentIdentifier | null;

0 commit comments

Comments
 (0)