mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
C#: Adjust the QL library to use the locations of the unbound declarations.
This commit is contained in:
@@ -265,7 +265,7 @@ class Method extends Callable, Virtualizable, Attributable, @method {
|
|||||||
result = Virtualizable.super.getAnUltimateImplementor()
|
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. */
|
/** Holds if this method is an extension method. */
|
||||||
predicate isExtensionMethod() { this.getParameter(0).hasExtensionMethodModifier() }
|
predicate isExtensionMethod() { this.getParameter(0).hasExtensionMethodModifier() }
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ class Event extends DeclarationWithAccessors, @event {
|
|||||||
result = DeclarationWithAccessors.super.getAnUltimateImplementor()
|
result = DeclarationWithAccessors.super.getAnUltimateImplementor()
|
||||||
}
|
}
|
||||||
|
|
||||||
override Location getALocation() { event_location(this, result) }
|
override Location getALocation() { event_location(this.getUnboundDeclaration(), result) }
|
||||||
|
|
||||||
override string getAPrimaryQlClass() { result = "Event" }
|
override string getAPrimaryQlClass() { result = "Event" }
|
||||||
}
|
}
|
||||||
@@ -99,7 +99,7 @@ class EventAccessor extends Accessor, @event_accessor {
|
|||||||
|
|
||||||
override Event getDeclaration() { event_accessors(this, _, _, result, _) }
|
override Event getDeclaration() { event_accessors(this, _, _, result, _) }
|
||||||
|
|
||||||
override Location getALocation() { event_accessor_location(this, result) }
|
override Location getALocation() { event_accessor_location(this.getUnboundDeclaration(), result) }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -196,7 +196,7 @@ class Property extends DeclarationWithGetSetAccessors, @property {
|
|||||||
|
|
||||||
override PropertyAccess getAnAccess() { result.getTarget() = this }
|
override PropertyAccess getAnAccess() { result.getTarget() = this }
|
||||||
|
|
||||||
override Location getALocation() { property_location(this, result) }
|
override Location getALocation() { property_location(this.getUnboundDeclaration(), result) }
|
||||||
|
|
||||||
override Expr getAnAssignedValue() {
|
override Expr getAnAssignedValue() {
|
||||||
result = DeclarationWithGetSetAccessors.super.getAnAssignedValue()
|
result = DeclarationWithGetSetAccessors.super.getAnAssignedValue()
|
||||||
@@ -328,7 +328,7 @@ class Indexer extends DeclarationWithGetSetAccessors, Parameterizable, @indexer
|
|||||||
result = DeclarationWithGetSetAccessors.super.getAnUltimateImplementor()
|
result = DeclarationWithGetSetAccessors.super.getAnUltimateImplementor()
|
||||||
}
|
}
|
||||||
|
|
||||||
override Location getALocation() { indexer_location(this, result) }
|
override Location getALocation() { indexer_location(this.getUnboundDeclaration(), result) }
|
||||||
|
|
||||||
override string toStringWithTypes() {
|
override string toStringWithTypes() {
|
||||||
result = this.getName() + "[" + this.parameterTypesToString() + "]"
|
result = this.getName() + "[" + this.parameterTypesToString() + "]"
|
||||||
@@ -408,7 +408,7 @@ class Accessor extends Callable, Modifiable, Attributable, Overridable, @callabl
|
|||||||
|
|
||||||
override Accessor getUnboundDeclaration() { accessors(this, _, _, _, result) }
|
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() }
|
override string toString() { result = this.getName() }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user