tolerant-php-parser/syntax-visualizer/client
Ishan Vyas 5f5c958538
fix: Download the VSIX URL
2021-09-16 20:15:23 +05:30
..
.vscode rename playground->syntax-visualizer 2017-01-09 13:49:45 -08:00
src minor fixes 2017-03-05 23:18:08 -08:00
test rename playground->syntax-visualizer 2017-01-09 13:49:45 -08:00
.gitignore rename playground->syntax-visualizer 2017-01-09 13:49:45 -08:00
.vscodeignore rename playground->syntax-visualizer 2017-01-09 13:49:45 -08:00
License.txt rename playground->syntax-visualizer 2017-01-09 13:49:45 -08:00
README.md fix: Download the VSIX URL 2021-09-16 20:15:23 +05:30
ThirdPartyNotices.txt update syntax visualizer extension 2017-01-18 11:20:07 -08:00
package.json #101 Add parser path setting to syntax visualizer 2017-02-12 22:27:33 -05:00
package.php #101 Add parser path setting to syntax visualizer 2017-02-12 22:27:33 -05:00
php-syntax-visualizer-0.0.1.vsix #101 Add parser path setting to syntax visualizer 2017-02-12 22:27:33 -05:00
tsconfig.json rename playground->syntax-visualizer 2017-01-09 13:49:45 -08:00

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

image

Error Diagnostics from AST

image

Install from VSIX

  1. Download the VSIX, and load into VS Code by running code --install-extension <my-vsix-path> or by selecting Install from VSIX... from the Command Palette (Ctrl+Shift+P). image

  2. Open a folder with some PHP files

  3. 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.

  4. 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

  1. From syntax-visualizer/server/, run npm install && npm run compile
  2. From syntax-visualizer/client, run npm install && npm run compile
  3. 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.)