mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
C#: Add discarding for ASP elements.
This commit is contained in:
@@ -139,3 +139,28 @@ private predicate discardXmlEntity(@xmllocatable xml) {
|
||||
// XML files than those included in overlayChangedFiles.
|
||||
overlayXmlExtracted(xml.(DiscardableXmlEntity).getFilePath())
|
||||
}
|
||||
|
||||
overlay[local]
|
||||
private class DiscardableAspEntity extends DiscardableEntityBase instanceof @asp_element {
|
||||
/** Gets the path to the file in which this element occurs. */
|
||||
override string getFilePath() {
|
||||
exists(@location_default loc | result = getLocationFilePath(loc) | asp_elements(this, _, loc))
|
||||
}
|
||||
}
|
||||
|
||||
overlay[local]
|
||||
private predicate overlayAspExtracted(string file) {
|
||||
exists(DiscardableAspEntity dae |
|
||||
dae.existsInOverlay() and
|
||||
file = dae.getFilePath()
|
||||
)
|
||||
}
|
||||
|
||||
overlay[discard_entity]
|
||||
private predicate discardAspEntity(@asp_element asp) {
|
||||
overlayChangedFiles(asp.(DiscardableAspEntity).getFilePath())
|
||||
or
|
||||
// The ASP extractor is not incremental and may extract more
|
||||
// ASP files than those included in overlayChangedFiles.
|
||||
overlayAspExtracted(asp.(DiscardableAspEntity).getFilePath())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user