SharpDevelop Community

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

Christoph Wille

  • 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):


    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.

  • What's New in SD5: Richtext XML DocumentationTooltips

    The best way to get started is to look at a screenshot:

    Please note that tooltips are no longer plain text but are rich-text formatted including clickable links for <see cref="..."> elements. Those links today take you to the definition of the respective element. But for framework assemblies (for which XML docs are locally installed), we consider changing that to XmlDoc: Links should open MSDN documentation or go to definition. Let us know in the comments to this blog post if you think that this is not a good idea, and why instead you'd like to go to the decompiled source.


  • What's New in SD5: Enhanced Scrollbar

    This one is a visual enhancement - compiler errors, breakpoints, and 'code issues' are displayed in the editor's scroll bar:

    Please note that the entire length of the scrollbar is used to display the relative positions of the respective elements. For example, in this screenshot I hovered with the mouse over the inspection (blue triangle) to see the information, clicking will take you to the position in the source file. The enhanced scrollbar also displays the position of the compiler error (red triangle) as well as the breakpoint (red circle)

    Posted Jan 28 2014, 06:05 PM by ChristophWille with no comments
    Filed under:
  • What's New in SD5: Code Inspections

    SharpDevelop 5 comes with background detection of almost 200 'code issues' that go above and beyond what the C# compiler reports as warnings. For example, redundant using declarations, calls to virtual methods from constructors, or the missing StringComparison argument in culture-aware string operations (e.g. string.IndexOf). Many issues come with automatic fixes in the context action menu (Ctrl+T).

    To see which inspections are available, go to Tools / Options / Coding / C# / Code Inspections:

    As you can see, various severity levels are available - issues that lead to compiler errors are flagged as errors here too, softening to suggestion or hint when it is considered bad practice.

    For example, if you have an empty constructor, you are notified of the issue and can fix it:

    Take a few minutes to browse through the code issues to learn what SharpDevelop can do for you automatically.

  • What's New in SD5: Ctrl+F7 for Adding Watch Expressions

    Ok, on to a new feature in the debugger. Adding watch expressions has become extremely easy in SharpDevelop 5. Simply select an expression, press Ctrl+F7

    and it will be added to the Watch window:

    As we are not debugging (yet), SharpDevelop has no idea about the value of the expression. So let's put a breakpoint the line above the if statement and start the debugger:

    As you can see, the expressions are evaluated although we didn't yet hit the if statement. This feature is really useful if you are looking at complex if statements or otherwise involved algorithmic expressions.

    But - be cautious! Take the following example:

    When you hit the breakpoint the first time, there will be "Guess what..." on the console already - because the expression is being evaluated by the debugger too, not only your code!

    Posted Jan 27 2014, 01:28 PM by ChristophWille with no comments
    Filed under:
  • What's New in SD5: Context Actions

    In the last post, I showed off Insert with cursor. In this post we are going to look a bit more at those new productivity helpers, the Context Actions. You can find a list of those under Tools / Options / Coding / C# / Context Actions, where you can selectively disable ones:

    We are going to take a look at "Extract Method" with the following sample:

    You simply select an expression, and you get the options to either assign it to a local variable or to extract it as a method. I chose Extract Method, and then you get the now familiar blue line, which let's you select the insert location of the new method (press Enter to create the method at the selected location).

    Obviously, NewMethod isn't exactly the name I wanted - conveniently, SharpDevelop kept the method name selected, and I press Ctrl+R to open the Rename dialog and give it an appropriate name. Done!

    Posted Jan 27 2014, 07:48 AM by ChristophWille with no comments
    Filed under:
  • What's New in SD5: Insert With Cursor

    The "Insert with cursor" feature is one of the new features and works eg with Extract Method or Implement Interface. Let's look at this in action - assume you have a value class like this and want to add the IComparable interface to it:

    Either clicking on the pencil symbol or pressing Ctrl+T will open the context menu for actions that can be performed:

    Once you select this option, a "blue line" (Insert with cursor) will appear together with usage information in the lower-right corner of the text editor window (I shrunk the window down to get everything into one single screenshot):

    I followed the instructions and used Cursor down to go below FirstName property and pressed Enter - et voila, the interface definition is right where I wanted it to be:

    Now that is quite a productivity feature!

    Posted Jan 26 2014, 07:41 PM by ChristophWille with no comments
    Filed under:
  • SharpDevelop 5 Beta 1 Available

    Finally.(tl;dr Download)

    It has been (too) long in the making, but our major rearchitecting of SharpDevelop is close to being done, with only a few functional areas not in this Beta release:

    • EnvDTE.FileCodeModel is missing, thus our custom NuGet packages will be broken (T4MVC, MVCScaffolding and EF)
    • Code Quality Analysis and SharpDevelop Reports are missing (due to a rewrite of SDR)

    Please note that Beta 2 is not too far off, and these will be in Beta 2.

    As pointed out in the blog post SharpDevelop 5 C# Tech Preview, we are still shipping with C# only in SharpDevelop 5 – and this will most likely remain true for RTM too. (VB.NET will compile, but it won’t have code completion nor refactoring) SharpDevelop 5 installs in parallel to older versions, and if you have the patience: give it a dry run with a copy of an existing project (at least backup and/or use source control before you let a beta IDE touch your source code).

    For further information on what’s new, please consult this list of select blog posts from the team members (I'll be doing a few "What's New" blog posts in the coming days, because obviously these are only a few big-ticket items - check back!):

    With regards to the last bullet item, I'd like to introduce you to our "xcopyable installation" that you can find now as a third download option: as with ILSpy, you can now simply unpack a zip file and are up and running debugging IL assemblies (after all, we yanked debugging from ILSpy - so we thought it'd be nice to add a light-weight installation for SharpDevelop to get the debugging feature back).

More Posts « Previous page - Next page »
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this ( email address.