diff options
Diffstat (limited to 'crates/ra_hir/src/code_model.rs')
-rw-r--r-- | crates/ra_hir/src/code_model.rs | 51 |
1 files changed, 1 insertions, 50 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 1a33127fa..282bd15de 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs | |||
@@ -355,10 +355,6 @@ impl StructField { | |||
355 | self.parent.variant_data(db).fields().unwrap()[self.id].name.clone() | 355 | self.parent.variant_data(db).fields().unwrap()[self.id].name.clone() |
356 | } | 356 | } |
357 | 357 | ||
358 | pub fn source(&self, db: &(impl DefDatabase + AstDatabase)) -> Source<FieldSource> { | ||
359 | self.source_impl(db).into() | ||
360 | } | ||
361 | |||
362 | pub fn ty(&self, db: &impl HirDatabase) -> Ty { | 358 | pub fn ty(&self, db: &impl HirDatabase) -> Ty { |
363 | db.type_for_field(*self) | 359 | db.type_for_field(*self) |
364 | } | 360 | } |
@@ -381,10 +377,6 @@ impl HasSource for Struct { | |||
381 | } | 377 | } |
382 | 378 | ||
383 | impl Struct { | 379 | impl Struct { |
384 | pub fn source(self, db: &(impl DefDatabase + AstDatabase)) -> Source<TreeArc<ast::StructDef>> { | ||
385 | self.id.source(db).into() | ||
386 | } | ||
387 | |||
388 | pub fn module(self, db: &impl HirDatabase) -> Module { | 380 | pub fn module(self, db: &impl HirDatabase) -> Module { |
389 | self.id.module(db) | 381 | self.id.module(db) |
390 | } | 382 | } |
@@ -446,10 +438,6 @@ impl HasSource for Union { | |||
446 | } | 438 | } |
447 | 439 | ||
448 | impl Union { | 440 | impl Union { |
449 | pub fn source(self, db: &(impl DefDatabase + AstDatabase)) -> Source<TreeArc<ast::StructDef>> { | ||
450 | self.id.source(db).into() | ||
451 | } | ||
452 | |||
453 | pub fn name(self, db: &impl DefDatabase) -> Option<Name> { | 441 | pub fn name(self, db: &impl DefDatabase) -> Option<Name> { |
454 | db.struct_data(Struct { id: self.id }).name.clone() | 442 | db.struct_data(Struct { id: self.id }).name.clone() |
455 | } | 443 | } |
@@ -483,10 +471,6 @@ impl HasSource for Enum { | |||
483 | } | 471 | } |
484 | 472 | ||
485 | impl Enum { | 473 | impl Enum { |
486 | pub fn source(self, db: &(impl DefDatabase + AstDatabase)) -> Source<TreeArc<ast::EnumDef>> { | ||
487 | self.id.source(db).into() | ||
488 | } | ||
489 | |||
490 | pub fn module(self, db: &impl HirDatabase) -> Module { | 474 | pub fn module(self, db: &impl HirDatabase) -> Module { |
491 | self.id.module(db) | 475 | self.id.module(db) |
492 | } | 476 | } |
@@ -537,12 +521,6 @@ impl HasSource for EnumVariant { | |||
537 | } | 521 | } |
538 | 522 | ||
539 | impl EnumVariant { | 523 | impl EnumVariant { |
540 | pub fn source( | ||
541 | &self, | ||
542 | db: &(impl DefDatabase + AstDatabase), | ||
543 | ) -> Source<TreeArc<ast::EnumVariant>> { | ||
544 | self.source_impl(db) | ||
545 | } | ||
546 | pub fn module(&self, db: &impl HirDatabase) -> Module { | 524 | pub fn module(&self, db: &impl HirDatabase) -> Module { |
547 | self.parent.module(db) | 525 | self.parent.module(db) |
548 | } | 526 | } |
@@ -692,10 +670,6 @@ impl FnSignature { | |||
692 | } | 670 | } |
693 | 671 | ||
694 | impl Function { | 672 | impl Function { |
695 | pub fn source(self, db: &(impl DefDatabase + AstDatabase)) -> Source<TreeArc<ast::FnDef>> { | ||
696 | self.id.source(db).into() | ||
697 | } | ||
698 | |||
699 | pub fn module(self, db: &impl DefDatabase) -> Module { | 673 | pub fn module(self, db: &impl DefDatabase) -> Module { |
700 | self.id.module(db) | 674 | self.id.module(db) |
701 | } | 675 | } |
@@ -778,10 +752,6 @@ impl HasSource for Const { | |||
778 | } | 752 | } |
779 | 753 | ||
780 | impl Const { | 754 | impl Const { |
781 | pub fn source(self, db: &(impl DefDatabase + AstDatabase)) -> Source<TreeArc<ast::ConstDef>> { | ||
782 | self.id.source(db).into() | ||
783 | } | ||
784 | |||
785 | pub fn module(self, db: &impl DefDatabase) -> Module { | 755 | pub fn module(self, db: &impl DefDatabase) -> Module { |
786 | self.id.module(db) | 756 | self.id.module(db) |
787 | } | 757 | } |
@@ -866,10 +836,6 @@ impl HasSource for Static { | |||
866 | } | 836 | } |
867 | 837 | ||
868 | impl Static { | 838 | impl Static { |
869 | pub fn source(self, db: &(impl DefDatabase + AstDatabase)) -> Source<TreeArc<ast::StaticDef>> { | ||
870 | self.id.source(db).into() | ||
871 | } | ||
872 | |||
873 | pub fn module(self, db: &impl DefDatabase) -> Module { | 839 | pub fn module(self, db: &impl DefDatabase) -> Module { |
874 | self.id.module(db) | 840 | self.id.module(db) |
875 | } | 841 | } |
@@ -902,10 +868,6 @@ impl HasSource for Trait { | |||
902 | } | 868 | } |
903 | 869 | ||
904 | impl Trait { | 870 | impl Trait { |
905 | pub fn source(self, db: &(impl DefDatabase + AstDatabase)) -> Source<TreeArc<ast::TraitDef>> { | ||
906 | self.id.source(db).into() | ||
907 | } | ||
908 | |||
909 | pub fn module(self, db: &impl DefDatabase) -> Module { | 871 | pub fn module(self, db: &impl DefDatabase) -> Module { |
910 | self.id.module(db) | 872 | self.id.module(db) |
911 | } | 873 | } |
@@ -952,13 +914,6 @@ impl HasSource for TypeAlias { | |||
952 | } | 914 | } |
953 | 915 | ||
954 | impl TypeAlias { | 916 | impl TypeAlias { |
955 | pub fn source( | ||
956 | self, | ||
957 | db: &(impl DefDatabase + AstDatabase), | ||
958 | ) -> Source<TreeArc<ast::TypeAliasDef>> { | ||
959 | self.id.source(db).into() | ||
960 | } | ||
961 | |||
962 | pub fn module(self, db: &impl DefDatabase) -> Module { | 917 | pub fn module(self, db: &impl DefDatabase) -> Module { |
963 | self.id.module(db) | 918 | self.id.module(db) |
964 | } | 919 | } |
@@ -1015,11 +970,7 @@ impl HasSource for MacroDef { | |||
1015 | } | 970 | } |
1016 | } | 971 | } |
1017 | 972 | ||
1018 | impl MacroDef { | 973 | impl MacroDef {} |
1019 | pub fn source(&self, db: &(impl DefDatabase + AstDatabase)) -> Source<TreeArc<ast::MacroCall>> { | ||
1020 | (self.id.0.file_id(), self.id.0.to_node(db)).into() | ||
1021 | } | ||
1022 | } | ||
1023 | 974 | ||
1024 | pub enum Container { | 975 | pub enum Container { |
1025 | Trait(Trait), | 976 | Trait(Trait), |