From 15550b5582249a54814fedc80237eb4f4b86cec2 Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Wed, 23 Dec 2015 08:39:23 +1100 Subject: [PATCH] Show node IDs in XHPAST tree view Summary: Currently we do not show node IDs in this view, but do show token IDs in the stream view. Given that this view facilitates testing various XHPAST functionality, it would be useful to add this information. Test Plan: Saw node IDs in XHPAST. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D14697 --- .../phpast/controller/PhabricatorXHPASTViewStreamController.php | 2 +- .../phpast/controller/PhabricatorXHPASTViewTreeController.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/applications/phpast/controller/PhabricatorXHPASTViewStreamController.php b/src/applications/phpast/controller/PhabricatorXHPASTViewStreamController.php index f5cedf225a..3846b9cf41 100644 --- a/src/applications/phpast/controller/PhabricatorXHPASTViewStreamController.php +++ b/src/applications/phpast/controller/PhabricatorXHPASTViewStreamController.php @@ -22,7 +22,7 @@ final class PhabricatorXHPASTViewStreamController foreach ($tree->getRawTokenStream() as $id => $token) { $seq = $id; $name = $token->getTypeName(); - $title = pht('Token %s: %s', $seq, $name); + $title = pht('Token %d: %s', $seq, $name); $tokens[] = phutil_tag( 'span', diff --git a/src/applications/phpast/controller/PhabricatorXHPASTViewTreeController.php b/src/applications/phpast/controller/PhabricatorXHPASTViewTreeController.php index c15bdc2928..5b94323c9c 100644 --- a/src/applications/phpast/controller/PhabricatorXHPASTViewTreeController.php +++ b/src/applications/phpast/controller/PhabricatorXHPASTViewTreeController.php @@ -29,7 +29,7 @@ final class PhabricatorXHPASTViewTreeController protected function buildTree($root) { try { $name = $root->getTypeName(); - $title = $root->getDescription(); + $title = pht('Node %d: %s', $root->getID(), $name); } catch (Exception $ex) { $name = '???'; $title = '???';