IntelliJ IDEA 全局关键字搜索 File mask 选项为空且筛选不生效的解决方案

现象描述

全局关键字搜索(Ctrl + shift+ F)或替换(Ctrl + shift+ R)时,File mask下拉选项没有值。需要手动输入

解决方案:

第一步:进入 C:\Users\Administrator\AppData\Roaming\JetBrains\IntelliJIdea2021.1\options

修改前文件内容如下:

<application>
  <component name="FindSettings">
    <option name="caseSensitive" value="true" />
    <option name="customScope" value="All Places" />
    <option name="defaultScopeName" value="All Places" />
    <option name="localWholeWordsOnly" value="true" />
    <option name="showResultsInSeparateView" value="true" />
    <option name="wholeWordsOnly" value="true" />
    <option name="CASE_SENSITIVE_SEARCH" value="true" />
    <option name="WHOLE_WORDS_ONLY" value="true" />
    <option name="LOCAL_WHOLE_WORDS_ONLY" value="true" />
    <option name="SHOW_RESULTS_IN_SEPARATE_VIEW" value="true" />
    <option name="SEARCH_SCOPE" value="All Places" />
    <option name="FILE_MASK" value="*.java" />
    <mask>*.java</mask>
  </component>
</application>

修改后文件内容如下:

<application>
  <component name="FindSettings">
    <option name="caseSensitive" value="true" />
    <option name="customScope" value="All Places" />
    <option name="defaultScopeName" value="All Places" />
    <option name="localWholeWordsOnly" value="true" />
    <option name="showResultsInSeparateView" value="true" />
    <option name="wholeWordsOnly" value="true" />
    <option name="CASE_SENSITIVE_SEARCH" value="true" />
    <option name="WHOLE_WORDS_ONLY" value="true" />
    <option name="LOCAL_WHOLE_WORDS_ONLY" value="true" />
    <option name="SHOW_RESULTS_IN_SEPARATE_VIEW" value="true" />
    <option name="SEARCH_SCOPE" value="All Places" />
    <option name="FILE_MASK" value="*.java" />
	  <mask>*.java</mask>
    <mask>*.html</mask>
    <mask>*.css</mask>
    <mask>*.scss</mask>
    <mask>*.less</mask>
    <mask>*.css</mask>
    <mask>*.js</mask>
    <mask>*.ts</mask>
    <mask>*.xml</mask>
    <mask>*.yml</mask>
    <mask>*.jsp</mask>
    <mask>*.properties</mask>
  </component>
</application>

 

修改后重启idea生效