Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSCode plugin VSCode-PHP-Format not working

I start using vscode less than a month. Please forgive me if this is a dump question.

  • OS: OS X 10.11.3
  • VSCode: 0.10.6
  • Plugin: VSCode-PHP-Format (download via git clone)
  • Extension path: ~/.vscode/extensions/VSCode-PHP-Format

I restarted VSCode, open php files, but do not see "Format Code" on the right click menu.

Any idea how to debug this? Right now I don't even know if the plugin load correctly.

like image 348
John Siu Avatar asked Oct 19 '22 16:10

John Siu


1 Answers

With tips from Tobiah Zarlez, I found the "Toggle Developer Tools" in VSCode.

It is shown in the console the plugin cannot find js-beautify.

Solution

Inside ~/.vscode/extensions/VSCode-PHP-Format, run

npm install

It will pull in js-beautify. Then restart VSCode.

like image 105
John Siu Avatar answered Oct 21 '22 11:10

John Siu