SharpDevelop Community

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

Martin Konicek

New productivity features in Beta 2

As we are releasing Beta2 today, here is an overview of new features you can already take advantage of:


1. Context actions

These are useful actions in the code editor which SharpDevelop offers based on context.

Let's say I want my class to implement an interface. A pencil icon appears telling me that there is some action available:

Let's click the pencil icon, or simply press Ctrl+T:

Let's just click it or press Enter:

And we get the expected result.

Another example of context action is introduce new method. When I type a name of unknown method:

Context action is offered (press Ctrl+T):

Selecting it produces the expected result:

These features were previously available in editor context menu. They are being moved from context menu to context popup. The reason is that it is much faster to access them this way.

The Context Actions offered in the popup are extensible, so you can write addins to add your own. I wil write a blogpost about this.



2. Menu restructuring and shorcuts

The context menus in code editor had unnecessary submenus. They now look like this:

The actions for the clicked symbol are on the top level. Also many items got keyboard shortcuts (these shortcuts are still subject to change), so that you can trigger e.g. Find References by one key press. Other useful new shortuts are F5 to Run/Continue debugging and Shift+F5 to End debugging.



3. Find overrides

Many times, you have code working with interfaces. The IInvestor in the previous screenshot might have only 1 or 2 implementations and you know which one is going to be returned from Service.GetInvestor(). If you want to see the implementation of the DecideWhatToBuy method, just press F6 for Find overrides.

That's it, just press Enter. Note that before this feature it was quite annoying as Go to definition would just take you to the empty definition of the method in the interface.

4. New code completion

In short, the CodeCompletion is now searched by substring and CamelCase:

The most exciting feature is automatic insertion of using. Notice that in the previous screenshot, we are not importing System.IO. Look what happens when we select FileStream:

I am using this feature for a month now and it proved so much useful.

I already blogged about this, check out this blog post.

5. Highlight symbol

All occurences to the symbol under caret are highlighted. This greatly improves code readability.

I already blogged about this, check out this blog post - it also has a video.

6. Switch on enum

This is a small but useful feature. When typing a "switch" statement where the condition is an Enum the cases are automatically prefilled.



Michael Seeger said:

This is just brilliant and thanks for considering my suggestion concerning "context actions".

August 2, 2010 9:04 AM

martinkonicek said:

Thanks MiSeeger! Now the goal with context actions will be implementing as many useful actions as possible, starting with the most useful ones. The next actions that are easy to do (bc SharpDevelop already does it) are "Move class to file with matching file name" and "Add check for null".

After I write the blogpost on how to implement new actions, maybe you can write your favourite one too and we can commit it to SharpDevelop.



August 2, 2010 6:35 PM

graveen said:

excellent Martin. I noticed numerous time i was on interface instead of the wanted method.

tahnk you.

August 4, 2010 1:09 PM

Michael Seeger said:

Hi Martin,

I'm waiting for your blogpost ;-) Sounds great!



August 4, 2010 2:42 PM

sym1987 said:


I think it would be nicer if we have another option for explicit interface implementation.

August 5, 2010 6:11 AM

martinkonicek said:

sym1987, you are certainly right. Explicit interface implementation got added now, in rev. 6382.

August 7, 2010 10:47 PM

Johan PIQUET said:


** First **

I have tested the "Context actions" functionnality.

Very useful, but I think the icon is not enought visible.

** Second **

Do you have plan for using the outline panel with C# source code ?

I thinking to add this functionnality soon.

May 1, 2011 10:00 PM

martinkonicek said:

Hi Johan,

do you mean the Context actions popup is too transparent or too small? My intention was that it is unobtrusive and visible at the same time.

As for the C# outline - it is not implemented yet. Would you like to contribute this feature?

It is not very hard to implement - just take classes and their methods from the current file (there is an object model for that, called the Dom) and display them in a TreeView and make them clickable. Being able to rearrange methods by drag&drop would be also interesting.

May 4, 2011 12:24 AM

Johan PIQUET said:


I mean it's too transparent.

I'm happy if I can help for the C# outline. Actually I'm finishing a new functionality for the project browser panel which focus on the TreeView node corresponding to the currently editing file. It's take time since It's my first plugins.

I'll contact you again when I'll start working on outline (4/5 days I think).

May 6, 2011 10:47 PM

martinkonicek said:

Hi, sure, feel free to contact me here or martin.konicek at gmail. What functionality in the TreeView related to currently opened file are you building? I did one (maybe) related thing this summer - right click file tab "Navigate to file in project browser".

May 7, 2011 12:00 AM
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this ( email address.