Skip to content

Commit d6fb6bf

Browse files
committed
Swift: customize UnspecifiedElement
1 parent e17bc6c commit d6fb6bf

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed
Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
1-
// generated by codegen/codegen.py, remove this comment if you wish to edit this file
21
private import codeql.swift.generated.UnspecifiedElement
2+
import codeql.swift.elements.Location
33

4-
class UnspecifiedElement extends Generated::UnspecifiedElement { }
4+
class UnspecifiedElement extends Generated::UnspecifiedElement {
5+
override string toString() {
6+
exists(string source, string index |
7+
(
8+
source = " from " + this.getParent().getPrimaryQlClasses()
9+
or
10+
not this.hasParent() and source = ""
11+
) and
12+
(
13+
index = "[" + this.getIndex() + "]"
14+
or
15+
not this.hasIndex() and index = ""
16+
) and
17+
result = "missing " + this.getProperty() + index + source
18+
)
19+
}
20+
21+
override Location getImmediateLocation() { result = this.getParent().(Locatable).getLocation() }
22+
}

0 commit comments

Comments
 (0)