aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/handlers/add_explicit_type.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-07-03 13:44:09 +0100
committerGitHub <[email protected]>2020-07-03 13:44:09 +0100
commitf51b0cfdd6c23dd57a0a11154179730171c0425d (patch)
treef856e6b751b23a20d68e9df5350ec39d5e8ee85b /crates/ra_assists/src/handlers/add_explicit_type.rs
parentef6a6d75d5dba2825e6b90e67e0b147a5f7158e1 (diff)
parent4c9347ecc3356748c52847a29d5e53a65778dc13 (diff)
Merge #5116
5116: Categorize assists r=matklad a=kjeremy Categorize assists so that editors can use them. Follows the LSP spec pretty close (and some things may need adjustments) but this populates the Refactor menu in vscode and pushes quickfixes through again. This is a prerequisite to filtering out assists that the client doesn't care about. Fixes #4147 Co-authored-by: Jeremy Kolb <[email protected]> Co-authored-by: kjeremy <[email protected]>
Diffstat (limited to 'crates/ra_assists/src/handlers/add_explicit_type.rs')
-rw-r--r--crates/ra_assists/src/handlers/add_explicit_type.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_assists/src/handlers/add_explicit_type.rs b/crates/ra_assists/src/handlers/add_explicit_type.rs
index 11df922a2..39a5321d1 100644
--- a/crates/ra_assists/src/handlers/add_explicit_type.rs
+++ b/crates/ra_assists/src/handlers/add_explicit_type.rs
@@ -4,7 +4,7 @@ use ra_syntax::{
4 TextRange, 4 TextRange,
5}; 5};
6 6
7use crate::{AssistContext, AssistId, Assists}; 7use crate::{AssistContext, AssistId, AssistKind, Assists};
8 8
9// Assist: add_explicit_type 9// Assist: add_explicit_type
10// 10//
@@ -59,7 +59,7 @@ pub(crate) fn add_explicit_type(acc: &mut Assists, ctx: &AssistContext) -> Optio
59 59
60 let inferred_type = ty.display_source_code(ctx.db(), module.into()).ok()?; 60 let inferred_type = ty.display_source_code(ctx.db(), module.into()).ok()?;
61 acc.add( 61 acc.add(
62 AssistId("add_explicit_type"), 62 AssistId("add_explicit_type", AssistKind::RefactorRewrite),
63 format!("Insert explicit type `{}`", inferred_type), 63 format!("Insert explicit type `{}`", inferred_type),
64 pat_range, 64 pat_range,
65 |builder| match ascribed_ty { 65 |builder| match ascribed_ty {