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