Elements should support these features in Visual Studio

Some useful features in Visual Studio are not supported by Elements:

1) Unable to use the formatter to format current document.
Just try “Edit->Advanced->Format Document” and there’s no effect. It seems the VS C# formatter won’t work for Elements.

2) Unable to set a shortcut for Refactor.Rename in context menu
I usually set F2 as the shortcut for Refactor.Rename, but it won’t work in Elements.

3) Unable to "Collapse to Definitions"
Just try “Edit->Outlining->Collapse to Definitions” and there’s no effect. This feature can collapse functions and properties in a smart way, which is really useful when I review complex codes.

Thanks, logged as bugs://72323

Hello,

The FormatDocument should work. I just tried it on the simple project and got the document formatted. Could you please give me more info or a testcase where it doesn’t work.

Thanks in advance.

OK, here’s the details:

Because I don’t prefer to putting open braces on a new line, I’ve changed the VS C# formatter as below:

But this only takes effect in files of Microsoft C# project, not in RemObjects project. So I guess RO C# has its own formatter, then there are two issues:

  1. The options of RO C# formatter are too few. In fact I’m not quite sure where the options of RO C# formatter in this UI are:

  2. Try to format following codes by RO C# formatter, and you will see it does nothing for different open brace style:

    static class Program
    {
    public static Int32 Main(string[] args){ // open brace on the same line
    var t = new TestClass();
    Console.WriteLine(t.test());
    Console.ReadLine();
    }
    }

    public class TestClass
    {
    public int test()
    { // open brace on the new line
    return 2;
    }
    }

I think the best thing is we can format RO C# files with VS C# formatter.

Hello,

Thank you for the report.

  1. The formatter currently formats only wrong indentation of lines. It doesn’t format places of curly brackets etc. We have an issue logged for it.
  2. The bug is fixed, the fix will be available in the betta build.
  3. The collaps to Definitions is fixed and the fix will be available in the next gamma and rtm.

Best regards.

bugs://72323 got closed with status fixed.

Great to hear that!
For the formatter issue, I suggest you to consider intergrating the AStyle(http://astyle.sourceforge.net/) directly into your VS plugin, which is not perfect but much better than the current one.
Actually I’m using Sublime Text + AStyle to do major coding work on Elements, because the VS + AStyle can’t work well with Elements VS Plugin.

Bugs #2 & #3 are fixed in 8.2.88.1803