Highlight debug functions

杀马特。学长 韩版系。学妹 提交于 2019-12-03 18:16:17

问题


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:


  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?



来源:https://stackoverflow.com/questions/37800409/highlight-debug-functions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!