mirror of
https://github.com/github/codeql.git
synced 2026-04-26 01:05:15 +02:00
C#: Fix GenericType locations in jump-to-definition
This commit is contained in:
@@ -151,6 +151,25 @@ private class TypeMentionUse extends Use, TypeMention {
|
||||
)
|
||||
}
|
||||
|
||||
override predicate hasLocationInfo(
|
||||
string filepath, int startline, int startcolumn, int endline, int endcolumn
|
||||
) {
|
||||
this.getType() instanceof ConstructedType and
|
||||
Use.super.hasLocationInfo(filepath, startline, startcolumn, endline, _) and
|
||||
endcolumn =
|
||||
startcolumn +
|
||||
this.getType().(ConstructedType).getUnboundGeneric().getNameWithoutBrackets().length() - 1
|
||||
or
|
||||
this.getType() instanceof UnboundGenericType and
|
||||
Use.super.hasLocationInfo(filepath, startline, startcolumn, endline, _) and
|
||||
endcolumn =
|
||||
startcolumn + this.getType().(UnboundGenericType).getNameWithoutBrackets().length() - 1
|
||||
or
|
||||
not this.getType() instanceof ConstructedType and
|
||||
not this.getType() instanceof UnboundGenericType and
|
||||
Use.super.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
|
||||
}
|
||||
|
||||
override Type getDefinition() { result = this.getType().getSourceDeclaration() }
|
||||
|
||||
override string getUseType() {
|
||||
|
||||
@@ -53,10 +53,10 @@
|
||||
| definitions.cs:114:28:114:28 | T | definitions.cs:114:17:114:17 | T | T |
|
||||
| definitions.cs:114:32:114:32 | A | definitions.cs:97:11:97:11 | A | T |
|
||||
| definitions.cs:117:27:117:27 | T | definitions.cs:117:18:117:18 | T | T |
|
||||
| definitions.cs:119:20:119:29 | I2<Object> | definitions.cs:117:15:117:19 | I2<> | T |
|
||||
| definitions.cs:119:20:119:21 | I2<Object> | definitions.cs:117:15:117:19 | I2<> | T |
|
||||
| definitions.cs:121:18:121:18 | A | definitions.cs:97:11:97:11 | A | T |
|
||||
| definitions.cs:121:21:121:22 | I1 | definitions.cs:112:15:112:16 | I1 | T |
|
||||
| definitions.cs:121:25:121:29 | I2<A> | definitions.cs:117:15:117:19 | I2<> | T |
|
||||
| definitions.cs:121:25:121:26 | I2<A> | definitions.cs:117:15:117:19 | I2<> | T |
|
||||
| definitions.cs:121:28:121:28 | A | definitions.cs:97:11:97:11 | A | T |
|
||||
| definitions.cs:121:37:121:37 | T | definitions.cs:121:13:121:13 | T | T |
|
||||
| definitions.cs:121:41:121:41 | A | definitions.cs:97:11:97:11 | A | T |
|
||||
@@ -66,12 +66,12 @@
|
||||
| definitions.cs:130:24:130:25 | I3 | definitions.cs:119:15:119:16 | I3 | T |
|
||||
| definitions.cs:130:33:130:34 | T2 | definitions.cs:130:18:130:19 | T2 | T |
|
||||
| definitions.cs:132:10:132:11 | I1 | definitions.cs:112:15:112:16 | I1 | T |
|
||||
| definitions.cs:132:14:132:17 | B<A> | definitions.cs:121:11:121:14 | B<> | T |
|
||||
| definitions.cs:132:14:132:14 | B<A> | definitions.cs:121:11:121:14 | B<> | T |
|
||||
| definitions.cs:132:16:132:16 | A | definitions.cs:97:11:97:11 | A | T |
|
||||
| definitions.cs:134:9:134:12 | B<A> | definitions.cs:121:11:121:14 | B<> | T |
|
||||
| definitions.cs:134:9:134:9 | B<A> | definitions.cs:121:11:121:14 | B<> | T |
|
||||
| definitions.cs:134:11:134:11 | A | definitions.cs:97:11:97:11 | A | T |
|
||||
| definitions.cs:134:19:134:19 | A | definitions.cs:97:11:97:11 | A | T |
|
||||
| definitions.cs:134:47:134:50 | B<A> | definitions.cs:121:11:121:14 | B<> | T |
|
||||
| definitions.cs:134:47:134:47 | B<A> | definitions.cs:121:11:121:14 | B<> | T |
|
||||
| definitions.cs:134:49:134:49 | A | definitions.cs:97:11:97:11 | A | T |
|
||||
| definitions.cs:140:9:140:9 | E | definitions.cs:139:14:139:14 | E | T |
|
||||
| definitions.cs:140:52:140:52 | E | definitions.cs:139:14:139:14 | E | T |
|
||||
@@ -94,15 +94,15 @@
|
||||
| definitions.cs:156:22:156:33 | EventHandler | definitions.cs:99:30:99:41 | EventHandler | T |
|
||||
| definitions.cs:156:55:156:56 | S1 | definitions.cs:78:12:78:13 | S1 | T |
|
||||
| definitions.cs:156:62:156:63 | S1 | definitions.cs:78:12:78:13 | S1 | M |
|
||||
| definitions.cs:160:27:160:35 | Nested<> | definitions.cs:158:22:158:30 | Nested<> | T |
|
||||
| definitions.cs:160:27:160:32 | Nested<> | definitions.cs:158:22:158:30 | Nested<> | T |
|
||||
| definitions.cs:160:34:160:34 | T | definitions.cs:158:29:158:29 | T | T |
|
||||
| definitions.cs:160:59:160:67 | Nested<> | definitions.cs:158:22:158:30 | Nested<> | M |
|
||||
| definitions.cs:160:59:160:64 | Nested<> | definitions.cs:158:22:158:30 | Nested<> | M |
|
||||
| definitions.cs:160:66:160:66 | T | definitions.cs:158:29:158:29 | T | T |
|
||||
| definitions.cs:166:12:166:13 | C4 | definitions.cs:151:11:151:12 | C4 | T |
|
||||
| definitions.cs:166:15:166:24 | Nested<I4> | definitions.cs:158:22:158:30 | Nested<> | T |
|
||||
| definitions.cs:166:15:166:20 | Nested<I4> | definitions.cs:158:22:158:30 | Nested<> | T |
|
||||
| definitions.cs:166:22:166:23 | I4 | definitions.cs:143:15:143:16 | I4 | T |
|
||||
| definitions.cs:166:30:166:31 | C4 | definitions.cs:151:11:151:12 | C4 | T |
|
||||
| definitions.cs:166:33:166:42 | Nested<I4> | definitions.cs:158:22:158:30 | Nested<> | T |
|
||||
| definitions.cs:166:33:166:38 | Nested<I4> | definitions.cs:158:22:158:30 | Nested<> | T |
|
||||
| definitions.cs:166:40:166:41 | I4 | definitions.cs:143:15:143:16 | I4 | T |
|
||||
| definitions.cs:166:44:166:49 | call to method Create | definitions.cs:160:37:160:42 | Create | M |
|
||||
| definitions.cs:167:9:167:10 | C1 | definitions.cs:18:11:18:12 | C1 | T |
|
||||
@@ -120,7 +120,7 @@
|
||||
| definitions.cs:174:19:174:27 | access to property property1 | definitions.cs:24:20:24:28 | property1 | M |
|
||||
| definitions.cs:175:24:175:25 | access to local variable c5 | definitions.cs:173:17:173:18 | c5 | V |
|
||||
| definitions.cs:175:33:175:34 | C4 | definitions.cs:151:11:151:12 | C4 | T |
|
||||
| definitions.cs:175:36:175:45 | Nested<I4> | definitions.cs:158:22:158:30 | Nested<> | T |
|
||||
| definitions.cs:175:36:175:41 | Nested<I4> | definitions.cs:158:22:158:30 | Nested<> | T |
|
||||
| definitions.cs:175:43:175:44 | I4 | definitions.cs:143:15:143:16 | I4 | T |
|
||||
| definitions.cs:181:41:181:42 | C5 | definitions.cs:164:11:164:12 | C5 | T |
|
||||
| definitions.cs:181:45:181:46 | MyAttribute | definitions.cs:194:11:194:21 | MyAttribute | T |
|
||||
|
||||
Reference in New Issue
Block a user