Where should I put 'annotations' folder for a plugin loaded using command line? (R#8.2)

If I load my plugin using /ReSharper.Plugin, where should I put my external annotations folder?
I see it is in vAny\annotations for installed extensions, but where should it be while I am developing it?

2 comments
Comment actions Permalink

Because extensions are a superset of plugins, settings and annotations, the /ReSharper.Plugin command line switch doesn't do anything to load settings or annotation files.

I've played with a couple of ways of doing this. In the end, I needed to support VS2008, which doesn't support the extension manager, so I added components to load settings and annotations if they plugin wasn't installed in the extension manager (strictly speaking, VS2008 doesn't support the nuget provider or the UI for the extension manager. The rest of the extension manager is still there, though). These files will look for .dotSettings files and .xml


They're essentially doing what the main ReSharper code is doing for loading settings and annotations, but looking next to the plugin dll. E.g. settings files should be *.dotSettings files side-by-side with the plugin dll. Annotations files, annotations files will be *any* xml file side-by-side with the plugin dll, or in subfolders.


For a quick and dirty fix, you can use something like this, which is a plugin publishing itself as an extension (whoa, inception!). It will then look in the standard locations relative to the plugin dll, e.g. "ReSharper\v8.2\vs12.0\settings", "ReSharper\vAny\settings", etc. However, it will return *all* files in the relevant location, so it relies on the loaders handling incorrect files gracefully, which the built in extension consumers do - e.g. the annotation loader requires an xml file of the right format, and the settings file must be a valid settings file. ReSharper will silently ignore them if they're not in the right format.

https://xunitcontrib.codeplex.com/SourceControl/latest#resharper/src/xunitcontrib.runner.resharper.provider/Annotations/ExtensionsFromPluginProvider.cs

I wouldn't recommend leaving that in a production build, though.

I'd prefer a better, more built-in solution, but haven't settled on a good design. I'd like to see a /ReSharper.Extension command line switch - but what does it point to? A root folder that's laid out like the contents of an extension package? Any ideas?

0
Comment actions Permalink

Thanks, I see the optons! I have a custom IExternalAnnotationsFileProvider at the moment,  but I'll take a look if any of those would be better.
I think /ReSharper.Extension accepting a folder would be a good thing.

0

Please sign in to leave a comment.