commit 035644f92d372ccc06112808afb48b750b9dd3dd
parent cdb5faa593f7a11ff9ed961c0a3456609ce8793f
Author: Lou Woell <lou.woell@posteo.de>
Date: Tue, 17 Feb 2026 12:07:42 +0100
[find-refs] also list occurences of members when searching enum
Diffstat:
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/cmd/harehelper/+test/find_references.ha b/cmd/harehelper/+test/find_references.ha
@@ -137,3 +137,14 @@ fn test_scan_tree (id: str, in: str = "") void = {
test_scan_tree("os::amode::F_OK", this_file);
};
+
+@test fn scan_tree_stdlib_member_enum_member () void = {
+
+ test_scan_tree("os::amode::F_OK", this_file);
+};
+
+@test fn scan_tree_stdlib_enum_from_member () void = {
+
+ let _ = os::arch::AARCH64;
+ test_scan_tree("os::arch", this_file);
+};
diff --git a/cmd/harehelper/find_refs.ha b/cmd/harehelper/find_refs.ha
@@ -229,7 +229,7 @@ const sc = bufio::newscanner(input);
let res: []xref = [];
for (let ref => next_ref(&lexer)?) {
for (let i .. names) {
- if (ast::ident_eq(i, ref.name)) {
+ if (ident_in(i, ref.name)) {
ref.context = match (get_line(lexer.in.src, &ref)) {
case let e: error =>
yield strerror(e);