Frustrated

65 views
Skip to first unread message

Scott Lurowist

unread,
May 30, 2016, 8:30:21 AM5/30/16
to resharper-plugins
I have just spent 3 straight days trying to write a "hello world" plugin.

I cannot follow the documentation:

The little bit of code samples in the documentation seem incomplete to me; it is as if you already know something. I have never been a fan of JetBrains documentation.

I can install a plugin, but I cannot debug it following the instructions above.

I have downloaded source for various plugins. Most are outdated, since they support ReSharper 8.

Are there any plans to reissue templates and samples as was done with the older SDK MSI?

Thanks,
Scott

Scott Lurowist

unread,
May 30, 2016, 8:30:21 AM5/30/16
to resharper-plugins
I have spent three days trying to write a simple plugin with no success.

I followed the official documentation. I have never been a fan of JetBrains documentation. I think that most of it assumes that you already know something.

I tried looking at lots of source code for plugins, but I it is TOO much work to learn this way. I simply do not have the time. There is not even an API reference to consult.

I tried looking for older SDK MSIs, but I cannot find them.

Are there plans to once again release templates and sample code as was done in the past?

Thank,
Scott

Matt Ellis

unread,
May 30, 2016, 8:37:52 AM5/30/16
to resharper-plugins
Hi Scott. Sorry to hear that you're having problems. Once your plugin is installed, and loaded by ReSharper, you should just be able to attach to Visual Studio in order to debug. What's your plugin currently set up to do?

We definitely want to improve things for ReSharper plugins - we'd like to resurrect some of the sample plugins, and VS templates would also be useful. And it would be great to have an API reference, but there is a lot of API there to reference, and it's all a question of time and resources, unfortunately.

Regards
Matt

Scott Lurowist

unread,
May 30, 2016, 2:33:37 PM5/30/16
to resharper-plugins
Hi Matt,

My plugin for the moment trying to simply be a context action that recognizes "hello world". It seems to be the easiet thing to do. Once I understand that and Daemons, I want to write a plugin that analyzes unit tests for bad habits, such as logic, magic numbers, etc.

I followed the instructions for debugging. I start a second "experimetal instance" of Visual Studio from the debug tab of the first instance, and pass /rootSuffix ScottsResharperPlugin and /Resharper.Internal. Another instance of VS starts, and I see a bunch of stuff being loaded in the orignal VS instance. But then I don't get solid red debugger dots in the first instance. I get the message that symbols cannot be loaded.

I even added the information from this page to the project. I see ReSharper output in the output window so things are probably working.

I can understand not documenting the entire API; it is huge! But commented samples and template would be a huge help! I have a full-time job, and a friend and I developer software for wildlife conservation in our free time. While I learned a few things looking at the source for plugins in the ReSharper Gallery, it is not the most productive use of my limited time.

Thanks for getting back to me so quickly!

Scott 

Matthew Ellis

unread,
May 31, 2016, 8:38:48 AM5/31/16
to resharper-plugins
Hi Scott. Have you installed your extension into this experimental instance? It needs to show as installed in the Extension Manager. If that's the case, the next thing to check is that zones are correct. Zones are a bit tricky, unfortunately, but the simplest thing is to place an empty zone marker class in the root namespace of your extension.

This troubleshooting page lists a number of things to check.

Let me know how you get on.

Regards
Matt


--
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.

Scott Lurowist

unread,
Jun 1, 2016, 9:33:46 AM6/1/16
to resharper-plugins
Hi Matt,

I don't know what I did, but I finally hit a breakpoint in this simple code below on the expression "x = 4".

I commented the zone marker and it still worked. I am not sure what else I did differently, So is ZoneMarker really necessary?

Thank you for your help! With /ReSharper.Internal, I can use the tool that shows me the AST. I can learn from there, and the existing plugins hosted in GitHub. Perhaps when I learn enough, I'll write a current tutorial.

namespace Scott.DaemonSample
{
    [ZoneMarker]
    public class ZoneMarker
    {
    }


    [ElementProblemAnalyzer(typeof(ITreeNode))]
    public class HelloWorldElementProblemAnalyzer : ElementProblemAnalyzer<ITreeNode>
    {

        protected override void Run(ITreeNode element, ElementProblemAnalyzerData data, IHighlightingConsumer consumer)
        {
            if (element is ICSharpLiteralExpression)
            {
                int x = 4;

Scott Lurowist

unread,
Jun 1, 2016, 8:30:45 PM6/1/16
to resharper-plugins
You were correct Matt, I did not install my plugin ***DIRECTLY*** into the experimental instance.

I inferred that all I had to do was install it period into ReSharper.

It is now all falling apart for me. I hope to make some YouTube videos soon that reduce the confusion.

Thanks,
Scott

Matthew Ellis

unread,
Jun 2, 2016, 6:29:27 PM6/2/16
to resharper-plugins
Glad you got it installed. ReSharper treats each experimental instance as a separate instance, and extensions need to be installed separately - this allows you to have one version of the extension running in your current VS instance, and test and debug a second version in an experimental version.

Regards
Matt

Reply all
Reply to author
Forward
0 new messages