aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-07-30 15:49:39 +0100
committerGitHub <[email protected]>2020-07-30 15:49:39 +0100
commita257fd06b36d2e7310e5e38823f6636343a37331 (patch)
treee360ad1f518319883677364f49d75d5c508aafcd /crates/ra_ide
parent282702c2877e3f9002308b1b63fc472b5e799c56 (diff)
parent0a9e3ccc262fbcbd4cdaab30384f8cb71584544b (diff)
Merge #5597
5597: Rename FieldDef -> Field r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide')
-rw-r--r--crates/ra_ide/src/diagnostics.rs16
-rw-r--r--crates/ra_ide/src/display/navigation_target.rs4
-rw-r--r--crates/ra_ide/src/display/short_label.rs2
-rw-r--r--crates/ra_ide/src/extend_selection.rs4
-rw-r--r--crates/ra_ide/src/file_structure.rs4
-rw-r--r--crates/ra_ide/src/folding_ranges.rs2
-rw-r--r--crates/ra_ide/src/references.rs4
-rw-r--r--crates/ra_ide/src/syntax_highlighting.rs2
8 files changed, 19 insertions, 19 deletions
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(
155 module = s.module(sema.db); 155 module = s.module(sema.db);
156 let source = s.source(sema.db); 156 let source = s.source(sema.db);
157 def_file_id = source.file_id; 157 def_file_id = source.file_id;
158 let fields = source.value.field_def_list()?; 158 let fields = source.value.field_list()?;
159 record_field_def_list(fields)? 159 record_field_list(fields)?
160 } 160 }
161 VariantDef::Union(u) => { 161 VariantDef::Union(u) => {
162 module = u.module(sema.db); 162 module = u.module(sema.db);
163 let source = u.source(sema.db); 163 let source = u.source(sema.db);
164 def_file_id = source.file_id; 164 def_file_id = source.file_id;
165 source.value.record_field_def_list()? 165 source.value.record_field_list()?
166 } 166 }
167 VariantDef::EnumVariant(e) => { 167 VariantDef::EnumVariant(e) => {
168 module = e.module(sema.db); 168 module = e.module(sema.db);
169 let source = e.source(sema.db); 169 let source = e.source(sema.db);
170 def_file_id = source.file_id; 170 def_file_id = source.file_id;
171 let fields = source.value.field_def_list()?; 171 let fields = source.value.field_list()?;
172 record_field_def_list(fields)? 172 record_field_list(fields)?
173 } 173 }
174 }; 174 };
175 let def_file_id = def_file_id.original_file(sema.db); 175 let def_file_id = def_file_id.original_file(sema.db);
@@ -205,10 +205,10 @@ fn missing_struct_field_fix(
205 let fix = Fix::new("Create field", source_change.into()); 205 let fix = Fix::new("Create field", source_change.into());
206 return Some(fix); 206 return Some(fix);
207 207
208 fn record_field_def_list(field_def_list: ast::FieldDefList) -> Option<ast::RecordFieldDefList> { 208 fn record_field_list(field_def_list: ast::FieldList) -> Option<ast::RecordFieldList> {
209 match field_def_list { 209 match field_def_list {
210 ast::FieldDefList::RecordFieldDefList(it) => Some(it), 210 ast::FieldList::RecordFieldList(it) => Some(it),
211 ast::FieldDefList::TupleFieldDefList(_) => None, 211 ast::FieldList::TupleFieldList(_) => None,
212 } 212 }
213 } 213 }
214} 214}
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
387 ast::TypeAlias(it) => it.doc_comment_text(), 387 ast::TypeAlias(it) => it.doc_comment_text(),
388 ast::ConstDef(it) => it.doc_comment_text(), 388 ast::ConstDef(it) => it.doc_comment_text(),
389 ast::StaticDef(it) => it.doc_comment_text(), 389 ast::StaticDef(it) => it.doc_comment_text(),
390 ast::RecordFieldDef(it) => it.doc_comment_text(), 390 ast::RecordField(it) => it.doc_comment_text(),
391 ast::EnumVariant(it) => it.doc_comment_text(), 391 ast::EnumVariant(it) => it.doc_comment_text(),
392 ast::MacroCall(it) => it.doc_comment_text(), 392 ast::MacroCall(it) => it.doc_comment_text(),
393 _ => None, 393 _ => None,
@@ -412,7 +412,7 @@ pub(crate) fn description_from_symbol(db: &RootDatabase, symbol: &FileSymbol) ->
412 ast::TypeAlias(it) => it.short_label(), 412 ast::TypeAlias(it) => it.short_label(),
413 ast::ConstDef(it) => it.short_label(), 413 ast::ConstDef(it) => it.short_label(),
414 ast::StaticDef(it) => it.short_label(), 414 ast::StaticDef(it) => it.short_label(),
415 ast::RecordFieldDef(it) => it.short_label(), 415 ast::RecordField(it) => it.short_label(),
416 ast::EnumVariant(it) => it.short_label(), 416 ast::EnumVariant(it) => it.short_label(),
417 _ => None, 417 _ => None,
418 } 418 }
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 {
65 } 65 }
66} 66}
67 67
68impl ShortLabel for ast::RecordFieldDef { 68impl ShortLabel for ast::RecordField {
69 fn short_label(&self) -> Option<String> { 69 fn short_label(&self) -> Option<String> {
70 short_label_from_ascribed_node(self, "") 70 short_label_from_ascribed_node(self, "")
71 } 71 }
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(
39 let list_kinds = [ 39 let list_kinds = [
40 RECORD_FIELD_PAT_LIST, 40 RECORD_FIELD_PAT_LIST,
41 MATCH_ARM_LIST, 41 MATCH_ARM_LIST,
42 RECORD_FIELD_DEF_LIST, 42 RECORD_FIELD_LIST,
43 TUPLE_FIELD_DEF_LIST, 43 TUPLE_FIELD_LIST,
44 RECORD_EXPR_FIELD_LIST, 44 RECORD_EXPR_FIELD_LIST,
45 ENUM_VARIANT_LIST, 45 ENUM_VARIANT_LIST,
46 USE_TREE_LIST, 46 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<StructureNode> {
136 let ty = it.type_ref(); 136 let ty = it.type_ref();
137 decl_with_type_ref(it, ty) 137 decl_with_type_ref(it, ty)
138 }, 138 },
139 ast::RecordFieldDef(it) => decl_with_ascription(it), 139 ast::RecordField(it) => decl_with_ascription(it),
140 ast::ConstDef(it) => decl_with_ascription(it), 140 ast::ConstDef(it) => decl_with_ascription(it),
141 ast::StaticDef(it) => decl_with_ascription(it), 141 ast::StaticDef(it) => decl_with_ascription(it),
142 ast::ImplDef(it) => { 142 ast::ImplDef(it) => {
@@ -249,7 +249,7 @@ fn very_obsolete() {}
249 label: "x", 249 label: "x",
250 navigation_range: 18..19, 250 navigation_range: 18..19,
251 node_range: 18..24, 251 node_range: 18..24,
252 kind: RECORD_FIELD_DEF, 252 kind: RECORD_FIELD,
253 detail: Some( 253 detail: Some(
254 "i32", 254 "i32",
255 ), 255 ),
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<FoldKind> {
85 COMMENT => Some(FoldKind::Comment), 85 COMMENT => Some(FoldKind::Comment),
86 USE => Some(FoldKind::Imports), 86 USE => Some(FoldKind::Imports),
87 ARG_LIST | PARAM_LIST => Some(FoldKind::ArgList), 87 ARG_LIST | PARAM_LIST => Some(FoldKind::ArgList),
88 RECORD_FIELD_DEF_LIST 88 RECORD_FIELD_LIST
89 | RECORD_FIELD_PAT_LIST 89 | RECORD_FIELD_PAT_LIST
90 | RECORD_EXPR_FIELD_LIST 90 | RECORD_EXPR_FIELD_LIST
91 | ITEM_LIST 91 | 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) {
361 ); 361 );
362 check_result( 362 check_result(
363 refs, 363 refs,
364 "spam RECORD_FIELD_DEF FileId(1) 17..30 21..25 Other", 364 "spam RECORD_FIELD FileId(1) 17..30 21..25 Other",
365 &["FileId(1) 67..71 Other Read"], 365 &["FileId(1) 67..71 Other Read"],
366 ); 366 );
367 } 367 }
@@ -580,7 +580,7 @@ fn foo() {
580 ); 580 );
581 check_result( 581 check_result(
582 refs, 582 refs,
583 "f RECORD_FIELD_DEF FileId(1) 15..21 15..16 Other", 583 "f RECORD_FIELD FileId(1) 15..21 15..16 Other",
584 &["FileId(1) 55..56 Other Read", "FileId(1) 68..69 Other Write"], 584 &["FileId(1) 55..56 Other Read", "FileId(1) 68..69 Other Write"],
585 ); 585 );
586 } 586 }
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 {
711 TRAIT_DEF => HighlightTag::Trait, 711 TRAIT_DEF => HighlightTag::Trait,
712 TYPE_ALIAS => HighlightTag::TypeAlias, 712 TYPE_ALIAS => HighlightTag::TypeAlias,
713 TYPE_PARAM => HighlightTag::TypeParam, 713 TYPE_PARAM => HighlightTag::TypeParam,
714 RECORD_FIELD_DEF => HighlightTag::Field, 714 RECORD_FIELD => HighlightTag::Field,
715 MODULE => HighlightTag::Module, 715 MODULE => HighlightTag::Module,
716 FN => HighlightTag::Function, 716 FN => HighlightTag::Function,
717 CONST_DEF => HighlightTag::Constant, 717 CONST_DEF => HighlightTag::Constant,