aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/diagnostics
diff options
context:
space:
mode:
authorKirill Bulatov <[email protected]>2021-05-03 16:03:28 +0100
committerKirill Bulatov <[email protected]>2021-05-03 16:03:28 +0100
commit1679a376f30c5ad8971c0f855074a3f489fee5fa (patch)
tree1ffe5d504426f6e1d9cbf1c56d9e6b91ab9ac43d /crates/ide/src/diagnostics
parente5cdcb8b124f5b7d59950429787e760e46388f72 (diff)
Resolve single assist only
Diffstat (limited to 'crates/ide/src/diagnostics')
-rw-r--r--crates/ide/src/diagnostics/fixes.rs16
-rw-r--r--crates/ide/src/diagnostics/unlinked_file.rs2
2 files changed, 9 insertions, 9 deletions
diff --git a/crates/ide/src/diagnostics/fixes.rs b/crates/ide/src/diagnostics/fixes.rs
index f23064eac..15821500f 100644
--- a/crates/ide/src/diagnostics/fixes.rs
+++ b/crates/ide/src/diagnostics/fixes.rs
@@ -39,7 +39,7 @@ pub(crate) trait DiagnosticWithFix: Diagnostic {
39 fn fix( 39 fn fix(
40 &self, 40 &self,
41 sema: &Semantics<RootDatabase>, 41 sema: &Semantics<RootDatabase>,
42 _resolve: AssistResolveStrategy, 42 _resolve: &AssistResolveStrategy,
43 ) -> Option<Assist>; 43 ) -> Option<Assist>;
44} 44}
45 45
@@ -47,7 +47,7 @@ impl DiagnosticWithFix for UnresolvedModule {
47 fn fix( 47 fn fix(
48 &self, 48 &self,
49 sema: &Semantics<RootDatabase>, 49 sema: &Semantics<RootDatabase>,
50 _resolve: AssistResolveStrategy, 50 _resolve: &AssistResolveStrategy,
51 ) -> Option<Assist> { 51 ) -> Option<Assist> {
52 let root = sema.db.parse_or_expand(self.file)?; 52 let root = sema.db.parse_or_expand(self.file)?;
53 let unresolved_module = self.decl.to_node(&root); 53 let unresolved_module = self.decl.to_node(&root);
@@ -71,7 +71,7 @@ impl DiagnosticWithFix for NoSuchField {
71 fn fix( 71 fn fix(
72 &self, 72 &self,
73 sema: &Semantics<RootDatabase>, 73 sema: &Semantics<RootDatabase>,
74 _resolve: AssistResolveStrategy, 74 _resolve: &AssistResolveStrategy,
75 ) -> Option<Assist> { 75 ) -> Option<Assist> {
76 let root = sema.db.parse_or_expand(self.file)?; 76 let root = sema.db.parse_or_expand(self.file)?;
77 missing_record_expr_field_fix( 77 missing_record_expr_field_fix(
@@ -86,7 +86,7 @@ impl DiagnosticWithFix for MissingFields {
86 fn fix( 86 fn fix(
87 &self, 87 &self,
88 sema: &Semantics<RootDatabase>, 88 sema: &Semantics<RootDatabase>,
89 _resolve: AssistResolveStrategy, 89 _resolve: &AssistResolveStrategy,
90 ) -> Option<Assist> { 90 ) -> Option<Assist> {
91 // Note that although we could add a diagnostics to 91 // Note that although we could add a diagnostics to
92 // fill the missing tuple field, e.g : 92 // fill the missing tuple field, e.g :
@@ -126,7 +126,7 @@ impl DiagnosticWithFix for MissingOkOrSomeInTailExpr {
126 fn fix( 126 fn fix(
127 &self, 127 &self,
128 sema: &Semantics<RootDatabase>, 128 sema: &Semantics<RootDatabase>,
129 _resolve: AssistResolveStrategy, 129 _resolve: &AssistResolveStrategy,
130 ) -> Option<Assist> { 130 ) -> Option<Assist> {
131 let root = sema.db.parse_or_expand(self.file)?; 131 let root = sema.db.parse_or_expand(self.file)?;
132 let tail_expr = self.expr.to_node(&root); 132 let tail_expr = self.expr.to_node(&root);
@@ -143,7 +143,7 @@ impl DiagnosticWithFix for RemoveThisSemicolon {
143 fn fix( 143 fn fix(
144 &self, 144 &self,
145 sema: &Semantics<RootDatabase>, 145 sema: &Semantics<RootDatabase>,
146 _resolve: AssistResolveStrategy, 146 _resolve: &AssistResolveStrategy,
147 ) -> Option<Assist> { 147 ) -> Option<Assist> {
148 let root = sema.db.parse_or_expand(self.file)?; 148 let root = sema.db.parse_or_expand(self.file)?;
149 149
@@ -167,7 +167,7 @@ impl DiagnosticWithFix for IncorrectCase {
167 fn fix( 167 fn fix(
168 &self, 168 &self,
169 sema: &Semantics<RootDatabase>, 169 sema: &Semantics<RootDatabase>,
170 resolve: AssistResolveStrategy, 170 resolve: &AssistResolveStrategy,
171 ) -> Option<Assist> { 171 ) -> Option<Assist> {
172 let root = sema.db.parse_or_expand(self.file)?; 172 let root = sema.db.parse_or_expand(self.file)?;
173 let name_node = self.ident.to_node(&root); 173 let name_node = self.ident.to_node(&root);
@@ -191,7 +191,7 @@ impl DiagnosticWithFix for ReplaceFilterMapNextWithFindMap {
191 fn fix( 191 fn fix(
192 &self, 192 &self,
193 sema: &Semantics<RootDatabase>, 193 sema: &Semantics<RootDatabase>,
194 _resolve: AssistResolveStrategy, 194 _resolve: &AssistResolveStrategy,
195 ) -> Option<Assist> { 195 ) -> Option<Assist> {
196 let root = sema.db.parse_or_expand(self.file)?; 196 let root = sema.db.parse_or_expand(self.file)?;
197 let next_expr = self.next_expr.to_node(&root); 197 let next_expr = self.next_expr.to_node(&root);
diff --git a/crates/ide/src/diagnostics/unlinked_file.rs b/crates/ide/src/diagnostics/unlinked_file.rs
index e48528bed..93fd25dea 100644
--- a/crates/ide/src/diagnostics/unlinked_file.rs
+++ b/crates/ide/src/diagnostics/unlinked_file.rs
@@ -54,7 +54,7 @@ impl DiagnosticWithFix for UnlinkedFile {
54 fn fix( 54 fn fix(
55 &self, 55 &self,
56 sema: &hir::Semantics<RootDatabase>, 56 sema: &hir::Semantics<RootDatabase>,
57 _resolve: AssistResolveStrategy, 57 _resolve: &AssistResolveStrategy,
58 ) -> Option<Assist> { 58 ) -> Option<Assist> {
59 // If there's an existing module that could add a `mod` item to include the unlinked file, 59 // If there's an existing module that could add a `mod` item to include the unlinked file,
60 // suggest that as a fix. 60 // suggest that as a fix.