Php 突出显示vscode中未使用的变量

Php 突出显示vscode中未使用的变量,php,visual-studio-code,Php,Visual Studio Code,有没有办法突出显示vscode中未使用的php变量 <?php $foo = 'a'; $bar = 'b'; // I want the IDE mark this somehow $foo = 'c'; ?> 我在配置文件中有“editor.showUnused”:true。此外,我还尝试了一些intellisense扩展,但没有效果。至少有两种可能性: 使用PHP混乱检测器(phpmd),VsCode有一个扩展名:ecodes.VsCode phpmd。 它将输出有关

有没有办法突出显示vscode中未使用的php变量

<?php
$foo = 'a';
$bar = 'b'; // I want the IDE mark this somehow

$foo = 'c';
?>


我在配置文件中有
“editor.showUnused”:true
。此外,我还尝试了一些
intellisense
扩展,但没有效果。

至少有两种可能性:

  • 使用PHP混乱检测器(phpmd),VsCode有一个扩展名:ecodes.VsCode phpmd。
    它将输出有关未使用变量的警告,在滚动条中添加指示器,并在蓝色的行/变量下划线。您可以删除配置中的所有规则并仅保留
    unusedcode

  • 使用Intelephense扩展:bmewburn.vscode Intelephense客户端。
    它将以灰色显示


对于PHP,Visual Studio代码恐怕不是最先进的工具。