I don’t think the .feature file extension is recognised by ReSharper, so it won’t build a PSI for it and you won’t see it in your cache. You should be able to verify this by checking the PrimaryPsiLanguage of the .feature file’s IPsiSourceFile. I suspect it would be UnknownLanguage.ReSharper maintains a set of mappings between file extensions and project file types (and a mapping from project file type to a language service which provides the psi language type), based on the IFileExtensionMapping interface. There are two default implementations - one gets the list of file extensions from the hardcoded project file types themselves (e.g. the xml project file type supports “.xml” but also “.dbml” and “.discomap”).The second (VSProjectFileExtensionsMapping) will use Visual Studio’s config, such as explicit mappings from extension to editor (Tools -> Options -> Text Editor -> File Extension) and also from Visual Studio’s mappings of file extension to editor. So if VS has a mapping from .feature to the xml editor, ReSharper should treat the file as an xml file. It would appear that there isn’t a mapping here (I don’t have SharePoint installed in my VS) - what editor does VS open .feature files in? It’s also possible to extend the list of known editor guids to file type mappings by implementing the IVsEditorGuidToFileTypeConverter interface.I think your best bet would be to implement IFileExtensionMapping or IVsEditorGuidToFileTypeConverter.What makes me a little nervous is that the .feature file extension is also used by SpecFlow, and those definitely aren’t xml files. It would be nice to be able to only recognise .feature files inside a Sharepoint project, but I’m not sure how to do that. You could *possibly* use IPsiModuleDecorator.OverrideSourceFiles to decorate .feature IPsiSourceFiles in Sharepoint projects to be recognised as xml files, but that’s not really what the API was intended for...
--
You received this message because you are subscribed to the Google Groups "resharper-plugins" group.
To unsubscribe from this group and stop receiving emails from it, send an email to resharper-plug...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
And I've found out that not all .feature files are being iterated. Why?
On Thursday, February 2, 2017 at 5:19:33 PM UTC+3, Matt Ellis wrote: