Skip to content

Commit c11b859

Browse files
DedelweissKordyjan
authored andcommitted
Fix: Error Sidebar PR failed test (#17959)
The purpose of this Pull request is to correct my PR #17229 Sorry for this failure. I have tested the following command locally and my tests pass. `sbt ";dist/pack ;scala3-bootstrapped/compile ;scala3-bootstrapped/test"` [test_windows_full] Fixes: #17963 [Cherry-picked d83aa49]
1 parent 70a9175 commit c11b859

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

scaladoc/src/dotty/tools/scaladoc/site/SidebarParser.scala

-7
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,6 @@ object Sidebar:
3434

3535
private def toSidebar(r: RawInput, content: String | java.io.File)(using CompilerContext): Sidebar = r match
3636
case RawInput(title, page, index, subsection, dir, hidden) if page.nonEmpty && index.isEmpty && subsection.isEmpty() =>
37-
val sidebarPath = content match
38-
case s: String => Paths.get(s)
39-
case f: java.io.File => f.toPath()
40-
val basePath = sidebarPath.getParent().resolve("_docs")
41-
val pagePath = basePath.resolve(page)
42-
if !Files.exists(pagePath) then
43-
report.error(s"Page $page does not exist.")
4437
Sidebar.Page(Option.when(title.nonEmpty)(title), page, hidden)
4538
case RawInput(title, page, index, subsection, dir, hidden) if page.isEmpty && (!subsection.isEmpty() || !index.isEmpty()) =>
4639
Sidebar.Category(Option.when(title.nonEmpty)(title), Option.when(index.nonEmpty)(index), subsection.asScala.map(toSidebar(_, content)).toList, Option.when(dir.nonEmpty)(dir))

scaladoc/test/dotty/tools/scaladoc/site/SidebarParserTest.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,4 +136,4 @@ class SidebarParserTest:
136136
}
137137
val error = out.toString().trim()
138138

139-
assert(error.contains(msgNoTitle) && error.contains(schemaMessage))
139+
assert(error.contains(msgNoTitle) && error.contains(schemaMessage))

0 commit comments

Comments
 (0)