PHP CS Fixer File Watcher导致PHPStorm中的文件缓存冲突 [英] PHP CS Fixer File Watcher causes File Cache Conflict in PHPStorm

查看:353
本文介绍了PHP CS Fixer File Watcher导致PHPStorm中的文件缓存冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用定义为此的文件监视程序

这是我的watchers.xml文件:

<?xml version="1.0" encoding="UTF-8"?>
<TaskOptions>
  <TaskOptions>
    <option name="arguments" value="fix $FileDir$/$FileName$ --verbose " />
    <option name="checkSyntaxErrors" value="false" />
    <option name="description" />
    <option name="exitCodeBehavior" value="ERROR" />
    <option name="fileExtension" value="php" />
    <option name="immediateSync" value="true" />
    <option name="name" value="PHP CS Fixer" />
    <option name="output" value="" />
    <option name="outputFilters">
      <array />
    </option>
    <option name="outputFromStdout" value="false" />
    <option name="program" value="/usr/local/bin/php-cs-fixer" />
    <option name="scopeName" value="Project Files" />
    <option name="trackOnlyRoot" value="false" />
    <option name="workingDir" value="$ProjectFileDir$" />
    <envs />
  </TaskOptions>
</TaskOptions>

执行自动保存时,有时会收到有关内存和磁盘更改之间的冲突的错误消息.

While autosave executes, sometimes I am getting an error message about the conflict between changes in memory and on disk.

我该如何解决这个问题?

How can I solve this issue?

推荐答案

发生这种情况是因为PHP CS Fixer修改了文件,如@LazyOne所说,但是您的值输出刷新路径"为空,因此IDE无法知道这些变化.

It happens because PHP CS Fixer modifies the file, as @LazyOne said, but you have empty value of "Output paths to refresh" so IDE cannot know about these changes.

将要刷新的输出路径"的值设置为$FileName$(与参数相同),以使PhpStorm知道更改(它取决于其他选项"中设置的工作目录"值-如果该值设置为$ FileDir $,则无需在刷新路径中提及它.

Set the value of "Output paths to refresh" to $FileName$ - same as in arguments - to make PhpStorm aware about the changes (it depends on the "Working directory" value which has been set in Other Options - if it is set to $FileDir$ then you don't need to mention it in the paths to refresh).

这篇关于PHP CS Fixer File Watcher导致PHPStorm中的文件缓存冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆