@@ -442,6 +442,28 @@ module Configs<LocationSig Location, InputSig<Location> Lang> {
442442 * are used directly in a query result.
443443 */
444444 default predicate observeDiffInformedIncrementalMode ( ) { none ( ) }
445+
446+ /**
447+ * Gets a location that will be associated with the given `source` in a
448+ * diff-informed query that uses this configuration (see
449+ * `observeDiffInformedIncrementalMode`). By default, this is the location
450+ * of the source itself, but this predicate should include any locations
451+ * that are reported as the primary-location of the query or as an
452+ * additional location ("$@" interpolation). For a query that doesn't
453+ * report the source at all, this predicate can be `none()`.
454+ */
455+ default Location getASelectedSourceLocation ( Node source ) { result = source .getLocation ( ) }
456+
457+ /**
458+ * Gets a location that will be associated with the given `sink` in a
459+ * diff-informed query that uses this configuration (see
460+ * `observeDiffInformedIncrementalMode`). By default, this is the location
461+ * of the sink itself, but this predicate should include any locations
462+ * that are reported as the primary-location of the query or as an
463+ * additional location ("$@" interpolation). For a query that doesn't
464+ * report the sink at all, this predicate can be `none()`.
465+ */
466+ default Location getASelectedSinkLocation ( Node sink ) { result = sink .getLocation ( ) }
445467 }
446468
447469 /** An input configuration for data flow using flow state. */
@@ -569,6 +591,28 @@ module Configs<LocationSig Location, InputSig<Location> Lang> {
569591 * are used directly in a query result.
570592 */
571593 default predicate observeDiffInformedIncrementalMode ( ) { none ( ) }
594+
595+ /**
596+ * Gets a location that will be associated with the given `source` in a
597+ * diff-informed query that uses this configuration (see
598+ * `observeDiffInformedIncrementalMode`). By default, this is the location
599+ * of the source itself, but this predicate should include any locations
600+ * that are reported as the primary-location of the query or as an
601+ * additional location ("$@" interpolation). For a query that doesn't
602+ * report the source at all, this predicate can be `none()`.
603+ */
604+ default Location getASelectedSourceLocation ( Node source ) { result = source .getLocation ( ) }
605+
606+ /**
607+ * Gets a location that will be associated with the given `sink` in a
608+ * diff-informed query that uses this configuration (see
609+ * `observeDiffInformedIncrementalMode`). By default, this is the location
610+ * of the sink itself, but this predicate should include any locations
611+ * that are reported as the primary-location of the query or as an
612+ * additional location ("$@" interpolation). For a query that doesn't
613+ * report the sink at all, this predicate can be `none()`.
614+ */
615+ default Location getASelectedSinkLocation ( Node sink ) { result = sink .getLocation ( ) }
572616 }
573617}
574618
0 commit comments