提交 de4ee700 编写于 作者: K KirillOsenkov

Fix typo: triva -> trivia. Seems to be a common typo. (changeset 1395446)

上级 86c7f199
...@@ -150,7 +150,7 @@ public static TRoot InsertTokensAfter<TRoot>(this TRoot root, SyntaxToken tokenI ...@@ -150,7 +150,7 @@ public static TRoot InsertTokensAfter<TRoot>(this TRoot root, SyntaxToken tokenI
} }
/// <summary> /// <summary>
/// Creates a new tree of nodes with the specified old triva replaced with new trivia. /// Creates a new tree of nodes with the specified old trivia replaced with new trivia.
/// </summary> /// </summary>
/// <typeparam name="TRoot">The type of the root node.</typeparam> /// <typeparam name="TRoot">The type of the root node.</typeparam>
/// <param name="root">The root of the tree of nodes.</param> /// <param name="root">The root of the tree of nodes.</param>
......
...@@ -451,7 +451,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Syntax.InternalSyntax ...@@ -451,7 +451,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Syntax.InternalSyntax
Private addDiagnosticsToFirstTokenOnly As Boolean Private addDiagnosticsToFirstTokenOnly As Boolean
Private diagnosticsToAdd As IEnumerable(Of DiagnosticInfo) Private diagnosticsToAdd As IEnumerable(Of DiagnosticInfo)
' Add a trivia to the triva we are accumulating. ' Add a trivia to the trivia we are accumulating.
Private Sub AddTrivia(trivia As VisualBasicSyntaxNode) Private Sub AddTrivia(trivia As VisualBasicSyntaxNode)
FinishInProgressTokens() FinishInProgressTokens()
triviaListBuilder.AddRange(trivia) triviaListBuilder.AddRange(trivia)
...@@ -484,7 +484,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Syntax.InternalSyntax ...@@ -484,7 +484,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Syntax.InternalSyntax
Me.diagnosticsToAdd = diagnosticsToAdd Me.diagnosticsToAdd = diagnosticsToAdd
End Sub End Sub
' Process a token. and add to the list of triva/tokens we're accumulating. ' Process a token. and add to the list of trivia/tokens we're accumulating.
Public Sub AddToken(token As SyntaxToken, isFirst As Boolean, isLast As Boolean) Public Sub AddToken(token As SyntaxToken, isFirst As Boolean, isLast As Boolean)
Dim isMissing As Boolean = token.IsMissing Dim isMissing As Boolean = token.IsMissing
......
...@@ -458,7 +458,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic ...@@ -458,7 +458,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
''' Gets the DirectiveTriviaSyntax items for a specified SytaxNode with optional filtering. ''' Gets the DirectiveTriviaSyntax items for a specified SytaxNode with optional filtering.
''' </summary> ''' </summary>
''' <param name="node">The source SyntaxNode.</param> ''' <param name="node">The source SyntaxNode.</param>
''' <param name="filter">The optional DirectiveTriva Syntax filter predicate.</param> ''' <param name="filter">The optional DirectiveTrivia Syntax filter predicate.</param>
''' <returns>A list of DirectiveTriviaSyntax items</returns> ''' <returns>A list of DirectiveTriviaSyntax items</returns>
<Extension> <Extension>
Public Function GetDirectives(node As SyntaxNode, Optional filter As Func(Of DirectiveTriviaSyntax, Boolean) = Nothing) As IList(Of DirectiveTriviaSyntax) Public Function GetDirectives(node As SyntaxNode, Optional filter As Func(Of DirectiveTriviaSyntax, Boolean) = Nothing) As IList(Of DirectiveTriviaSyntax)
......
...@@ -2118,7 +2118,7 @@ End Class]]> ...@@ -2118,7 +2118,7 @@ End Class]]>
<WorkItem(539940, "DevDiv")> <WorkItem(539940, "DevDiv")>
<Fact> <Fact>
Public Sub TestFindTrivaNoTriviaExistsAtPosition() Public Sub TestFindTriviaNoTriviaExistsAtPosition()
Dim code = <code>Class Foo Dim code = <code>Class Foo
Sub Bar() Sub Bar()
End Sub End Sub
...@@ -3643,7 +3643,7 @@ End Module ...@@ -3643,7 +3643,7 @@ End Module
End Sub End Sub
<Fact> <Fact>
Public Sub SyntaxWalkerMehthod_VerifySkippedTokenTriva() Public Sub SyntaxWalkerMehthod_VerifySkippedTokenTrivia()
Dim Compilation = CreateCompilationWithMscorlibAndVBRuntime( Dim Compilation = CreateCompilationWithMscorlibAndVBRuntime(
<compilation name="SyntaxWalkerTestTypes"> <compilation name="SyntaxWalkerTestTypes">
<file name="Test.vb"> <file name="Test.vb">
......
...@@ -56,8 +56,8 @@ the definition of VB parse tree nodes. --> ...@@ -56,8 +56,8 @@ the definition of VB parse tree nodes. -->
abstract - if true, this is an abstract class that is never instantiated, only used as a base class. abstract - if true, this is an abstract class that is never instantiated, only used as a base class.
partial - if true, make this a partial class [optional] partial - if true, make this a partial class [optional]
token-root - sets this at the root of all tokens. Exactly one structure must have this. token-root - sets this at the root of all tokens. Exactly one structure must have this.
trivia-root - sets this at the root of all trivate. zero or structure must have this. trivia-root - sets this at the root of all trivia. zero or structure must have this.
default-trailing-triva - can be "space", "newline"; indicates default trailing trivia default-trailing-trivia - can be "space", "newline"; indicates default trailing trivia
to add for the simplified factory method. to add for the simplified factory method.
no-factory - if true, no factory method is auto-generated. no-factory - if true, no factory method is auto-generated.
Sub-Elements: Sub-Elements:
......
...@@ -57,8 +57,8 @@ the definition of VB parse tree nodes. --> ...@@ -57,8 +57,8 @@ the definition of VB parse tree nodes. -->
abstract - if true, this is an abstract class that is never instantiated, only used as a base class. abstract - if true, this is an abstract class that is never instantiated, only used as a base class.
partial - if true, make this a partial class [optional] partial - if true, make this a partial class [optional]
token-root - sets this at the root of all tokens. Exactly one structure must have this. token-root - sets this at the root of all tokens. Exactly one structure must have this.
trivia-root - sets this at the root of all trivate. zero or structure must have this. trivia-root - sets this at the root of all trivia. zero or structure must have this.
default-trailing-triva - can be "space", "newline"; indicates default trailing trivia default-trailing-trivia - can be "space", "newline"; indicates default trailing trivia
to add for the simplified factory method. to add for the simplified factory method.
no-factory - if true, no factory method is auto-generated. no-factory - if true, no factory method is auto-generated.
syntax-facts-internal - (boolean, default false) If true, the syntax facts method Is... syntax-facts-internal - (boolean, default false) If true, the syntax facts method Is...
......
...@@ -97,7 +97,7 @@ Public Class ParseTree ...@@ -97,7 +97,7 @@ Public Class ParseTree
RootToken = struct RootToken = struct
End If End If
' Check for triva root. ' Check for trivia root.
If struct.IsTriviaRoot Then If struct.IsTriviaRoot Then
If RootTrivia IsNot Nothing Then ReportError(struct.Element, "More than one trivia root specified.") If RootTrivia IsNot Nothing Then ReportError(struct.Element, "More than one trivia root specified.")
RootTrivia = struct RootTrivia = struct
......
...@@ -276,7 +276,7 @@ public void AddInitialSuppressOperation(SuppressOperation operation) ...@@ -276,7 +276,7 @@ public void AddInitialSuppressOperation(SuppressOperation operation)
{ {
var operation = operations[i]; var operation = operations[i];
// if an operation contains elastic trivia itself and the operation is not marked to ignore the elastic triva // if an operation contains elastic trivia itself and the operation is not marked to ignore the elastic trivia
// ignore the operation // ignore the operation
if (operation.ContainsElasticTrivia(tokenStream) && !operation.Option.IsOn(SuppressOption.IgnoreElastic)) if (operation.ContainsElasticTrivia(tokenStream) && !operation.Option.IsOn(SuppressOption.IgnoreElastic))
{ {
......
...@@ -139,7 +139,7 @@ Namespace Microsoft.CodeAnalysis.CodeCleanup.Providers ...@@ -139,7 +139,7 @@ Namespace Microsoft.CodeAnalysis.CodeCleanup.Providers
Public Overrides Function VisitInvocationExpression(node As InvocationExpressionSyntax) As SyntaxNode Public Overrides Function VisitInvocationExpression(node As InvocationExpressionSyntax) As SyntaxNode
Dim newNode = MyBase.VisitInvocationExpression(node) Dim newNode = MyBase.VisitInvocationExpression(node)
' make sure we are not under structured triva ' make sure we are not under structured trivia
If _underStructuredTrivia Then If _underStructuredTrivia Then
Return newNode Return newNode
End If End If
......
...@@ -1600,13 +1600,13 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration ...@@ -1600,13 +1600,13 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
Return IsChildOf(node, SyntaxKind.FieldDeclaration) OrElse IsChildOf(node, SyntaxKind.LocalDeclarationStatement) Return IsChildOf(node, SyntaxKind.FieldDeclaration) OrElse IsChildOf(node, SyntaxKind.LocalDeclarationStatement)
End Function End Function
Private Function Isolate(declaration As SyntaxNode, editor As Func(Of SyntaxNode, SyntaxNode), Optional preserveTriva As Boolean = True) As SyntaxNode Private Function Isolate(declaration As SyntaxNode, editor As Func(Of SyntaxNode, SyntaxNode), Optional preserveTrivia As Boolean = True) As SyntaxNode
Dim isolated = AsIsolatedDeclaration(declaration) Dim isolated = AsIsolatedDeclaration(declaration)
Dim result As SyntaxNode = Nothing Dim result As SyntaxNode = Nothing
If preserveTriva Then If preserveTrivia Then
result = PreserveTrivia(isolated, editor) result = preserveTrivia(isolated, editor)
Else Else
result = editor(isolated) result = editor(isolated)
End If End If
......
...@@ -116,7 +116,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Formatting ...@@ -116,7 +116,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Formatting
Debug.Assert(trivia.ToString() = trivia.ToFullString()) Debug.Assert(trivia.ToString() = trivia.ToFullString())
Dim text = trivia.ToString() Dim text = trivia.ToString()
' if text contains tab, we will give up perf optimization and use more expensive one to see whether we need to format this triva ' if text contains tab, we will give up perf optimization and use more expensive one to see whether we need to format this trivia
If text.IndexOf(vbTab) >= 0 Then If text.IndexOf(vbTab) >= 0 Then
Return True Return True
End If End If
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册