Skip to content

Commit b1eb5f3

Browse files
committed
fix the same QLDoc being QLDoc for multiple things
1 parent 25b3286 commit b1eb5f3

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

ql/ql/src/codeql_ql/ast/Ast.qll

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,21 @@ class TopLevel extends TTopLevel, AstNode {
156156
}
157157

158158
QLDoc getQLDocFor(ModuleMember m) {
159-
exists(int i | result = this.getMember(i) and m = this.getMember(i + 1))
159+
exists(int i | result = this.getMember(i) and m = this.getMember(i + 1)) and
160+
(
161+
m instanceof ClasslessPredicate
162+
or
163+
m instanceof Class
164+
or
165+
m instanceof Module
166+
)
160167
}
161168

162169
override string getAPrimaryQlClass() { result = "TopLevel" }
163170

164171
override QLDoc getQLDoc() {
165172
result = this.getMember(0) and
173+
not getQLDocFor(_) = result and
166174
result.getLocation().getStartLine() = 1 // this might not hold if there is a block comment above, and that's the point.
167175
}
168176
}

0 commit comments

Comments
 (0)