hhvm / hhast-inspect
Tool for interactively exploring the AST of Hack programs
Installs: 329 772
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 19
Forks: 4
Open Issues: 0
Language:Hack
Type:project
Requires
- hhvm: ^4.78
- facebook/hh-clilib: ^2.5.0rc1
- facebook/xhp-lib: ^4.0
- hhvm/hhast: ^4.78
- hhvm/hhvm-autoload: ^3.0
- hhvm/hsl: ^4.41
This package is auto-updated.
Last update: 2023-09-13 03:34:47 UTC
README
HHAST-Inspect is a tool to generate an interactive view of a Hack program's concrete syntax tree, built using HHAST. It was previously included with HHAST, and is primarily used as a developer tool when working with HHAST, such as when working on linters or migrations (a.k.a. codemods).
Installation
- Clone this repository: git clone https://github.com/hhvm/hhast-inspect
- Install dependencies:
cd hhast-inspect; composer install
Usage
- Run
bin/hhast-inspect /path/to/source/file
; this will produce an HTML file and show the path - Open the output file in a web browser. On most systems, passing
--open
tohhast-inspect
will make it open the file automatically in your default web web browser - Click on Hack source code to select the syntax tre node, and to show information on the node and its' ancestors
- Click on one of the ancestors to highlight the ancestor - the original node remains highlighted in a different color
Example
% bin/hhast-inspect src/InspectorCLI.hack --open
/var/folders/9v/sc1xb84516v_0rv47v0ygm340000gn/T/hhast-inspect-667b4af71f8ce431718c64e2991d49ac.html
License
HHAST-Inspect is MIT-licensed.