diff --git a/lib/std/special/docs/index.html b/lib/std/special/docs/index.html
index 181b101e0e..83032d87da 100644
--- a/lib/std/special/docs/index.html
+++ b/lib/std/special/docs/index.html
@@ -289,6 +289,17 @@
+
+
+
This function is not tested or referenced.
+
+
+
+ This declaration is not tested or referenced, and it has therefore not been included in
+ semantic analysis, which means the only documentation available is whatever is in the
+ doc comments.
+
+
Errors
@@ -297,10 +308,6 @@
-
-
-
This function is not tested or referenced.
-
Search Results
diff --git a/lib/std/special/docs/main.js b/lib/std/special/docs/main.js
index 7e5a9c4c0e..0ef30f49e4 100644
--- a/lib/std/special/docs/main.js
+++ b/lib/std/special/docs/main.js
@@ -27,6 +27,7 @@
var domFnErrorsAnyError = document.getElementById("fnErrorsAnyError");
var domFnExamples = document.getElementById("fnExamples");
var domFnNoExamples = document.getElementById("fnNoExamples");
+ var domDeclNoRef = document.getElementById("declNoRef");
var domSearch = document.getElementById("search");
var domSectSearchResults = document.getElementById("sectSearchResults");
var domListSearchResults = document.getElementById("listSearchResults");
@@ -112,6 +113,7 @@
domSectFnErrors.classList.add("hidden");
domFnExamples.classList.add("hidden");
domFnNoExamples.classList.add("hidden");
+ domDeclNoRef.classList.add("hidden");
domFnErrorsAnyError.classList.add("hidden");
domTableFnErrors.classList.add("hidden");
domSectGlobalVars.classList.add("hidden");
@@ -160,7 +162,12 @@
renderNav();
var lastDecl = curNav.declObjs[curNav.declObjs.length - 1];
- if (lastDecl.kind === 'var') {
+ if (lastDecl.pubDecls != null) {
+ renderContainer(lastDecl);
+ }
+ if (lastDecl.kind == null) {
+ return renderUnknownDecl(lastDecl);
+ } else if (lastDecl.kind === 'var') {
return renderVar(lastDecl);
} else if (lastDecl.kind === 'const' && lastDecl.type != null) {
var typeObj = zigAnalysis.types[lastDecl.type];
@@ -169,13 +176,21 @@
} else {
return renderValue(lastDecl);
}
- }
- if (lastDecl.kind != null) {
+ } else {
renderType(lastDecl);
}
- if (lastDecl.pubDecls != null) {
- renderContainer(lastDecl);
+ }
+
+ function renderUnknownDecl(decl) {
+ domDeclNoRef.classList.remove("hidden");
+
+ var docs = zigAnalysis.astNodes[decl.src].docs;
+ if (docs != null) {
+ domFnDocs.innerHTML = markdown(docs);
+ } else {
+ domFnDocs.innerHTML = '
There are no doc comments for this declaration.
';
}
+ domFnDocs.classList.remove("hidden");
}
function typeIsErrSet(typeIndex) {