33using  System . Linq ; 
44using  Antlr4 . Runtime ; 
55using  Microsoft . Vbe . Interop ; 
6+ using  Rubberduck . Parsing . Symbols ; 
67using  Rubberduck . Parsing . VBA ; 
78using  Rubberduck . VBEditor ; 
89using  Rubberduck . VBEditor . Extensions ; 
@@ -21,7 +22,7 @@ public ImplicitActiveSheetReferenceInspection(VBE vbe, RubberduckParserState sta
2122        } 
2223
2324        public  override  string  Meta  {  get  {  return  InspectionsUI . ImplicitActiveSheetReferenceInspectionMeta ;  }  } 
24-         public  override  string  Description  {  get  {  return  InspectionsUI . ImplicitActiveSheetReferenceInspectionName ;  }  } 
25+         public  override  string  Description  {  get  {  return  InspectionsUI . ImplicitActiveSheetReferenceInspectionResultFormat ;  }  } 
2526        public  override  CodeInspectionType  InspectionType  {  get  {  return  CodeInspectionType . MaintainabilityAndReadabilityIssues ;  }  } 
2627
2728        private  static readonly  string [ ]  Targets  =  
@@ -45,30 +46,30 @@ public override IEnumerable<InspectionResultBase> GetInspectionResults()
4546                . SelectMany ( declaration =>  declaration . References ) ; 
4647
4748            return  issues . Select ( issue =>  
48-                 new  ImplicitActiveSheetReferenceInspectionResult ( this ,  string . Format ( Description ,   issue . Declaration . IdentifierName ) ,   issue . Context ,   issue . QualifiedModuleName ) ) ; 
49+                 new  ImplicitActiveSheetReferenceInspectionResult ( this ,  issue ) ) ; 
4950        } 
5051    } 
5152
5253    public  class  ImplicitActiveSheetReferenceInspectionResult  :  InspectionResultBase 
5354    { 
54-         private  readonly  string   _result ; 
55+         private  readonly  IdentifierReference   _reference ; 
5556        private  readonly  IEnumerable < CodeInspectionQuickFix >  _quickFixes ; 
5657
57-         public  ImplicitActiveSheetReferenceInspectionResult ( IInspection  inspection ,  string   result ,   ParserRuleContext   context ,   QualifiedModuleName   qualifiedName ) 
58-             :  base ( inspection ,  qualifiedName ,   context ) 
58+         public  ImplicitActiveSheetReferenceInspectionResult ( IInspection  inspection ,  IdentifierReference   reference ) 
59+             :  base ( inspection ,  reference . QualifiedModuleName ,   reference . Context ) 
5960        { 
60-             _result  =  result ; 
61+             _reference  =  reference ; 
6162            _quickFixes  =  new  CodeInspectionQuickFix [ ] 
6263            { 
63-                 new  IgnoreOnceQuickFix ( context ,  QualifiedSelection ,  Inspection . AnnotationName ) ,  
64+                 new  IgnoreOnceQuickFix ( reference . Context ,  QualifiedSelection ,  Inspection . AnnotationName ) ,  
6465            } ; 
6566        } 
6667
6768        public  override  IEnumerable < CodeInspectionQuickFix >  QuickFixes  {  get  {  return  _quickFixes ;  }  } 
6869
6970        public  override  string  Description 
7071        { 
71-             get  {  return  _result ;  } 
72+             get  {  return  string . Format ( Inspection . Description ,   _reference . Declaration . IdentifierName ) ;  } 
7273        } 
7374    } 
7475} 
0 commit comments