1 write to Expression
Microsoft.CodeAnalysis.Features (1)
IntroduceVariable\AbstractIntroduceVariableService.State.cs (1)
67Expression = await document.Document.TryGetRelevantNodeAsync<TExpressionSyntax>(textSpan, cancellationToken).ConfigureAwait(false);
31 references to Expression
Microsoft.CodeAnalysis.Features (31)
IntroduceVariable\AbstractIntroduceVariableService.cs (3)
148var blocks = GetContainingExecutableBlocks(state.Expression); 235var destination = state.Expression.GetAncestor<TTypeDeclarationSyntax>() ?? state.Document.Root; 255=> new((TService)this, state.Document, state.Options, state.Expression, allOccurrences, isConstant, isLocal, isQueryLocal);
IntroduceVariable\AbstractIntroduceVariableService.State.cs (19)
68if (Expression == null || CodeRefactoringHelpers.IsNodeUnderselected(Expression, textSpan)) 72if (IsInitializerOfConstant(document, Expression)) 77if (syntaxFacts.IsThisExpression(Expression)) 80var expressionType = Document.SemanticModel.GetTypeInfo(Expression, cancellationToken).Type; 86!Document.SemanticModel.GetConstantValue(Expression, cancellationToken).HasValue) 91var containingType = Expression.AncestorsAndSelf() 106var globalStatement = Expression.AncestorsAndSelf().FirstOrDefault(syntaxFacts.IsGlobalStatement); 116IsConstant = IsExpressionConstant(Document, Expression, _service, cancellationToken); 142var enclosingBlocks = _service.GetContainingExecutableBlocks(Expression); 162if (_service.IsInExpressionBodiedMember(Expression)) 173if (_service.IsInAutoPropertyInitializer(Expression)) 254_semanticMap ??= Document.SemanticModel.GetSemanticMap(Expression, cancellationToken); 262if (!_service.CanIntroduceVariableFor(Expression)) 267if (isSpanEmpty && Expression is TNameSyntax) 273if (Expression is TTypeSyntax and not TNameSyntax) 288return semanticFacts.CanReplaceWithRValue(Document.SemanticModel, Expression, cancellationToken); 299var syntax = Expression.GetAncestor<TSyntax>(); 305if (Expression.GetAncestorOrThis<TTypeDeclarationSyntax>() != null)
IntroduceVariable\AbstractIntroduceVariableService.State_Attribute.cs (1)
13if (!_service.IsInAttributeArgumentInitializer(Expression))
IntroduceVariable\AbstractIntroduceVariableService.State_Block.cs (1)
29var type = GetTypeSymbol(Document, Expression, cancellationToken, objectAsDefault: false);
IntroduceVariable\AbstractIntroduceVariableService.State_ConstructorInitializer.cs (2)
21if (!_service.IsInConstructorInitializer(Expression)) 35var info = Document.SemanticModel.GetTypeInfo(Expression, cancellationToken);
IntroduceVariable\AbstractIntroduceVariableService.State_Field.cs (2)
21if (!_service.IsInFieldInitializer(Expression)) 42var info = Document.SemanticModel.GetTypeInfo(Expression, cancellationToken);
IntroduceVariable\AbstractIntroduceVariableService.State_Parameter.cs (1)
18if (!_service.IsInParameterInitializer(Expression))
IntroduceVariable\AbstractIntroduceVariableService.State_Query.cs (2)
18if (!_service.IsInNonFirstQueryClause(Expression)) 29var info = Document.SemanticModel.GetTypeInfo(Expression, cancellationToken);