Several problems with Editor comparing to previous Xamarin Studio versions

YuriTikhomirovYuriTikhomirov RUMember ✭✭
edited November 2013 in Visual Studio

Not a long ago I've finally updated the platform to both iOS 7 and Xamarin Studio 4.2.1 etc.

I don't know if the problems were discussed, it is hard to find over this forum, but let me list the most annoying here.

Copy-paste code with @string constants

Copy-paste code with @string constants at newline produces several \t inside a constant:

// lets copy the following:
var str1 = 
    @"hello";
var str2 = 
    "world";

// then let's paste:
var str1 = 
    @"      hello"; // omg
var str2 = 
    "world"; // okay

As for me, it is a serious major problem, when someone pastes a large piece of code, he even couldn't see something is broken if the @constant is outside of screen.

If-else-if-else-if-else sequence formatting

Lets just type a code:

int a = 0;
if (1 > 0)
    a = 1;
else
    if (2 < 10)
        a = 2;
else
        if (3 > 15)
            a = 3;
else
            if (18 > 99)
                a = 4;

Is that normal? I didn't find any setting in formatting options to avoid such behavior. I even unable to use Shift+Tab (for a single line) to return the indentation to preferred position, I have to use backspace or something. But it works when Shift-tabbing the selection... But every change in a line returns to indents it back to that thing above.

As for me, there a two kinds of behavior for if-else-if-else sequence:

  1. Indent every next if:

    if (1 > 0)
        a = 1;
    else
        if (2 < 10)
            a = 2;
        else
        if (3 > 15)
                a = 3;
    
  2. Do not indent after else:

    if (1 > 0)
        a = 1;
    else
    if (2 < 10)
        a = 2;
    else
    if (3 > 15)
        a = 3;
    

I don't know if someone may prefer the first option (I don't think it is readable enough when the sequence is really long), I prefer the second. But anyway, the current behavior should be fixed.

Bookmarks and cursor position

And the last one doesn't relates to a new Xamarin Studio, but as I remember always behave like that. It is related to bookmarks. I really love bookmarks sometimes, I use custom Ctrl+1 to set and Alt+1 to jump to the bookmark. But the thing is the cursor position after jumping to bookmark. When the next bookmark is above current cursor position, the cursor will stay at the top of text area, when below - at the bottom. But I can't always predict where is my next bookmark and it is really annoying to find the cursor when you tired. So, dear Xamarin Studio developers, could you please add an option to always put the cursor at the center of screen after jumping to next (or previous) bookmark? - this way people will always know where to put there eyes to find it.

...But anyway, thank you for your work! I hates Mac but I loves to work with Xamarin Studio on Mac! =)

Posts

  • MikeKrgerMikeKrger DEXamarin Team, Beta Xamurai

    I fixed the @" paste problem. I'll work something out for the 2nd one.

    The behavior now is an error - the else keywords are not indented correctly (but the ifs are). We need to fix that and introduce an option for the #2 case.

  • YuriTikhomirovYuriTikhomirov RUMember ✭✭

    Mike, thanks a lot! Can't wait to get an update.

    By the way, let me describe another problem I think of a high priority for iOS developers. I'm not exactly sure if it was before, but now every time I want to debug my app in simulator, Xamarin relaunches the simulated iOS. It takes several seconds to do and of course it's not as fast as it was when it did not relaunch. Let me explain, before I updated to Xamarin iOS 7, I had the only version of simulator SDK installed - maybe it just didn't restart because of it, but...

    IMHO the new UI to choose target for simulator (version, screen size) is actually not as good from the ios-developer's standpoint as it could seem. As for me, it important to choose between real device(s) and simulator of maybe different version. I think the screen size adjustment for simulator is great if it is in a separate dropdown list.

    But anyway, the main issue, of course, is the launch speed. So, is it possible to check somehow the version of iOS running currently in simulator and do not switch it when it matches the targeted one?

    Those few seconds causes a huge waste of time if we multiply them by everyday launch count of every Xamarin developer in the world =)

    Thanks for your support!

  • JeffreyStedfastJeffreyStedfast USXamarin Team Xamurai

    There's unfortunately no way to figure out which iOS version is running in the current simulator.

    However, what we do is as long as you don't change the device hardware, we remember what we last started the iOS Simulator with and if we'd end up starting the same simulator, we simply reuse the existing one. If you change the hardware or iOS version, we have no choice but to kill the current simulator and start a new one.

  • YuriTikhomirovYuriTikhomirov RUMember ✭✭

    Jeffrey, thanks, I think that would be great!

  • PeterAjtaiPeterAjtai USMember

    Also regarding bookmarks.... there is no way to list all current bookmarks, and if you close a file, the bookmarks for that file are forgotten.

Sign In or Register to comment.