Search code examples
c#rider

Is there any way in Rider to search for "this value in a string"


It's occurred to me that I moderately frequently want to find values that are defined as strings in my codebase.

Mostly in contexts where I suspect there's some string-based reference to a Method/Prop that I've renamed (🤢). Or occasionally when I want to find "this kind of SQL expression in hand-built SQL queries".

Obviously there are all sorts of pitfalls that could arise from assuming such a search has found every relevant piece of code ... but it would still be a useful thing to be able to search.

Natually Rider knows whether any given sequence of characters is inside a string or not ... indeed, if I just search for the characters, then in the results window it shows contextual highlighting to indicate if a value is a string ... so ...

Q: Is there a way to restrict a Rider text search to return only results where the string is found in a string literal?


Solution

  • There's filtering in "Find in files" (find all) feature: enter image description here