C#: Adjust the QL library to use the locations of the unbound declarations.

This commit is contained in:
Michael Nebel
2025-09-30 11:23:58 +02:00
parent b2cbac3250
commit d7a2c7da18
3 changed files with 6 additions and 6 deletions

View File

@@ -265,7 +265,7 @@ class Method extends Callable, Virtualizable, Attributable, @method {
result = Virtualizable.super.getAnUltimateImplementor()
}
override Location getALocation() { method_location(this, result) }
override Location getALocation() { method_location(this.getUnboundDeclaration(), result) }
/** Holds if this method is an extension method. */
predicate isExtensionMethod() { this.getParameter(0).hasExtensionMethodModifier() }

View File

@@ -68,7 +68,7 @@ class Event extends DeclarationWithAccessors, @event {
result = DeclarationWithAccessors.super.getAnUltimateImplementor()
}
override Location getALocation() { event_location(this, result) }
override Location getALocation() { event_location(this.getUnboundDeclaration(), result) }
override string getAPrimaryQlClass() { result = "Event" }
}
@@ -99,7 +99,7 @@ class EventAccessor extends Accessor, @event_accessor {
override Event getDeclaration() { event_accessors(this, _, _, result, _) }
override Location getALocation() { event_accessor_location(this, result) }
override Location getALocation() { event_accessor_location(this.getUnboundDeclaration(), result) }
}
/**

View File

@@ -196,7 +196,7 @@ class Property extends DeclarationWithGetSetAccessors, @property {
override PropertyAccess getAnAccess() { result.getTarget() = this }
override Location getALocation() { property_location(this, result) }
override Location getALocation() { property_location(this.getUnboundDeclaration(), result) }
override Expr getAnAssignedValue() {
result = DeclarationWithGetSetAccessors.super.getAnAssignedValue()
@@ -328,7 +328,7 @@ class Indexer extends DeclarationWithGetSetAccessors, Parameterizable, @indexer
result = DeclarationWithGetSetAccessors.super.getAnUltimateImplementor()
}
override Location getALocation() { indexer_location(this, result) }
override Location getALocation() { indexer_location(this.getUnboundDeclaration(), result) }
override string toStringWithTypes() {
result = this.getName() + "[" + this.parameterTypesToString() + "]"
@@ -408,7 +408,7 @@ class Accessor extends Callable, Modifiable, Attributable, Overridable, @callabl
override Accessor getUnboundDeclaration() { accessors(this, _, _, _, result) }
override Location getALocation() { accessor_location(this, result) }
override Location getALocation() { accessor_location(this.getUnboundDeclaration(), result) }
override string toString() { result = this.getName() }
}