-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathtestlocations.ql
More file actions
29 lines (24 loc) · 1.12 KB
/
testlocations.ql
File metadata and controls
29 lines (24 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import csharp
// This is a consistency check that the overlay mechanism for cleaning up locations
// works correctly.
query predicate elementsWithMultipleSourceLocations(Element e, SourceLocation loc) {
e.fromSource() and
not e instanceof Namespace and
strictcount(SourceLocation l0 | l0 = e.getALocation()) > 1 and
loc = e.getALocation()
}
query predicate typeMentionsWithMultipleSourceLocations(TypeMention tm, SourceLocation loc) {
strictcount(SourceLocation l0 | l0 = tm.getLocation()) > 1 and
loc = tm.getLocation()
}
query predicate commentLinesWithMultipleSourceLocations(CommentLine cl, SourceLocation loc) {
strictcount(SourceLocation l0 | l0 = cl.getLocation()) > 1 and
loc = cl.getLocation()
}
query predicate commentBlocksWithMultipleSourceLocations(CommentBlock cb, SourceLocation loc) {
strictcount(SourceLocation l0 | l0 = cb.getLocation()) > 1 and
loc = cb.getLocation()
}
// This is a consistency check that the entities that are removed as a part of
// the changes in the overlay are indeed removed from the database.
query predicate removedEntities(Element e) { e.(Method).getName() = "OldMethod" }