WebStorm incorrectly marking source files as excluded

I have a React project that is a mix of Javascript+Flow and Typescript -- and I am in the process of iteratively refactoring the JS files to TS/TSX.

In my workflow I'm sometimes going to-and-fro between Git branches, and in these branches, I may have renamed a specific JS file (let's call it `fileA.js`) to TS (`fileA.ts`) and in another unrelated branch, it is still called `fileA.js`.

I've noticed that when I convert the JS file to TS, everything is fine, but when I toggle back to the branch that still has it set as JS, for whatever reason, Webstorm has the JS file marked as ignored from indexing and I have no idea how to set it back to be included as part of indexing.

I hope all of that was clear. Can anybody help with this?

 

 

1
5 comments
 

Known issue, related to auto-excluding .js files generated by the built-in compiler from indexing, WEB-30895. As a workaround, try removing these .js files from "exactExcludedFiles" list in .idea/workspace.xml, <component name="TypeScriptGeneratedFilesManager"> section, like:

<component name="TypeScriptGeneratedFilesManager">
    <option name="version" value="1" />
    <option name="exactExcludedFiles">
      <list>
        <option value="$PROJECT_DIR$/path/to/fileA.js" />
        ...
      </list>
    </option>
  </component>
1

if you'd like to avoid auto-excluding these files, you can add

<option name="excludeGeneratedFiles" value="false" />

to config:

<component name="TypeScriptGeneratedFilesManager">
   <option name="version" value="1" />
   <option name="excludeGeneratedFiles" value="false" />
   <option name="exactExcludedFiles">
     <list>
     </list>
   </option>
 </component>
0

Elena Pogorelova thank you for posting this workaround. It's very helpful!

Do you know when this bug will actually be addressed? Had a very difficult time trying to debug this and work through it because there was no questions/answers around it on the web until I made this post.

0

There is no ETA for it; you can contact the responsible developer directly by adding a comment to youtrack ticket

0

Thank you, took me forever to find this thread. PHPStorm does this as well. And for no real reason.

I freshly cloned the project from a git repo and it just decided to mark most of my source files as excluded, most, not all.

0

Please sign in to leave a comment.