1 write to Expression
Microsoft.CodeAnalysis.Features (1)
IntroduceVariable\AbstractIntroduceVariableService.State.cs (1)
73Expression = await document.Document.TryGetRelevantNodeAsync<TExpressionSyntax>(textSpan, cancellationToken).ConfigureAwait(false);
30 references to Expression
Microsoft.CodeAnalysis.Features (30)
IntroduceVariable\AbstractIntroduceVariableService.cs (4)
149var blocks = GetContainingExecutableBlocks(state.Expression); 229var destination = state.Expression.GetAncestor<TTypeDeclarationSyntax>() ?? state.Document.Root; 252return new IntroduceVariableAllOccurrenceCodeAction((TService)this, state.Document, state.Options, state.Expression, allOccurrences, isConstant, isLocal, isQueryLocal); 255return new IntroduceVariableCodeAction((TService)this, state.Document, state.Options, state.Expression, allOccurrences, isConstant, isLocal, isQueryLocal);
IntroduceVariable\AbstractIntroduceVariableService.State.cs (17)
74if (Expression == null || CodeRefactoringHelpers.IsNodeUnderselected(Expression, textSpan)) 78if (IsInitializerOfConstant(document, Expression)) 83if (syntaxFacts.IsThisExpression(Expression)) 86var expressionType = Document.SemanticModel.GetTypeInfo(Expression, cancellationToken).Type; 90var containingType = Expression.AncestorsAndSelf() 103IsConstant = IsExpressionConstant(Document, Expression, _service, cancellationToken); 129var enclosingBlocks = _service.GetContainingExecutableBlocks(Expression); 149if (_service.IsInExpressionBodiedMember(Expression)) 160if (_service.IsInAutoPropertyInitializer(Expression)) 241_semanticMap ??= Document.SemanticModel.GetSemanticMap(Expression, cancellationToken); 249if (!_service.CanIntroduceVariableFor(Expression)) 254if (isSpanEmpty && Expression is TNameSyntax) 260if (Expression is TTypeSyntax and not TNameSyntax) 275return semanticFacts.CanReplaceWithRValue(Document.SemanticModel, Expression, cancellationToken); 286var syntax = Expression.GetAncestor<TSyntax>(); 292if (Expression.GetAncestorOrThis<TTypeDeclarationSyntax>() != null)
IntroduceVariable\AbstractIntroduceVariableService.State_Attribute.cs (1)
15if (!_service.IsInAttributeArgumentInitializer(Expression))
IntroduceVariable\AbstractIntroduceVariableService.State_Block.cs (1)
32var type = GetTypeSymbol(Document, Expression, cancellationToken, objectAsDefault: false);
IntroduceVariable\AbstractIntroduceVariableService.State_ConstructorInitializer.cs (2)
23if (!_service.IsInConstructorInitializer(Expression)) 37var info = Document.SemanticModel.GetTypeInfo(Expression, cancellationToken);
IntroduceVariable\AbstractIntroduceVariableService.State_Field.cs (2)
23if (!_service.IsInFieldInitializer(Expression)) 44var info = Document.SemanticModel.GetTypeInfo(Expression, cancellationToken);
IntroduceVariable\AbstractIntroduceVariableService.State_Parameter.cs (1)
20if (!_service.IsInParameterInitializer(Expression))
IntroduceVariable\AbstractIntroduceVariableService.State_Query.cs (2)
20if (!_service.IsInNonFirstQueryClause(Expression)) 31var info = Document.SemanticModel.GetTypeInfo(Expression, cancellationToken);