Skip to content

Commit 9b2904f

Browse files
committed
Fix snippet compiler path-based option selection
1 parent 6a6dd7b commit 9b2904f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scaladoc/src/dotty/tools/scaladoc/PathBased.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ case class PathBased[T](entries: List[PathBased.Entry[T]], projectRoot: Path):
77
if path.isAbsolute then
88
if path.startsWith(projectRoot) then get(projectRoot.relativize(path))
99
else None
10-
else entries.find(_.path.forall(p => path.startsWith(p))).map(entry =>
10+
else entries.filter(_.path.forall(p => path.startsWith(p))).maxByOption(_.path.map(_.toString.length)).map(entry =>
1111
PathBased.Result(entry.path.fold(path)(_.relativize(path)), entry.elem)
1212
)
1313

0 commit comments

Comments
 (0)