5f5c958538 | ||
---|---|---|
.. | ||
.vscode | ||
src | ||
test | ||
.gitignore | ||
.vscodeignore | ||
License.txt | ||
README.md | ||
ThirdPartyNotices.txt | ||
package.json | ||
package.php | ||
php-syntax-visualizer-0.0.1.vsix | ||
tsconfig.json |
README.md
PHP Parser Syntax Visualizer Tool
Overview
VSCode Extension that demonstrates some of the basic usage and functionality of the parser.
Writes AST to adjacent *.ast file using JSON representation
Error Diagnostics from AST
Install from VSIX
-
Download the VSIX, and load into VS Code by running
code --install-extension <my-vsix-path>
or by selectingInstall from VSIX...
from the Command Palette (Ctrl+Shift+P
). -
Open a folder with some PHP files
-
Edit the file - you'll see an adjacent
*.ast
file will appear. Additionally, you should see error squigglies if there are any errors in the file. -
The AST will be updated every time you save the file.
Note: You may need to disable any other PHP language service extensions (no need to them off completely - you can disable them on a per-workspace basis)
- Set
"php.validate.enable": false
- Disable other PHP language service extensions like Crane and PHP IntelliSense
Build from Source
- From
syntax-visualizer/server/
, runnpm install && npm run compile
- From
syntax-visualizer/client
, runnpm install && npm run compile
- Open
syntax-visualizer/client
in VS Code, and press F5 to launch the extension in the debugger.- This will open a new instance of VS Code with the extension loaded
When running in this configuration, any changes you make to the parser will be immediately reflected in the extension (which makes it super handy for debugging any failing tests in the parser.)