Highlight debug functions

2019-03-01 00:06发布

I use PhpStorm for a while now, and it's code inspection and syntax highlighting is great! To further extend this feature, I am looking for a way to alert myself of 'debug functions'. I frequently use functions like var_dump(), exit() or echo '<pre>',print($var),'</pre>'. Unfortunately, I also frequently forget these when deploying some code.

Is it possible to add custom highlighting in PhpStorm for some defined functions with the Inspection-feature, so I am visually notified that some debugging-code is still present? Or a plugin or other feature to accomplish something like that?

1条回答
倾城 Initia
2楼-- · 2019-03-01 00:51
  1. Install and use Php Inspections (EA Extended) plugin

  2. Once installed -- Settings/Preferences | Editor | Inspections

  3. One of the inspections this plugin provides called Forgotten debug statements -- find it there (hint: there is a search field -- use it)

  4. This inspection will highlight some standard debug related functions + you can add your own function names.

P.S. This inspection works with PHP functions only -- it will not find constructions like echo '<pre>',print($var),'</pre>'.

BTW -- why don't you try Xdebug/Zend Debugger for a proper debug experience?

查看更多
登录 后发表回答