Clean up some more Diviner stuff
Summary: Ref T988. - Render "Implements:" as tags, too. - Minor CSS tweak to tags in property lists. - Add a bunch of group patterns to the Phabricator book. - Fix some stuff with how hashes are computed and cached. - Minor tweak to reuse the Diviner engine for slightly improved performance. Test Plan: Regenerated and looked at documentation. Reviewers: chad Reviewed By: chad CC: aran Maniphest Tasks: T3811, T988 Differential Revision: https://secure.phabricator.com/D6912
This commit is contained in:
@@ -24,6 +24,8 @@ final class DivinerAtomController extends DivinerController {
|
||||
$request = $this->getRequest();
|
||||
$viewer = $request->getUser();
|
||||
|
||||
require_celerity_resource('diviner-shared-css');
|
||||
|
||||
$book = id(new DivinerBookQuery())
|
||||
->setViewer($viewer)
|
||||
->withNames(array($this->bookName))
|
||||
@@ -260,10 +262,7 @@ final class DivinerAtomController extends DivinerController {
|
||||
if ($lineage) {
|
||||
$tags = array();
|
||||
foreach ($lineage as $item) {
|
||||
$tags[] = id(new PhabricatorTagView())
|
||||
->setType(PhabricatorTagView::TYPE_OBJECT)
|
||||
->setName($item->getName())
|
||||
->setHref($item->getURI());
|
||||
$tags[] = $this->renderAtomTag($item);
|
||||
}
|
||||
|
||||
$tags = phutil_implode_html(" \xE2\x96\xB6 ", $tags);
|
||||
@@ -277,9 +276,12 @@ final class DivinerAtomController extends DivinerController {
|
||||
$via = $spec['via'];
|
||||
$iface = $spec['interface'];
|
||||
if ($via == $symbol) {
|
||||
$items[] = $iface->getName();
|
||||
$items[] = $this->renderAtomTag($iface);
|
||||
} else {
|
||||
$items[] = $iface->getName().' (via '.$via->getName().')';
|
||||
$items[] = array(
|
||||
$this->renderAtomTag($iface),
|
||||
" \xE2\x97\x80 ",
|
||||
$this->renderAtomTag($via));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -290,6 +292,13 @@ final class DivinerAtomController extends DivinerController {
|
||||
|
||||
}
|
||||
|
||||
private function renderAtomTag(DivinerLiveSymbol $symbol) {
|
||||
return id(new PhabricatorTagView())
|
||||
->setType(PhabricatorTagView::TYPE_OBJECT)
|
||||
->setName($symbol->getName())
|
||||
->setHref($symbol->getURI());
|
||||
}
|
||||
|
||||
private function getExtendsLineage(DivinerLiveSymbol $symbol) {
|
||||
foreach ($symbol->getExtends() as $extends) {
|
||||
if ($extends->getType() == 'class') {
|
||||
@@ -521,7 +530,7 @@ final class DivinerAtomController extends DivinerController {
|
||||
if ($parameters !== null) {
|
||||
$pout = array();
|
||||
foreach ($parameters as $parameter) {
|
||||
$pout[] = $parameter['name'];
|
||||
$pout[] = idx($parameter, 'name', '...');
|
||||
}
|
||||
$out = array($out, '('.implode(', ', $pout).')');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user