SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

Christoph Wille

February 2014 - Posts

  • What's New in SD5: Automatic Variable Naming

    In the blog post Context Actions I showed how to refactor existing code into a new method, and how Link Mode allows you to rename it. But there was a slight problem which this code exhibited at that time:

    Had I refactored "(j % 5)" into a new local variable (via Declare local variable), it would have named it "i". You got yourselves a name collision (same with NewMethod if you performed Extract Method twice before renaming the first instance).

    The new behavior is as follows - you choose to Declare local variable:

    SharpDevelop will look in the scope to see if there is already a variable "i" and append the next free number to it:

    Because Link Mode is now enabled, you can immediately start typing and rename the variable to your liking:

    As usual, you can grab the latest bits from our build server.

    Posted Feb 09 2014, 09:54 AM by ChristophWille with no comments
    Filed under:
  • What's New in SD5: Suppressing Issues

    I have introduced you to code issues / inspections already, today we are going to talk about "silencing" issues that are either false positives or intentional. Coming in Beta 2 you will be able to turn off an inspection once or entirely. Let's look at an example:

    Calling a virtual member in a constructor isn't good practice, that's why the inspection tells you that you have a problem here. But what if that is intentional, and you don't want somebody else to inadvertently "fix" this when they get the flag too? Well, you can turn it off:

    This will insert a comment of format "// disable once {name of code issue}" above the method call:

    And as you can see, the squiggly lines are gone and SharpDevelop no longer compains about you calling a virtual method.

    Posted Feb 09 2014, 09:40 AM by ChristophWille with no comments
    Filed under:
  • What's New in SD5: Jump to Documentation in Tooltips

    The previous post What's New in SD5: Richtext XML DocumentationTooltips talked about the new, rich, documentation tooltips. As of today, the link target functionality is available in SharpDevelop 5, via Tools / Options / Text Editor / Code Completion:

    It will default to Help for Framework classes, with a fallback to Definition for everything else.

     

    Posted Feb 08 2014, 06:02 PM by ChristophWille with no comments
    Filed under:
  • What's New in SD5: Paste from Clipboard Ring

    The Clipboard Ring is an old friend that is in SharpDevelop since ancient days. You usually access it via the Tools pad:

    What is new in SharpDevelop 5 (again, Beta 2) is that you got a Paste command for it: Ctrl+Shift+V. This opens the Paste UI right where you are in your code, no need to use the Tools pad or take your hands off the keyboard:

    Posted Feb 08 2014, 05:07 PM by ChristophWille with no comments
    Filed under:
  • What's New in SD5: Completion in Watch & Console Pad + Breakpoint Window

    Another upcoming Beta 2 feature is what we internally called 'dot completion' for the watch and console pad, as well as the new breakpoint options dialog. Simply type an expression, hit . and the completion will kick in:

    Same goes for the breakpoint options:

    And yes, you do get the tooltip for the selected item:

    Posted Feb 06 2014, 04:42 PM by ChristophWille with no comments
    Filed under:
  • What's New in SD5: Breakpoint Options Popup

    Today, I am going to show off another post-Beta 1 feature that comes in handy when you are debugging your applications: the breakpoint options popup. How to find it? Well, you first need a breakpoint:

    Next, hover over the breakpoint in the margin (don't overreact and right-click...):

    As you can see, the default is that it breaks every time, and that it is enabled. Click on Conditional and enter the expression that you want to break you into the debugger - in my case, I want to break into the debugger when the loop variable i is 5:

    Note that the breakpoint icon in the margin has changed:

    Hit F5 to start debugging, and voila, the breakpoint is hit when i is 5:

    Posted Feb 04 2014, 06:44 PM by ChristophWille with no comments
    Filed under:
  • What's New in SD5: Link Mode

    In the blog post on Context Actions I showed how to use the Extract Method context action. The last step - renaming the NewMethod - was a stopgap measure because Link Mode didn't exist in Beta 1 yet. But it is available in the current builds on the build server.

    So what is Link Mode? It obviously links two things: in the case of Extract Method, it is the method declaration and the call. This translates into the method declaration being highlighted, and the moment you type, the method declaration and the call are updated with your naming changes to the method.

    To give you an idea of this in action, have a look at this really short screen recording (no sound):

    CreateLinkSample.mp4

    Posted Feb 02 2014, 06:28 PM by ChristophWille with no comments
    Filed under:
  • What's New in SD5: Background Syntax Check

    A good example of a syntax error is a missing semicolon. Of course, the build process would flag this error - but SharpDevelop 5 will catch this during typing:

    Please note that in Beta 1, there is a off-by one error that is fixed in newer builds on the build server.

Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.