Skip to content
This repository has been archived by the owner on Jan 7, 2025. It is now read-only.

Commit

Permalink
include featues without intervals in search results (this was a bug)
Browse files Browse the repository at this point in the history
  • Loading branch information
granawkins committed Apr 18, 2024
1 parent 83662ca commit c81776c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions mentat/code_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,10 +423,14 @@ async def search(
continue
distance = node["distance"]
path, interval = split_intervals_from_path(Path(node["ref"]))
intervals = parse_intervals(interval)
for _interval in intervals:
feature = CodeFeature(cwd / path, _interval)
if not interval:
feature = CodeFeature(cwd / path)
all_features_sorted.append((feature, distance))
else:
intervals = parse_intervals(interval)
for _interval in intervals:
feature = CodeFeature(cwd / path, _interval)
all_features_sorted.append((feature, distance))
if max_results is None:
return all_features_sorted
else:
Expand Down

0 comments on commit c81776c

Please sign in to comment.