Commit a9fb5d6e authored by Camil Staps's avatar Camil Staps 🐧

Split usage queries on ; instead of , to allow searching for tuples

parent a2cc5b48
Pipeline #17234 passed with stage
in 15 minutes and 38 seconds
Subproject commit adf2ad02144baaaf53ada465a2649adc3542c1aa Subproject commit 38469bb77d54d2271c315673fe83afe084e0e7dd
...@@ -189,7 +189,7 @@ if ($_SERVER['REQUEST_METHOD'] !== 'GET'){ ...@@ -189,7 +189,7 @@ if ($_SERVER['REQUEST_METHOD'] !== 'GET'){
if (substr($name, 0, 6) == 'using ') { if (substr($name, 0, 6) == 'using ') {
$command['using'] = []; $command['using'] = [];
$usingnames = explode(',', substr($name, 6)); $usingnames = explode(';', substr($name, 6));
foreach ($usingnames as $usingname) { foreach ($usingnames as $usingname) {
$command['using'][] = trim($usingname); $command['using'][] = trim($usingname);
} }
......
...@@ -91,7 +91,7 @@ function highlightCallback(span, cls, str) { ...@@ -91,7 +91,7 @@ function highlightCallback(span, cls, str) {
function highlightQuery(query) { function highlightQuery(query) {
var highlighter = highlightClean; var highlighter = highlightClean;
if (query == 'class' || query == 'instance' || query == 'type' || query == 'using') { if (query == 'class' || query == 'instance') {
return '<span class="keyword">' + query + '</span>'; return '<span class="keyword">' + query + '</span>';
} else if (query.match(/^class\s/) || query.match(/^instance\s/)) { } else if (query.match(/^class\s/) || query.match(/^instance\s/)) {
highlighter = highlightClean; highlighter = highlightClean;
...@@ -105,8 +105,8 @@ function highlightQuery(query) { ...@@ -105,8 +105,8 @@ function highlightQuery(query) {
return '<span class="keyword">' + q.substring(0,5) + '</span><span class="whitespace">' + q.substring(5,6) + '</span>' + return '<span class="keyword">' + q.substring(0,5) + '</span><span class="whitespace">' + q.substring(5,6) + '</span>' +
highlightToHTML({ highlightToHTML({
start: [ start: [
[/(,)/, ['punctuation']], [/(;)/, ['punctuation']],
[/([^,]+)/, ['funcname']], [/([^;]+)/, ['funcname']],
] ]
}, q.substring(6)); }, q.substring(6));
}; };
......
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
<td class='description'>Information about the error message "stack overflow"</td> <td class='description'>Information about the error message "stack overflow"</td>
</tr> </tr>
<tr> <tr>
<td class='code'>using Maybe, ==</td> <td class='code'>using Maybe; ==</td>
<td class='description'>Anything that uses <code>Maybe</code> <em>and</em> <code>==</code></td> <td class='description'>Anything that uses <code>Maybe</code> <em>and</em> <code>==</code></td>
</tr> </tr>
<tr> <tr>
......
...@@ -58,7 +58,9 @@ function addRecord(req) { ...@@ -58,7 +58,9 @@ function addRecord(req) {
else if ('typeName' in req) else if ('typeName' in req)
query = 'type ' + req.typeName; query = 'type ' + req.typeName;
else if ('using' in req) else if ('using' in req)
query = 'using ' + req.using.join(', '); query = 'using ' + req.using.join('; ');
else if ('exactName' in req)
query = 'exact ' + req.exactName;
searches.splice(0, 0, [query, time]); searches.splice(0, 0, [query, time]);
if (searches.length > 10) if (searches.length > 10)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment