Permalink
Browse files

Merge remote-tracking branch 'upstream/master' into mansheng

  • Loading branch information...
2 parents 33cc204 + 5bc69fd commit d01ed9e65875b4678a60a9501ef5f5e53528a3fd @lightyang lightyang committed May 30, 2012
@@ -41,6 +41,11 @@ public IEnumerable<CodeAction> GetActions(RefactoringContext context)
}
yield return new CodeAction (context.TranslateString("Remove braces"), script => {
+ var start = script.GetCurrentOffset (block.LBraceToken.GetPrevNode ().EndLocation);
+ var end = script.GetCurrentOffset (block.LBraceToken.EndLocation);
+ if (end <= start)
+ return;
+ script.RemoveText (start, end - start);
script.Remove(block.LBraceToken);
script.Remove(block.RBraceToken);
script.FormatText(block.Parent);
@@ -53,7 +53,7 @@ public void TestSimpleBraces()
"{" + Environment.NewLine +
" void Test ()" + Environment.NewLine +
" {" + Environment.NewLine +
- " if (true) " + Environment.NewLine +
+ " if (true)" + Environment.NewLine +
" ;" + Environment.NewLine +
" }" + Environment.NewLine +
"}", result);

0 comments on commit d01ed9e

Please sign in to comment.