Skip to content

Commit 90d48ec

Browse files
committed
Add cache info to typechecking output display.
1 parent 430aab8 commit 90d48ec

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

demos/SQLFiddle/SQLFiddle.Website/Content/Site.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,13 @@
110110

111111
#navbar a:hover {
112112
font-weight: bold;
113+
}
114+
115+
.cacheinfo {
116+
margin-left: 10px;
117+
}
118+
119+
.cacheinfo.invalidation {
120+
font-weight: bold;
121+
margin-left: 20px;
113122
}

demos/SQLFiddle/SQLFiddle.Website/Views/Home/Index.cshtml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,18 @@
109109
}
110110
}
111111
112+
$div.append('<h4>Cacheable: ' + (info.idempotent ? 'yes' : 'no') + '</h4>');
113+
(function () {
114+
var reads = info.readTables;
115+
var writes = info.writeTables;
116+
if (reads.length > 0) {
117+
$div.append('<span class="cacheinfo">Depends on: ' + reads.join(', ') + '.</span>');
118+
}
119+
if (writes.length > 0) {
120+
$div.append('<span class="cacheinfo invalidation">Invalidates: ' + writes.join(', ') + '.</span>');
121+
}
122+
})();
123+
112124
$output.html($div);
113125
};
114126

0 commit comments

Comments
 (0)