提交 3b251db0 编写于 作者: C CyrusNajmabadi

Ficks speeling

上级 2100fde0
......@@ -9,7 +9,6 @@
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CodeActions;
using Microsoft.CodeAnalysis.CodeFixes;
using Microsoft.CodeAnalysis.CSharp.CodeStyle;
using Microsoft.CodeAnalysis.CSharp.CodeStyle.TypeStyle;
using Microsoft.CodeAnalysis.CSharp.Extensions;
using Microsoft.CodeAnalysis.CSharp.Syntax;
......@@ -46,7 +45,7 @@ public override Task RegisterCodeFixesAsync(CodeFixContext context)
// Attempt to use an out-var declaration if that's the style the user prefers.
// Note: if using 'var' would cause a problem, we will use the actual type
// of hte local. This is necessary in some cases (for example, when the
// of the local. This is necessary in some cases (for example, when the
// type of the out-var-decl affects overload resolution or generic instantiation).
foreach (var diagnostic in diagnostics)
......@@ -122,7 +121,7 @@ public override Task RegisterCodeFixesAsync(CodeFixContext context)
// to the previous token. We're going to move it along with this declarator.
// If we don't, then the comment will stay with the previous token.
//
// Note that hte moving of the comment happens later on when we make the
// Note that the moving of the comment happens later on when we make the
// declaration expression.
if (sourceText.AreOnSameLine(declarator.GetFirstToken(), declarator.GetFirstToken().GetPreviousToken(includeSkipped: true)))
{
......@@ -138,8 +137,8 @@ public override Task RegisterCodeFixesAsync(CodeFixContext context)
//
// Method(out var x)
//
// Then the type is not-apperant, and we shoudl not use var if the user only wants
// it for apperant types
// Then the type is not-apparent, and we should not use var if the user only wants
// it for apparent types
var local = (ILocalSymbol)semanticModel.GetDeclaredSymbol(declarator);
var newType = local.Type.GenerateTypeSyntaxOrVar(options, typeIsApperant: false);
......@@ -176,7 +175,7 @@ public override Task RegisterCodeFixesAsync(CodeFixContext context)
{
// We're removing a single declarator. Copy any comments it has to the out-var.
//
// Note: this is tricky due to comment ownership. We want hte comments that logically
// Note: this is tricky due to comment ownership. We want the comments that logically
// belong to the declarator, even if our syntax model attaches them to other tokens.
var precedingTrivia = declaratorOpt.GetAllPrecedingTriviaToPreviousToken(
sourceText, includePreviousTokenTrailingTriviaOnlyIfOnSameLine: true);
......@@ -205,7 +204,7 @@ private static IEnumerable<SyntaxTrivia> MassageTrivia(IEnumerable<SyntaxTrivia>
else if (trivia.IsWhitespace())
{
// Condense whitespace down to single spaces. We don't want things like
// indentation spaces to be inserted in the out-var location. It is appropraite
// indentation spaces to be inserted in the out-var location. It is appropriate
// though to have single spaces to help separate out things like comments and
// tokens though.
yield return SyntaxFactory.Space;
......@@ -225,7 +224,7 @@ private static IEnumerable<SyntaxTrivia> MassageTrivia(IEnumerable<SyntaxTrivia>
if (newType.IsVar)
{
// Options want us to use 'var' if we can. Make sure we didn't change
// the semantics of teh call by doing this.
// the semantics of the call by doing this.
// Find the symbol that the existing invocation points to.
var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册