@@ -18,7 +18,7 @@ predicate isOverlay() { databaseMetadata("isOverlay", "true") }
1818overlay [ local]
1919string getRawFile ( @locatable el ) {
2020 exists ( @location loc , @file file |
21- hasLocation ( el , loc ) and
21+ ( hasLocation ( el , loc ) or xmllocations ( el , loc ) ) and
2222 locations_default ( loc , file , _, _, _, _) and
2323 files ( file , result )
2424 )
@@ -73,40 +73,22 @@ private predicate discardReferableLocatable(@locatable el) {
7373 )
7474}
7575
76+ /** Gets the raw file for a configLocatable. */
7677overlay [ 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+ )
9784}
9885
9986overlay [ 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 )
10389}
10490
10591overlay [ 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 ) )
11294}
0 commit comments