Other view file extensions

I'm working in a project with mustache views (*.mustache).  The views are in standard MVC locations but ReSharper isn't smart enough to look for that file extension.  It would be nice if it could for two reasons: so they don't show up as nasty red errors and so I could just ctrl+click on the View function and jump to the view!

I poked around in settings a little but I came up empty.  Is there a way to make ReSharper recognize this other file extension?

Thanks,
tim

2 comments
Comment actions Permalink
It looks like you can write a small plugin that simply implements the IMvcViewResolver, and is marked with the MvcViewResolver attribute. You just need to implement IsApplicable, to check if mustache files can be used in this project (perhaps check for the mustache assembly?) and then return a dictionary of location types (area, partial, master, etc) to location format strings (e.g. "~\Views\{1}\{0}.mustache"). You can see a simple example by opening the ReShaprer bin directory in dotPeek and finding the MvcViewSparkResolver class.
0
Comment actions Permalink

Thanks, Matt.  I created one and submitted it:
https://github.com/taschmidt/ReSharper-mustache-plugin

0

Please sign in to leave a comment.