From 0a9e3ccc262fbcbd4cdaab30384f8cb71584544b Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 16:49:13 +0200 Subject: Rename FieldDef -> Field --- crates/ra_ide/src/diagnostics.rs | 16 ++++++++-------- crates/ra_ide/src/display/navigation_target.rs | 4 ++-- crates/ra_ide/src/display/short_label.rs | 2 +- crates/ra_ide/src/extend_selection.rs | 4 ++-- crates/ra_ide/src/file_structure.rs | 4 ++-- crates/ra_ide/src/folding_ranges.rs | 2 +- crates/ra_ide/src/references.rs | 4 ++-- crates/ra_ide/src/syntax_highlighting.rs | 2 +- 8 files changed, 19 insertions(+), 19 deletions(-) (limited to 'crates/ra_ide/src') diff --git a/crates/ra_ide/src/diagnostics.rs b/crates/ra_ide/src/diagnostics.rs index efbb00d6d..dd8a7ffd9 100644 --- a/crates/ra_ide/src/diagnostics.rs +++ b/crates/ra_ide/src/diagnostics.rs @@ -155,21 +155,21 @@ fn missing_struct_field_fix( module = s.module(sema.db); let source = s.source(sema.db); def_file_id = source.file_id; - let fields = source.value.field_def_list()?; - record_field_def_list(fields)? + let fields = source.value.field_list()?; + record_field_list(fields)? } VariantDef::Union(u) => { module = u.module(sema.db); let source = u.source(sema.db); def_file_id = source.file_id; - source.value.record_field_def_list()? + source.value.record_field_list()? } VariantDef::EnumVariant(e) => { module = e.module(sema.db); let source = e.source(sema.db); def_file_id = source.file_id; - let fields = source.value.field_def_list()?; - record_field_def_list(fields)? + let fields = source.value.field_list()?; + record_field_list(fields)? } }; let def_file_id = def_file_id.original_file(sema.db); @@ -205,10 +205,10 @@ fn missing_struct_field_fix( let fix = Fix::new("Create field", source_change.into()); return Some(fix); - fn record_field_def_list(field_def_list: ast::FieldDefList) -> Option { + fn record_field_list(field_def_list: ast::FieldList) -> Option { match field_def_list { - ast::FieldDefList::RecordFieldDefList(it) => Some(it), - ast::FieldDefList::TupleFieldDefList(_) => None, + ast::FieldList::RecordFieldList(it) => Some(it), + ast::FieldList::TupleFieldList(_) => None, } } } diff --git a/crates/ra_ide/src/display/navigation_target.rs b/crates/ra_ide/src/display/navigation_target.rs index 4f19c7ed4..797d2d8e3 100644 --- a/crates/ra_ide/src/display/navigation_target.rs +++ b/crates/ra_ide/src/display/navigation_target.rs @@ -387,7 +387,7 @@ pub(crate) fn docs_from_symbol(db: &RootDatabase, symbol: &FileSymbol) -> Option ast::TypeAlias(it) => it.doc_comment_text(), ast::ConstDef(it) => it.doc_comment_text(), ast::StaticDef(it) => it.doc_comment_text(), - ast::RecordFieldDef(it) => it.doc_comment_text(), + ast::RecordField(it) => it.doc_comment_text(), ast::EnumVariant(it) => it.doc_comment_text(), ast::MacroCall(it) => it.doc_comment_text(), _ => None, @@ -412,7 +412,7 @@ pub(crate) fn description_from_symbol(db: &RootDatabase, symbol: &FileSymbol) -> ast::TypeAlias(it) => it.short_label(), ast::ConstDef(it) => it.short_label(), ast::StaticDef(it) => it.short_label(), - ast::RecordFieldDef(it) => it.short_label(), + ast::RecordField(it) => it.short_label(), ast::EnumVariant(it) => it.short_label(), _ => None, } diff --git a/crates/ra_ide/src/display/short_label.rs b/crates/ra_ide/src/display/short_label.rs index e2c95be06..78a2598d6 100644 --- a/crates/ra_ide/src/display/short_label.rs +++ b/crates/ra_ide/src/display/short_label.rs @@ -65,7 +65,7 @@ impl ShortLabel for ast::StaticDef { } } -impl ShortLabel for ast::RecordFieldDef { +impl ShortLabel for ast::RecordField { fn short_label(&self) -> Option { short_label_from_ascribed_node(self, "") } diff --git a/crates/ra_ide/src/extend_selection.rs b/crates/ra_ide/src/extend_selection.rs index 597a7d82f..04a7f0ac4 100644 --- a/crates/ra_ide/src/extend_selection.rs +++ b/crates/ra_ide/src/extend_selection.rs @@ -39,8 +39,8 @@ fn try_extend_selection( let list_kinds = [ RECORD_FIELD_PAT_LIST, MATCH_ARM_LIST, - RECORD_FIELD_DEF_LIST, - TUPLE_FIELD_DEF_LIST, + RECORD_FIELD_LIST, + TUPLE_FIELD_LIST, RECORD_EXPR_FIELD_LIST, ENUM_VARIANT_LIST, USE_TREE_LIST, diff --git a/crates/ra_ide/src/file_structure.rs b/crates/ra_ide/src/file_structure.rs index 05ccc0b73..a8fd1a2fd 100644 --- a/crates/ra_ide/src/file_structure.rs +++ b/crates/ra_ide/src/file_structure.rs @@ -136,7 +136,7 @@ fn structure_node(node: &SyntaxNode) -> Option { let ty = it.type_ref(); decl_with_type_ref(it, ty) }, - ast::RecordFieldDef(it) => decl_with_ascription(it), + ast::RecordField(it) => decl_with_ascription(it), ast::ConstDef(it) => decl_with_ascription(it), ast::StaticDef(it) => decl_with_ascription(it), ast::ImplDef(it) => { @@ -249,7 +249,7 @@ fn very_obsolete() {} label: "x", navigation_range: 18..19, node_range: 18..24, - kind: RECORD_FIELD_DEF, + kind: RECORD_FIELD, detail: Some( "i32", ), diff --git a/crates/ra_ide/src/folding_ranges.rs b/crates/ra_ide/src/folding_ranges.rs index 972505450..8dcce9f56 100644 --- a/crates/ra_ide/src/folding_ranges.rs +++ b/crates/ra_ide/src/folding_ranges.rs @@ -85,7 +85,7 @@ fn fold_kind(kind: SyntaxKind) -> Option { COMMENT => Some(FoldKind::Comment), USE => Some(FoldKind::Imports), ARG_LIST | PARAM_LIST => Some(FoldKind::ArgList), - RECORD_FIELD_DEF_LIST + RECORD_FIELD_LIST | RECORD_FIELD_PAT_LIST | RECORD_EXPR_FIELD_LIST | ITEM_LIST diff --git a/crates/ra_ide/src/references.rs b/crates/ra_ide/src/references.rs index 94d03a07f..d61ac271e 100644 --- a/crates/ra_ide/src/references.rs +++ b/crates/ra_ide/src/references.rs @@ -361,7 +361,7 @@ fn main(s: Foo) { ); check_result( refs, - "spam RECORD_FIELD_DEF FileId(1) 17..30 21..25 Other", + "spam RECORD_FIELD FileId(1) 17..30 21..25 Other", &["FileId(1) 67..71 Other Read"], ); } @@ -580,7 +580,7 @@ fn foo() { ); check_result( refs, - "f RECORD_FIELD_DEF FileId(1) 15..21 15..16 Other", + "f RECORD_FIELD FileId(1) 15..21 15..16 Other", &["FileId(1) 55..56 Other Read", "FileId(1) 68..69 Other Write"], ); } diff --git a/crates/ra_ide/src/syntax_highlighting.rs b/crates/ra_ide/src/syntax_highlighting.rs index 8d52fb6e4..a04b9d893 100644 --- a/crates/ra_ide/src/syntax_highlighting.rs +++ b/crates/ra_ide/src/syntax_highlighting.rs @@ -711,7 +711,7 @@ fn highlight_name_by_syntax(name: ast::Name) -> Highlight { TRAIT_DEF => HighlightTag::Trait, TYPE_ALIAS => HighlightTag::TypeAlias, TYPE_PARAM => HighlightTag::TypeParam, - RECORD_FIELD_DEF => HighlightTag::Field, + RECORD_FIELD => HighlightTag::Field, MODULE => HighlightTag::Module, FN => HighlightTag::Function, CONST_DEF => HighlightTag::Constant, -- cgit v1.2.3