5

I am working on an old Web Forms application with a lot of <%= %> bee sting code nuggets. I would like ReSharper to flag these and suggest replacement with the encoded version <%: %> (see here).

I have tried to create a custom pattern via this article, however I am not sure what to use as the placeholder between the opening and closing tags. The only placeholder types that seem available for ASPX pages are tag name, attribute, attribute value, and content placeholder. None of these seem to select (find) the value in the bee sting code nugget.

Since I only really need to find/replace the opening tag, I tried just using <%= as the pattern (eliminating the need for a placeholder), however ReSharper does not let me save it. It requires the closing tag to be in the pattern to save.

How can I configure ReSharper to suggest replacing <%= %> with <%: %>?

Collin Barrett
  • 2,441
  • 5
  • 32
  • 53
  • Is search and replace ( ctrl-shifr-r for whole project ) an option? you will have possibility to review every single change – Konstantin Pribluda Feb 13 '18 at 09:02
  • Yeah, I would want to review and test each change individually. I don't want to dedicate time to doing this globally, I just wanted to address them as I come across them while working on other items nearby. – Collin Barrett Feb 13 '18 at 13:03
  • sell, in this case just ctrl-r when you are visiting some file. I doubt that this use case mandates development of custom refactoring. But as this change seems to be not really destructive, you can as well change it globally without much review – Konstantin Pribluda Feb 13 '18 at 13:44

0 Answers0