From 183a38fb50f284de1ca02c05ed945e240f3c0274 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 26 Sep 2019 12:18:26 +0300 Subject: keep ast creation API simple --- crates/ra_ide_api/src/diagnostics.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'crates/ra_ide_api') diff --git a/crates/ra_ide_api/src/diagnostics.rs b/crates/ra_ide_api/src/diagnostics.rs index f07061e99..144bc0a70 100644 --- a/crates/ra_ide_api/src/diagnostics.rs +++ b/crates/ra_ide_api/src/diagnostics.rs @@ -2,11 +2,11 @@ use std::cell::RefCell; use hir::diagnostics::{AstDiagnostic, Diagnostic as _, DiagnosticSink}; use itertools::Itertools; -use ra_assists::{ast_builder::Make, ast_editor::AstEditor}; +use ra_assists::ast_editor::AstEditor; use ra_db::SourceDatabase; use ra_prof::profile; use ra_syntax::{ - ast::{self, AstNode}, + ast::{self, make, AstNode}, Location, SyntaxNode, TextRange, T, }; use ra_text_edit::{TextEdit, TextEditBuilder}; @@ -59,10 +59,7 @@ pub(crate) fn diagnostics(db: &RootDatabase, file_id: FileId) -> Vec let node = d.ast(db); let mut ast_editor = AstEditor::new(node); for f in d.missed_fields.iter() { - let field = Make::::from( - Make::::from(&f.to_string()), - Some(Make::::unit()), - ); + let field = make::record_field(make::name_ref(&f.to_string()), Some(make::expr_unit())); ast_editor.append_field(&field); } -- cgit v1.2.3