From c11b859fc4721ce573d8de4930b31f2ebda29d81 Mon Sep 17 00:00:00 2001 From: Lucas Leblanc <44496264+Dedelweiss@users.noreply.github.com> Date: Tue, 13 Jun 2023 20:19:10 +0200 Subject: [PATCH] Fix: Error Sidebar PR failed test (#17959) The purpose of this Pull request is to correct my PR https://github.com/lampepfl/dotty/pull/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 d83aa49b01d09899f5dd8b77bf0cc0fdfe5e3a51] --- scaladoc/src/dotty/tools/scaladoc/site/SidebarParser.scala | 7 ------- .../test/dotty/tools/scaladoc/site/SidebarParserTest.scala | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/scaladoc/src/dotty/tools/scaladoc/site/SidebarParser.scala b/scaladoc/src/dotty/tools/scaladoc/site/SidebarParser.scala index 1916c32e53dc..7094d2a1f751 100644 --- a/scaladoc/src/dotty/tools/scaladoc/site/SidebarParser.scala +++ b/scaladoc/src/dotty/tools/scaladoc/site/SidebarParser.scala @@ -34,13 +34,6 @@ object Sidebar: private def toSidebar(r: RawInput, content: String | java.io.File)(using CompilerContext): Sidebar = r match case RawInput(title, page, index, subsection, dir, hidden) if page.nonEmpty && index.isEmpty && subsection.isEmpty() => - val sidebarPath = content match - case s: String => Paths.get(s) - case f: java.io.File => f.toPath() - val basePath = sidebarPath.getParent().resolve("_docs") - val pagePath = basePath.resolve(page) - if !Files.exists(pagePath) then - report.error(s"Page $page does not exist.") Sidebar.Page(Option.when(title.nonEmpty)(title), page, hidden) case RawInput(title, page, index, subsection, dir, hidden) if page.isEmpty && (!subsection.isEmpty() || !index.isEmpty()) => Sidebar.Category(Option.when(title.nonEmpty)(title), Option.when(index.nonEmpty)(index), subsection.asScala.map(toSidebar(_, content)).toList, Option.when(dir.nonEmpty)(dir)) diff --git a/scaladoc/test/dotty/tools/scaladoc/site/SidebarParserTest.scala b/scaladoc/test/dotty/tools/scaladoc/site/SidebarParserTest.scala index f30990d07cfa..87cf07faa55f 100644 --- a/scaladoc/test/dotty/tools/scaladoc/site/SidebarParserTest.scala +++ b/scaladoc/test/dotty/tools/scaladoc/site/SidebarParserTest.scala @@ -136,4 +136,4 @@ class SidebarParserTest: } val error = out.toString().trim() - assert(error.contains(msgNoTitle) && error.contains(schemaMessage)) + assert(error.contains(msgNoTitle) && error.contains(schemaMessage)) \ No newline at end of file