@@ -18,7 +18,7 @@ predicate isOverlay() { databaseMetadata("isOverlay", "true") }
18
18
overlay [ local]
19
19
string getRawFile ( @locatable el ) {
20
20
exists ( @location loc , @file file |
21
- hasLocation ( el , loc ) and
21
+ ( hasLocation ( el , loc ) or xmllocations ( el , loc ) ) and
22
22
locations_default ( loc , file , _, _, _, _) and
23
23
files ( file , result )
24
24
)
@@ -73,40 +73,22 @@ private predicate discardReferableLocatable(@locatable el) {
73
73
)
74
74
}
75
75
76
+ /** Gets the raw file for a configLocatable. */
76
77
overlay [ local]
77
- private predicate baseConfigLocatable ( @configLocatable l ) { not isOverlay ( ) and exists ( l ) }
78
-
79
- overlay [ local]
80
- private predicate overlayHasConfigLocatables ( ) {
81
- isOverlay ( ) and
82
- exists ( @configLocatable el )
83
- }
84
-
85
- overlay [ discard_entity]
86
- private predicate discardBaseConfigLocatable ( @configLocatable el ) {
87
- // The properties extractor is currently not incremental, so if
88
- // the overlay contains any config locatables, the overlay should
89
- // contain a full extraction and all config locatables from base
90
- // should be discarded.
91
- baseConfigLocatable ( el ) and overlayHasConfigLocatables ( )
92
- }
93
-
94
- overlay [ local]
95
- private predicate baseXmlLocatable ( @xmllocatable l ) {
96
- not isOverlay ( ) and not files ( l , _) and not xmlNs ( l , _, _, _)
78
+ private string getRawFileForConfig ( @configLocatable el ) {
79
+ exists ( @location loc , @file file |
80
+ configLocations ( el , loc ) and
81
+ locations_default ( loc , file , _, _, _, _) and
82
+ files ( file , result )
83
+ )
97
84
}
98
85
99
86
overlay [ local]
100
- private predicate overlayHasXmlLocatable ( ) {
101
- isOverlay ( ) and
102
- exists ( @xmllocatable l | not files ( l , _) and not xmlNs ( l , _, _, _) )
87
+ private string baseConfigLocatable ( @configLocatable el ) {
88
+ not isOverlay ( ) and result = getRawFileForConfig ( el )
103
89
}
104
90
105
91
overlay [ discard_entity]
106
- private predicate discardBaseXmlLocatable ( @xmllocatable el ) {
107
- // The XML extractor is currently not incremental, so if
108
- // the overlay contains any XML locatables, the overlay should
109
- // contain a full extraction and all XML locatables from base
110
- // should be discarded.
111
- baseXmlLocatable ( el ) and overlayHasXmlLocatable ( )
92
+ private predicate discardBaseConfigLocatable ( @configLocatable el ) {
93
+ overlayChangedFiles ( baseConfigLocatable ( el ) )
112
94
}
0 commit comments