@@ -57,6 +57,7 @@ pub enum FoundDeclaration<'a> {
57
57
Alias ( & ' a mut AliasDeclaration ) ,
58
58
Function ( & ' a mut FunctionSpecification ) ,
59
59
Procedure ( & ' a mut ProcedureSpecification ) ,
60
+ SubprogramInstantiation ( & ' a mut SubprogramInstantiation ) ,
60
61
Package ( & ' a mut PackageDeclaration ) ,
61
62
PackageBody ( & ' a mut PackageBody ) ,
62
63
PackageInstance ( & ' a mut PackageInstantiation ) ,
@@ -1012,6 +1013,9 @@ impl Search for Declaration {
1012
1013
Declaration :: SubprogramDeclaration ( decl) => {
1013
1014
return_if_found ! ( decl. search( ctx, searcher) ) ;
1014
1015
}
1016
+ Declaration :: SubprogramInstantiation ( decl) => {
1017
+ return_if_found ! ( decl. search( ctx, searcher) ) ;
1018
+ }
1015
1019
Declaration :: Attribute ( Attribute :: Declaration ( decl) ) => {
1016
1020
return_if_found ! ( searcher
1017
1021
. search_decl( ctx, FoundDeclaration :: Attribute ( decl) )
@@ -1358,6 +1362,19 @@ impl Search for MapAspect {
1358
1362
}
1359
1363
}
1360
1364
1365
+ impl Search for SubprogramInstantiation {
1366
+ fn search ( & mut self , ctx : & dyn TokenAccess , searcher : & mut impl Searcher ) -> SearchResult {
1367
+ return_if_found ! ( searcher
1368
+ . search_decl( ctx, FoundDeclaration :: SubprogramInstantiation ( self ) )
1369
+ . or_not_found( ) ) ;
1370
+ return_if_found ! ( self . subprogram_name. search( ctx, searcher) ) ;
1371
+ if let Some ( signature) = & mut self . signature {
1372
+ return_if_found ! ( signature. item. search( ctx, searcher) ) ;
1373
+ }
1374
+ self . generic_map . search ( ctx, searcher)
1375
+ }
1376
+ }
1377
+
1361
1378
// Search for reference to declaration/definition at cursor
1362
1379
pub struct ItemAtCursor {
1363
1380
source : Source ,
@@ -1670,6 +1687,7 @@ impl<'a> FoundDeclaration<'a> {
1670
1687
FoundDeclaration :: GenerateBody ( ..) => None ,
1671
1688
FoundDeclaration :: ConcurrentStatement ( ..) => None ,
1672
1689
FoundDeclaration :: SequentialStatement ( ..) => None ,
1690
+ FoundDeclaration :: SubprogramInstantiation ( _) => None ,
1673
1691
}
1674
1692
}
1675
1693
}
@@ -1682,6 +1700,7 @@ impl<'a> HasEntityId for FoundDeclaration<'a> {
1682
1700
FoundDeclaration :: ForGenerateIndex ( _, value) => value. index_name . decl ,
1683
1701
FoundDeclaration :: Function ( value) => value. designator . decl ,
1684
1702
FoundDeclaration :: Procedure ( value) => value. designator . decl ,
1703
+ FoundDeclaration :: SubprogramInstantiation ( value) => value. ident . decl ,
1685
1704
FoundDeclaration :: Object ( value) => value. ident . decl ,
1686
1705
FoundDeclaration :: ElementDeclaration ( elem) => elem. ident . decl ,
1687
1706
FoundDeclaration :: EnumerationLiteral ( _, elem) => elem. decl ,
@@ -1716,6 +1735,7 @@ impl<'a> HasSrcPos for FoundDeclaration<'a> {
1716
1735
FoundDeclaration :: ForIndex ( ident, _) => ident. pos ( ) ,
1717
1736
FoundDeclaration :: ForGenerateIndex ( _, value) => value. index_name . pos ( ) ,
1718
1737
FoundDeclaration :: Function ( value) => & value. designator . tree . pos ,
1738
+ FoundDeclaration :: SubprogramInstantiation ( value) => & value. ident . tree . pos ,
1719
1739
FoundDeclaration :: Procedure ( value) => & value. designator . tree . pos ,
1720
1740
FoundDeclaration :: Object ( value) => value. ident . pos ( ) ,
1721
1741
FoundDeclaration :: ElementDeclaration ( elem) => elem. ident . pos ( ) ,
@@ -1762,6 +1782,9 @@ impl std::fmt::Display for FoundDeclaration<'_> {
1762
1782
FoundDeclaration :: Function ( ref value) => {
1763
1783
write ! ( f, "{value};" )
1764
1784
}
1785
+ FoundDeclaration :: SubprogramInstantiation ( ref value) => {
1786
+ write ! ( f, "{value};" )
1787
+ }
1765
1788
FoundDeclaration :: Procedure ( ref value) => {
1766
1789
write ! ( f, "{value};" )
1767
1790
}
0 commit comments