Rider (2021.3.2) won't search for text in non-standard files?
This is not specific to this version, it has been a problem for a long time I think.
I have many custom script files that are compiled as embedded resources. They are just text files with my own custom extensions.
Find in Files will not search these files even though they are in the solution. Whether or not I use a file mask it finds nothing. Choosing "Include non-solution items" also does not help.
This is annoying because I need to do a search and replace in dozens or hundreds of script files but Rider can't do it.
Please sign in to leave a comment.
Would you mind trying the `Find in Files` feature:
1.1. Switch `Solution Explorer` to `File System`;
1.2. Ensure there is no `no index` text next to the folder with your scripts;
1.3. In case you see `no index` next to the folder with your scripts, right-click on the folder, select `Include`;
Please let me know if it does not work.
The file does not say 'no index'. If I right-click it from File System view, I can choose Exclude, not Include.
The file is nested under another file, but even if I un-nest it I still can't find any text in it.
The search doesn't work even when the scope is set specifically to that file.
It's not a matter of case/whole-word/regex either as those are not set, and even toggling them all on and off doesn't help.
The filter popup at the top right is also set to "Anywhere".
k I've done more testing and here are more details:
- the extension I use is .ri (I don't think it's an issue)
- I associate this extension with my own external program to edit the files (it used to be that I could tell VS + R# to use a specific external program, but instead Rider wants to only use the Windows associated program)
- If I add, say, test.txt or test.abc, search works. If I add test.ri, search does not work.
- I notice that if I right click test.abc, I get the option "Associate with File Type...". This option is not available if I rename the file to test.ri.
- I use <EmbeddedResource Include="**\*.ri" /> to mark ri files as embedded resource. If I add a similar line for .abc files, it does not cause the problem with .abc files.
- If I choose "Associate with File Type..." and then "Open matching files in associated application", then I lose the "Associate with File Type..." option and also search stops working, so I think that is it.
I assume I was able to reproduce a similar behavior. Would you mind trying the following workaround?
I hope this helps!
If not, would you mind sharing the left details I requested before?
This removes the file pattern from "Files opened in associated applications" and then I can no longer use my own editor. It does fix the search issue, so I can at least switch back and forth as needed.
The issue seems to be then that "Files opened in associated applications" are not available for searching for some reason.
So, this is a bug, right? Will it be fixed? "Cannot search text in files that are opened in associated applications".
The files that are associated with a file type `Files opened in associated applications` are considered to be binary from IDE perspective, hence the search does not work with them as per design.
Regrettably, the only solution is to write a plugin, that will add a similar file type that will not be considered by IDE as binary but regrettably, there is no such plugin yet.