Skip to content

Commit 2c82263

Browse files
committed
Point educational notes at education notes / diagnostic groups markdown on Github
Rather than pointing at a Markdown file in the toolchain directory by default, which won't render well immediately for most users, point at the sources on GitHub, which will render it properly and will still work from (e.g.) CI systems where the toolchain content might not be accessible. Toolchain-aware diagnostic renders can look in the installed toolchain location (share/doc/swift/diagnostics) for the markdown files for that specific version of the markdown files.
1 parent f332937 commit 2c82263

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

lib/Frontend/CompilerInvocation.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2629,13 +2629,8 @@ static void configureDiagnosticEngine(
26292629

26302630
std::string docsPath = Options.DiagnosticDocumentationPath;
26312631
if (docsPath.empty()) {
2632-
// Default to a location relative to the compiler.
2633-
llvm::SmallString<128> docsPathBuffer(mainExecutablePath);
2634-
llvm::sys::path::remove_filename(docsPathBuffer); // Remove /swift
2635-
llvm::sys::path::remove_filename(docsPathBuffer); // Remove /bin
2636-
llvm::sys::path::append(docsPathBuffer, "share", "doc", "swift",
2637-
"diagnostics");
2638-
docsPath = docsPathBuffer.str();
2632+
// Point at the latest Markdown documentation on GitHub.
2633+
docsPath = "https://github.com/swiftlang/swift/tree/main/userdocs/diagnostics";
26392634
}
26402635
Diagnostics.setDiagnosticDocumentationPath(docsPath);
26412636

0 commit comments

Comments
 (0)