46 references to SingleLineCommentTrivia
Microsoft.CodeAnalysis.CSharp (11)
Compilation\CSharpCompilation.cs (1)
4442Func<SyntaxTrivia, bool> isComment = trivia => trivia.Kind() == SyntaxKind.SingleLineCommentTrivia || trivia.Kind() == SyntaxKind.MultiLineCommentTrivia;
Syntax\CSharpSyntaxTree.cs (1)
746isComment: trivia => trivia.Kind() == SyntaxKind.SingleLineCommentTrivia || trivia.Kind() == SyntaxKind.MultiLineCommentTrivia,
Syntax\InternalSyntax\CSharpSyntaxNode.cs (1)
279|| this.Kind == SyntaxKind.SingleLineCommentTrivia;
Syntax\InternalSyntax\SyntaxFactory.cs (1)
99return SyntaxTrivia.Create(SyntaxKind.SingleLineCommentTrivia, text);
Syntax\SyntaxFactory.cs (2)
184/// <see cref="SyntaxKind.SingleLineCommentTrivia"/>, <see cref="SyntaxKind.MultiLineCommentTrivia"/>, 203case SyntaxKind.SingleLineCommentTrivia:
Syntax\SyntaxKindFacts.cs (1)
231case SyntaxKind.SingleLineCommentTrivia:
Syntax\SyntaxNodeRemover.cs (2)
123/// be true for <see cref="SyntaxKind.EndOfLineTrivia"/>, <see cref="SyntaxKind.SingleLineCommentTrivia"/>, 129|| trivia.Kind() == SyntaxKind.SingleLineCommentTrivia
Syntax\SyntaxNormalizer.cs (2)
1198case SyntaxKind.SingleLineCommentTrivia: 1211case SyntaxKind.SingleLineCommentTrivia:
Microsoft.CodeAnalysis.CSharp.CodeStyle (6)
CSharpFileHeaderHelper.cs (1)
28if (commentTrivia.IsKind(SyntaxKind.SingleLineCommentTrivia))
CSharpSyntaxKinds.cs (1)
30public int SingleLineCommentTrivia => (int)SyntaxKind.SingleLineCommentTrivia;
SyntaxTriviaExtensions.cs (3)
25=> trivia.IsKind(SyntaxKind.MultiLineCommentTrivia) || trivia.IsKind(SyntaxKind.SingleLineCommentTrivia); 37=> trivia.Kind() == SyntaxKind.SingleLineCommentTrivia; 66if (trivia.Kind() == SyntaxKind.SingleLineCommentTrivia)
SyntaxTriviaListExtensions.cs (1)
34.Where(t => t is (kind: SyntaxKind.SingleLineCommentTrivia or SyntaxKind.MultiLineCommentTrivia or SyntaxKind.WhitespaceTrivia))
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
Diagnostics\Suppression\SuppressionTests.cs (1)
1109foreach (var trivia in context.Node.DescendantTrivia().Where(t => t.Kind() is SyntaxKind.SingleLineCommentTrivia or SyntaxKind.MultiLineCommentTrivia))
Microsoft.CodeAnalysis.CSharp.Features (8)
AddFileBanner\CSharpAddFileBannerCodeRefactoringProvider.cs (1)
29case SyntaxKind.SingleLineCommentTrivia:
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.cs (1)
191case SyntaxKind.SingleLineCommentTrivia:
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (1)
75SyntaxKind.SingleLineCommentTrivia or
ConvertProgram\ConvertProgramTransform_ProgramMain.cs (2)
140while (triviaToMove is [.., SyntaxTrivia(SyntaxKind.SingleLineCommentTrivia), SyntaxTrivia(SyntaxKind.EndOfLineTrivia)]) 161c => c.Kind() is SyntaxKind.SingleLineCommentTrivia && c.ToString().Contains("https://aka.ms/new-console-template"));
CSharpFileHeaderHelper.cs (1)
28if (commentTrivia.IsKind(SyntaxKind.SingleLineCommentTrivia))
InvertIf\CSharpInvertIfCodeRefactoringProvider.cs (1)
221|| trivia.IsKind(SyntaxKind.SingleLineCommentTrivia);
Structure\CSharpStructureHelpers.cs (1)
266var firstComment = startToken.LeadingTrivia.FirstOrNull(t => t.IsKind(SyntaxKind.SingleLineCommentTrivia) || t.IsKind(SyntaxKind.SingleLineDocumentationCommentTrivia));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (10)
LexicalAndXml\LexicalTests.cs (4)
115Assert.Equal(SyntaxKind.SingleLineCommentTrivia, trivia[0].Kind()); 134Assert.Equal(SyntaxKind.SingleLineCommentTrivia, trivia[0].Kind()); 171Assert.Equal(SyntaxKind.SingleLineCommentTrivia, trivia.Kind()); 277Assert.Equal(SyntaxKind.SingleLineCommentTrivia, trivia[0].Kind());
LexicalAndXml\XmlDocCommentTests.cs (2)
101Assert.Equal(SyntaxKind.SingleLineCommentTrivia, leading[0].Kind()); 119Assert.Equal(SyntaxKind.SingleLineCommentTrivia, leading[1].Kind());
Parsing\ScriptParsingTests.cs (1)
9717Assert.Equal(SyntaxKind.SingleLineCommentTrivia, eof.GetLeadingTrivia().Single().Kind());
Syntax\SyntaxNodeTests.cs (1)
608Assert.Equal(SyntaxKind.SingleLineCommentTrivia, list[0].Kind());
Syntax\SyntaxTriviaListTests.cs (2)
237Assert.Equal(-1, list.IndexOf(SyntaxKind.SingleLineCommentTrivia)); 238Assert.False(list.Any(SyntaxKind.SingleLineCommentTrivia));
Microsoft.CodeAnalysis.CSharp.Workspaces (7)
Classification\Worker.cs (1)
181case SyntaxKind.SingleLineCommentTrivia:
Classification\Worker_Preprocesser.cs (1)
101if (allowComments && trivia.Kind() == SyntaxKind.SingleLineCommentTrivia)
CSharpSyntaxKinds.cs (1)
30public int SingleLineCommentTrivia => (int)SyntaxKind.SingleLineCommentTrivia;
SyntaxTriviaExtensions.cs (3)
25=> trivia.IsKind(SyntaxKind.MultiLineCommentTrivia) || trivia.IsKind(SyntaxKind.SingleLineCommentTrivia); 37=> trivia.Kind() == SyntaxKind.SingleLineCommentTrivia; 66if (trivia.Kind() == SyntaxKind.SingleLineCommentTrivia)
SyntaxTriviaListExtensions.cs (1)
34.Where(t => t is (kind: SyntaxKind.SingleLineCommentTrivia or SyntaxKind.MultiLineCommentTrivia or SyntaxKind.WhitespaceTrivia))
Microsoft.CodeAnalysis.EditorFeatures.Cocoa (1)
Snippets\CSharpSnippets\SnippetCommandHandler.cs (1)
114return !(trivia.IsKind(SyntaxKind.MultiLineCommentTrivia) || trivia.IsKind(SyntaxKind.SingleLineCommentTrivia) || token.IsKind(SyntaxKind.StringLiteralToken));
Microsoft.CodeAnalysis.Test.Utilities (1)
Diagnostics\SuppressMessageAttributeTests.DiagnosticAnalyzers.cs (1)
207t.IsKind(SyntaxKind.SingleLineCommentTrivia) ||
Microsoft.VisualStudio.LanguageServices.CSharp (1)
CodeModel\MethodXml\MethodXmlBuilder.cs (1)
42if (trivia.Kind() == SyntaxKind.SingleLineCommentTrivia)