Tag Archives: ReSharper

Kotlin and ReSharper in Australia

I’ll be in Australia soon for YOW! Conference, where in addition to giving a talk I’ll be giving a workshop on Refactoring and dealing with legacy code with ReSharper, both in Melbourne and Sydney. There’s still time to sign-up!

In addition, the folks of the Melbourne JUG and Sydney JUG have been kind enough to host me to give a talk on Kotlin. We’ll be putting Kotlin to the test and I hope to be able to answer any questions you might have, so it will be as interactive as possible.

Finally I’ll also be at DDD Brisbane where I’ll be giving a talk and a Q&A Panel.

Hope to catch you at one of the events. And once again, thanks to YOW organizers for making this all possible.

ReSharper and Express.js Workshop at GOTO Aarhus

This October, we will be holding a ReSharper hands-on workshop as part of the GOTO Aarhus conference, organized by our partners Trifork.

  

The workshop is focused for developers that are already familiar with ReSharper. We will take a look at how to use ReSharper effectively to its full potential, covering some of the less known features as well as understanding how to customize things to suit different needs. But we won’t stop there. A good portion of the workshop will be dedicated to extending ReSharper by writing your own plug-ins. You’ll see how to leverage our platform to have deep insight into code, gain access to analysis and refactoring calls and easily extend your favorite tool with custom functionality.

 

In addition to this workshop, I’ll also be offering another workshop on Web Development with Express.js, a Sinatra-inspired web framework for node.js. You’ll not only learn about Express.js and node.js, but also how to effectively use WebStorm, our JavaScript and HTML IDE.

  

The conference itself is one of the largest in Denmark and hosts a variety of tracks ranging from specific technology and languages, to process and human interactions, providing a rich and excellent choice of topics.

For more information about the workshops:

 

Registration and Promotional Discount

In collaboration with Trifork, we are offering a 100 Euros discount off of the registration price. When registering for the conference enter the promotional code jetbrains2012. The workshops are limited in seats, so do sign up if you’re interested in attending. To Register click here.

 

 

Note: You do not need to attend the conference to sign up to the workshops.

 

Hope to see you there!

 

                

      fdfdd

Switzerland Visit

 

This summer we will be visiting two User Groups in Switzerland to talk about some of our tools among other things.

The events are organized in collaboration with the local User Groups of Berne and Lucerne:

 

If you’d like to attend the event, I’d recommend you sign up as places are limited.

Berne

Date: Tuesday 3rd July – 6 to 9 pm

Topics:

     ReSharper Tips’n’ Tricks

     Real World MVC

 

Registration, Location and more info: User Group Web Site

Lucerne

Date: Wednesday 4th July – 6 to 8:30 pm

Topics:

     ALM with JetBrains Tools (covering TeamCity, YouTrack et al.)

     Real World MVC

 

Registration, Location and more info: User Group Web Site

 

 

All registrations are handled directly by the user groups. Please contact them (via their web site) if you have any issues.

 

 

Hope to see you there!

Providing Intellisense, Navigation and more for Custom Helpers in ASP.NET MVC

 

You probably are aware by now that as of ReSharper 5 we added first-class support for ASP.NET MVC. This included among many things, the ability to provide Intellisense, Create from usage and Navigation to built-in methods such as Controller.View or Html.ActionLink:

 

Navigation

Ctrl+Left Mouse Click or F12 will navigate to the corresponding View

 

image 

 

or to the Action and/or Controller

 

image

Intellisense and Create From Usage

Ability to have Intellisense when providing Actions/Controllers

 

image

 

as well as the possibility of creating from usage

image

 

However, what happens when you want to use a custom function, for instance, a better ActionLink or your own View method? Did you know that you can still get all these goodies? All you need to do is use some Annotations.

Using JetBrains.Annotations

ReSharper uses annotations via the form of .NET attributes to figure out what an ASP.NET MVC View, Action or Controller is. As such, all we need to do for our custom method and extensions to leverage this, is tell ReSharper what parameter corresponds to what.

 

Referencing the annotations

To use ReSharper annotations, we have mainly two options (with a third one hopefully coming soon):

1. We can include the library JetBrains.Annotations.dll in our project and reference it.

2. We can copy the annotations and include it as source in our project

[3. We can use nuget install-package JetBrains.Annotations] Coming soon!

 

The first option is pretty simple. The DLL is located in the ReSharper installation bin folder. For the second option, we open up ReSharper | Options and select Code Annotations entry

 

image

 

select the Copy default implementation to clipboard button and paste into an empty file.

 

Annotating custom methods

Once we’ve completed this step, all we need to do is annotate our parameters with the correct attributes. We’re interested in 3 different attributes in particular:

 

  • AspMvcView which indicates the parameter is a View
  • AspMvcAction which indicates the parameter is an Action
  • AspMvcController which indicates the parameter is a Controller

 

Here is the header corresponding to a base controller with a custom method named ExtendedView

 

image

 

and here’s the header for a custom ActionLink

image 

 

(the body of both methods are omitted and are not necessary to demonstrate the functionality)

 

As soon as we do this, ReSharper picks up these methods and offers us the same functionality that is provided for the methods that ship out of the box:

 

image

 

Notice how we still get Navigation (the underlining), Intellisense and Create from usage in our TheOnlyActionLink custom method. Its much the same for the ExtendedView method

 

image

 

That’s all there is to it.

Australia: First Contact

 

image

 

We have a lot of users in Australia, yet we’ve never managed to get out over there for a conference. That’s about to change. Next week, myself and Sergey Coox (ReSharper Project Manager) will be heading to the Gold Coast for TechEd Australia. We are sponsoring the event as well as having a booth present. It is going to be a great opportunity to see and talk first-hand to our users and also a personal chance to get to see (albeit very little) of Australia. We will ship a few hundred “I see dead code” T-Shirts also, so make sure to stop by the booth to pick yours up.

ReSharper Tips and Tricks Demo

We’ve managed to secure one whole hour at the Create Demo Booth that will be in the exhibit area to hold a ReSharper Tips and Tricks session, similar to those that have taken place at other conferences. This will take place on Thursday 1st of September 1 pm – 2 pm. It will be somewhere in the Exhibitor area. Pass by the booth during the week for more details.

YouTrackSharp and YouTrackForReSharper on JetBrains GitHub

Just a quick note to say that I’ve transferred the YouTrackSharp project from my own account over to the JetBrains account on github. I’ve also pushed the initial spike of YouTrackForReSharper which is a plug-in for ReSharper to talk to YouTrack. We’re looking for contributors for this project, so if you’re up to it, fork away!

File Header Macros in ReSharper 6

Sometime ago I wrote about Automating File Header Information, showing how to insert license information and other data in project files. One of the shortcomings ReSharper had however was the inability to support macros. Something as simple as inserting the current year or filename required the support of StyleCopy for ReSharper. ReSharper 6 now support macros allowing file headers to contain varying information:

SNAGHTML13afe47c

For instance, in the previous license header, the Copyright years are fixed to 2010 – 2011. It also has no information relevant to the actual project. We could of course hardcode the name of the project in there but since this setting is not solution-specific, it would be of little use. Other data such a filenames however would be impossible to do.

With ReSharper 6 we simply remove the hardcoded values and replace them with macros. We can either type them in or click on the corresponding macro, which will insert it at current cursor position:

image

With this change in place, next time we run a code-cleanup and have the Update File Header option activated, we will get up to date and project/file specific header information inserted. Next feature request: Custom Macros!