For the past several weeks I’ve been writing about the new features in C# 6 and Visual Studio 2015, which are facilitated by the .NET Compiler Platform, known as Roslyn.
Roslyn’s Codeplex homepage has hosted the project’s source code and information for a while.
However, over the past few days, the following announcement was posted on Roslyn’s Codeplex homepage:
This coming week (Wednesday is the target, Thursday at the latest) we will be moving the Roslyn Project to live under GitHub, joining the rest of the .NET team over there.
- This will be a simple switch – turn off CodePlex, turn on GitHub. You’ll be able to see our checkins on GitHub that same day, for example.
- Any of your pull requests to our project in GitHub will pile up for a couple of weeks, because we are going to take the opportunity to also streamline our (currently very complex) pull request process – yeah! We’ll reopen in a couple weeks with a much easier process. That, combined with us switching to use Git internally as well at the same time (!), means many fewer moving parts and gets us much closer to the same environment you’ll be using on Roslyn code. It will be so worth it.
- At this point, I’d advise holding off on any requests sent to CodePlex, and save them for GitHub instead.
- We’ll be using GitHub Issues for both discussions and bugs after the switch.
- We will try to move over outstanding bugs from CodePlex, but this is the trickier part of the plan. Stay tuned.
- We will also do our best to preserve check-in history.
- We will be under the .NET Foundation over there, as the “Compilers” project.
We will update this page with the forwarding information when the switch is complete mid-week. I’ll also be blogging about some of the additional OSS work we’re about to embark on in a week or two.
Group Software Engineering Manager, “Roslyn”
It appears that the move is now complete, and you can find all the latest on Roslyn at its new home on GitHub.
Visual Studio 2015 brings two new refactorings: Introduce Local Variable, and Inline Temporary Variable.
Inline Temporary Variable is actually the exact opposite of Introduce Local Variable. At times you’ll be using a variable for something so simple that it actually clutters the code. For example:
var firstArgument = args;
We can get rid of the firstArgument variable by using the Inline Temporary Variable refactoring.
To do this, we first need to select the firstArgument variable on the first line (where it is being declared), and then press Ctrl+. (Control Dot) or select “Quick Actions…” from the context menu after right-clicking the selection. This brings up the refactorings menu, from which we can select the refactoring we want:
After selecting the Inline Temporary Variable refactoring from the menu, the code gets cleaned up pretty nicely:
There are two new refactorings introduced in Visual Studio 2015. The first of these allows you to introduce a local variable to simplify your code. Let’s see this at work on some source code from ImapTalk.
After selecting some code, press Ctrl+. (Control Dot) or select “Quick Actions…” after right-clicking on the selected code. You’ll get a list of refactorings that you can apply to your code, along with a nifty preview of what your code will look like after it is applied:
In this code I’ve got this Color object that I’m passing directly into the constructor of a SolidColorBrush, which looks a bit messy. With this refactoring, I’ll introduce a local variable to hold that Color, and then pass the new variable into the SolidColorBrush:
Once you select this refactoring, Visual Studio goes into inline rename mode, so that you can choose the name of the new variable.
Take a look at the refactored code above. Much better! 🙂