39 references to FirstOrNull
Microsoft.CodeAnalysis.CSharp.Features (12)
Structure\CSharpStructureHelpers.cs (12)
292ConstructorDeclarationSyntax constructorDeclaration => constructorDeclaration.Modifiers.FirstOrNull() ?? constructorDeclaration.Identifier, 293ConversionOperatorDeclarationSyntax conversionOperatorDeclaration => conversionOperatorDeclaration.Modifiers.FirstOrNull() ?? conversionOperatorDeclaration.ImplicitOrExplicitKeyword, 294DelegateDeclarationSyntax delegateDeclaration => delegateDeclaration.Modifiers.FirstOrNull() ?? delegateDeclaration.DelegateKeyword, 296EnumDeclarationSyntax enumDeclaration => enumDeclaration.Modifiers.FirstOrNull() ?? enumDeclaration.EnumKeyword, 298EventDeclarationSyntax eventDeclaration => eventDeclaration.Modifiers.FirstOrNull() ?? eventDeclaration.EventKeyword, 299EventFieldDeclarationSyntax eventFieldDeclaration => eventFieldDeclaration.Modifiers.FirstOrNull() ?? eventFieldDeclaration.EventKeyword, 300FieldDeclarationSyntax fieldDeclaration => fieldDeclaration.Modifiers.FirstOrNull() ?? fieldDeclaration.Declaration.GetFirstToken(), 301IndexerDeclarationSyntax indexerDeclaration => indexerDeclaration.Modifiers.FirstOrNull() ?? indexerDeclaration.Type.GetFirstToken(), 302MethodDeclarationSyntax methodDeclaration => methodDeclaration.Modifiers.FirstOrNull() ?? methodDeclaration.ReturnType.GetFirstToken(), 303OperatorDeclarationSyntax operatorDeclaration => operatorDeclaration.Modifiers.FirstOrNull() ?? operatorDeclaration.ReturnType.GetFirstToken(), 304PropertyDeclarationSyntax propertyDeclaration => propertyDeclaration.Modifiers.FirstOrNull() ?? propertyDeclaration.Type.GetFirstToken(), 305TypeDeclarationSyntax typeDeclaration => typeDeclaration.Modifiers.FirstOrNull() ?? typeDeclaration.Keyword,
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
SyntaxTriviaListExtensions.cs (1)
21.FirstOrNull();
Microsoft.CodeAnalysis.EditorFeatures (9)
CodeActions\CodeActionEditHandlerService.cs (2)
324var navigationToken = root.GetAnnotatedTokens(NavigationAnnotation.Kind).FirstOrNull(); 333var renameToken = root.GetAnnotatedTokens(RenameAnnotation.Kind).FirstOrNull();
DocumentationComments\AbstractDocumentationCommentCommandHandler.cs (1)
160.FirstOrNull();
GoToDefinition\GoToDefinitionCommandHandler.cs (1)
94args.TextView.Selection.GetSnapshotSpansOnBuffer(subjectBuffer).FirstOrNull()?.Start ??
InlineRename\InlineRenameSession.OpenTextBufferManager.cs (1)
204.FirstOrNull(); // filter to spans that have a projection
Shared\Extensions\ITextViewExtensions.cs (1)
312textView.TextSnapshot).FirstOrNull();
TextStructureNavigation\AbstractTextStructureNavigatorProvider.TextStructureNavigator.cs (3)
178var firstChild = node.Value.ChildNodesAndTokens().FirstOrNull(); 222.FirstOrNull(); 275.FirstOrNull();
Microsoft.CodeAnalysis.Features (3)
Completion\Providers\AbstractMemberInsertingCompletionProvider.cs (1)
171var targetToken = insertionRoot.GetAnnotatedTokens(_otherAnnotation).FirstOrNull();
EmbeddedLanguages\Json\JsonParser.cs (2)
290=> GetFirstDiagnostic(token.LeadingTrivia) ?? token.Diagnostics.FirstOrNull() ?? GetFirstDiagnostic(token.TrailingTrivia); 296var diagnostic = trivia.Diagnostics.FirstOrNull();
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
Handler\References\FindUsagesLSPContext.cs (1)
119definitionId: _id, id: _id, definition.SourceSpans.FirstOrNull(),
Microsoft.CodeAnalysis.Remote.ServiceHub (1)
Services\ConvertTupleToStructCodeRefactoringProvider\RemoteConvertTupleToStructCodeRefactoringService.cs (1)
79var renamedToken = root.GetAnnotatedTokens(RenameAnnotation.Kind).FirstOrNull();
Microsoft.CodeAnalysis.VisualBasic.Features (10)
Structure\Providers\DocumentationCommentStructureProvider.vb (1)
21Dim firstCommentToken = documentationComment.ChildNodesAndTokens().FirstOrNull()
Structure\VisualBasicStructureHelpers.vb (9)
132Return If(subNewStatement.Modifiers.FirstOrNull(), subNewStatement.DeclarationKeyword) 135Return If(delegateStatement.Modifiers.FirstOrNull(), delegateStatement.DelegateKeyword) 138Return If(enumStatement.Modifiers.FirstOrNull(), enumStatement.EnumKeyword) 144Return If(eventStatement.Modifiers.FirstOrNull(), 148Return If(fieldDeclaration.Modifiers.FirstOrNull(), fieldDeclaration.Declarators.First().GetFirstToken()) 151Return If(methodStatement.Modifiers.FirstOrNull(), methodStatement.DeclarationKeyword) 154Return If(operatorStatement.Modifiers.FirstOrNull(), operatorStatement.DeclarationKeyword) 157Return If(propertyStatement.Modifiers.FirstOrNull(), propertyStatement.DeclarationKeyword) 160Return If(typeStatement.Modifiers.FirstOrNull(), typeStatement.DeclarationKeyword)
Microsoft.CodeAnalysis.Workspaces (2)
AbstractDocumentationCommentService.cs (1)
56.FirstOrNull();
Rename\ConflictEngine\MutableConflictResolution.cs (1)
149var existingRelatedLocation = RelatedLocations.Where(rl => rl.ConflictCheckSpan == location.ConflictCheckSpan && rl.DocumentId == location.DocumentId).FirstOrNull();