突出显示调试功能 [英] Highlight debug functions
问题描述
我使用PhpStorm已有一段时间了,它的代码检查和语法突出显示很棒!为了进一步扩展此功能,我正在寻找一种提醒自己调试功能"的方法.我经常使用var_dump()
,exit()
或echo '<pre>',print($var),'</pre>'
之类的函数.不幸的是,在部署一些代码时,我也经常忘记这些.
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.
是否可以在PhpStorm中为某些具有检查功能的已定义功能添加自定义突出显示,以便在视觉上通知我某些调试代码仍然存在?或使用插件或其他功能来实现类似目的?
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?
推荐答案
-
安装并使用 Php Inspections(EA Extended)插件
一旦安装-Settings/Preferences | Editor | Inspections
此插件提供的一项检查称为Forgotten debug statements
-在此找到它(提示:有一个搜索字段-使用它)
One of the inspections this plugin provides called Forgotten debug statements
-- find it there (hint: there is a search field -- use it)
此检查将突出显示一些与调试相关的标准功能,您可以添加自己的功能名称.
This inspection will highlight some standard debug related functions + you can add your own function names.
PS
此检查仅适用于PHP函数-找不到echo '<pre>',print($var),'</pre>'
之类的构造.
P.S.
This inspection works with PHP functions only -- it will not find constructions like echo '<pre>',print($var),'</pre>'
.
顺便说一句-为什么不尝试使用Xdebug/Zend Debugger以获得适当的调试体验?
BTW -- why don't you try Xdebug/Zend Debugger for a proper debug experience?
这篇关于突出显示调试功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!