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