Skip to content

Commit 24262f9

Browse files
committed
minor
1 parent 949a6ec commit 24262f9

File tree

3 files changed

+34
-44
lines changed

3 files changed

+34
-44
lines changed

crates/ide/src/diagnostics.rs

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -251,16 +251,6 @@ pub(crate) fn diagnostics(
251251
res
252252
}
253253

254-
fn diagnostic_with_fix<D: DiagnosticWithFixes>(
255-
d: &D,
256-
sema: &Semantics<RootDatabase>,
257-
resolve: &AssistResolveStrategy,
258-
) -> Diagnostic {
259-
Diagnostic::error(sema.diagnostics_display_range(d.display_source()).range, d.message())
260-
.with_fixes(d.fixes(sema, resolve))
261-
.with_code(Some(d.code()))
262-
}
263-
264254
fn warning_with_fix<D: DiagnosticWithFixes>(
265255
d: &D,
266256
sema: &Semantics<RootDatabase>,
@@ -446,39 +436,6 @@ mod tests {
446436
}
447437
}
448438

449-
#[test]
450-
fn range_mapping_out_of_macros() {
451-
// FIXME: this is very wrong, but somewhat tricky to fix.
452-
check_fix(
453-
r#"
454-
fn some() {}
455-
fn items() {}
456-
fn here() {}
457-
458-
macro_rules! id { ($($tt:tt)*) => { $($tt)*}; }
459-
460-
fn main() {
461-
let _x = id![Foo { a: $042 }];
462-
}
463-
464-
pub struct Foo { pub a: i32, pub b: i32 }
465-
"#,
466-
r#"
467-
fn some(, b: () ) {}
468-
fn items() {}
469-
fn here() {}
470-
471-
macro_rules! id { ($($tt:tt)*) => { $($tt)*}; }
472-
473-
fn main() {
474-
let _x = id![Foo { a: 42 }];
475-
}
476-
477-
pub struct Foo { pub a: i32, pub b: i32 }
478-
"#,
479-
);
480-
}
481-
482439
#[test]
483440
fn test_check_unnecessary_braces_in_use_statement() {
484441
check_diagnostics(

crates/ide/src/diagnostics/missing_fields.rs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,39 @@ fn baz(s: S) {
9393
);
9494
}
9595

96+
#[test]
97+
fn range_mapping_out_of_macros() {
98+
// FIXME: this is very wrong, but somewhat tricky to fix.
99+
check_fix(
100+
r#"
101+
fn some() {}
102+
fn items() {}
103+
fn here() {}
104+
105+
macro_rules! id { ($($tt:tt)*) => { $($tt)*}; }
106+
107+
fn main() {
108+
let _x = id![Foo { a: $042 }];
109+
}
110+
111+
pub struct Foo { pub a: i32, pub b: i32 }
112+
"#,
113+
r#"
114+
fn some(, b: () ) {}
115+
fn items() {}
116+
fn here() {}
117+
118+
macro_rules! id { ($($tt:tt)*) => { $($tt)*}; }
119+
120+
fn main() {
121+
let _x = id![Foo { a: 42 }];
122+
}
123+
124+
pub struct Foo { pub a: i32, pub b: i32 }
125+
"#,
126+
);
127+
}
128+
96129
#[test]
97130
fn test_fill_struct_fields_empty() {
98131
check_fix(

crates/ide/src/diagnostics/missing_ok_or_some_in_tail_expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use hir::{db::AstDatabase, Semantics};
1+
use hir::db::AstDatabase;
22
use ide_assists::Assist;
33
use ide_db::source_change::SourceChange;
44
use syntax::AstNode;

0 commit comments

Comments
 (0)