提交 7d15682d 编写于 作者: A Allison Chou 提交者: Ivan Basov

Changed UI (made Add higher) and fixed bug with callsites

上级 684008cb
...@@ -383,7 +383,7 @@ private SyntaxNode GetNodeContainingTargetNode(SyntaxNode matchingNode) ...@@ -383,7 +383,7 @@ private SyntaxNode GetNodeContainingTargetNode(SyntaxNode matchingNode)
if (updatedNode.IsKind(SyntaxKind.InvocationExpression)) if (updatedNode.IsKind(SyntaxKind.InvocationExpression))
{ {
var invocation = (InvocationExpressionSyntax)updatedNode; var invocation = (InvocationExpressionSyntax)updatedNode;
var semanticModel = document.GetSemanticModelAsync(cancellationToken).WaitAndGetResult(cancellationToken); var semanticModel = document.GetSemanticModelAsync(cancellationToken).WaitAndGetResult_CanCallOnBackground(cancellationToken);
var symbolInfo = semanticModel.GetSymbolInfo((InvocationExpressionSyntax)originalNode, cancellationToken); var symbolInfo = semanticModel.GetSymbolInfo((InvocationExpressionSyntax)originalNode, cancellationToken);
var isReducedExtensionMethod = false; var isReducedExtensionMethod = false;
...@@ -466,10 +466,13 @@ private SeparatedSyntaxList<ArgumentSyntax> AddNewArgumentsToList(Document docum ...@@ -466,10 +466,13 @@ private SeparatedSyntaxList<ArgumentSyntax> AddNewArgumentsToList(Document docum
{ {
if (updatedParameters[i] is AddedParameter addedParameter) if (updatedParameters[i] is AddedParameter addedParameter)
{ {
fullList.Add(SyntaxFactory.Argument( if (addedParameter.CallsiteValue != null)
seenNameEquals ? SyntaxFactory.NameColon(addedParameter.Name) : default, {
refKindKeyword: default, fullList.Add(SyntaxFactory.Argument(
expression: SyntaxFactory.ParseExpression(addedParameter.CallsiteValue))); seenNameEquals ? SyntaxFactory.NameColon(addedParameter.Name) : default,
refKindKeyword: default,
expression: SyntaxFactory.ParseExpression(addedParameter.CallsiteValue)));
}
} }
else else
{ {
......
...@@ -61,11 +61,11 @@ public async Task<ImmutableArray<ChangeSignatureCodeAction>> GetChangeSignatureC ...@@ -61,11 +61,11 @@ public async Task<ImmutableArray<ChangeSignatureCodeAction>> GetChangeSignatureC
internal ChangeSignatureResult ChangeSignature(Document document, int position, Action<string, NotificationSeverity> errorHandler, CancellationToken cancellationToken) internal ChangeSignatureResult ChangeSignature(Document document, int position, Action<string, NotificationSeverity> errorHandler, CancellationToken cancellationToken)
{ {
var context = GetContextAsync(document, position, restrictToDeclarations: false, cancellationToken: cancellationToken).WaitAndGetResult(cancellationToken); var context = GetContextAsync(document, position, restrictToDeclarations: false, cancellationToken: cancellationToken).WaitAndGetResult_CanCallOnBackground(cancellationToken);
if (context.CanChangeSignature) if (context.CanChangeSignature)
{ {
return ChangeSignatureWithContextAsync(context, cancellationToken).WaitAndGetResult(cancellationToken); return ChangeSignatureWithContextAsync(context, cancellationToken).WaitAndGetResult_CanCallOnBackground(cancellationToken);
} }
else else
{ {
...@@ -209,7 +209,7 @@ internal ChangeSignatureOptionsResult GetChangeSignatureOptions(ChangeSignatureA ...@@ -209,7 +209,7 @@ internal ChangeSignatureOptionsResult GetChangeSignatureOptions(ChangeSignatureA
var symbols = FindChangeSignatureReferencesAsync( var symbols = FindChangeSignatureReferencesAsync(
SymbolAndProjectId.Create(declaredSymbol, context.Project.Id), SymbolAndProjectId.Create(declaredSymbol, context.Project.Id),
context.Solution, cancellationToken).WaitAndGetResult(cancellationToken); context.Solution, cancellationToken).WaitAndGetResult_CanCallOnBackground(cancellationToken);
foreach (var symbol in symbols) foreach (var symbol in symbols)
{ {
......
...@@ -57,10 +57,11 @@ private void AddParameterDialog_Loaded(object sender, RoutedEventArgs e) ...@@ -57,10 +57,11 @@ private void AddParameterDialog_Loaded(object sender, RoutedEventArgs e)
private void OK_Click(object sender, RoutedEventArgs e) private void OK_Click(object sender, RoutedEventArgs e)
{ {
ViewModel.TypeName = ((IntellisenseTextBox)TypeContentControl.Content).Text;
ViewModel.ParameterName = ((IntellisenseTextBox)NameContentControl.Content).Text;
if (ViewModel.TrySubmit()) if (ViewModel.TrySubmit())
{ {
ViewModel.TypeName = ((IntellisenseTextBox)TypeContentControl.Content).Text;
ViewModel.ParameterName = ((IntellisenseTextBox)NameContentControl.Content).Text;
DialogResult = true; DialogResult = true;
} }
} }
......
...@@ -277,36 +277,33 @@ ...@@ -277,36 +277,33 @@
Width="16" Width="16"
Moniker="{x:Static imagecatalog:KnownMonikers.MoveDown}" Moniker="{x:Static imagecatalog:KnownMonikers.MoveDown}"
Grayscale="{Binding IsEnabled, ElementName=DownButton, Converter={StaticResource NegateBooleanConverter}}"/> Grayscale="{Binding IsEnabled, ElementName=DownButton, Converter={StaticResource NegateBooleanConverter}}"/>
</vs:DialogButton> </vs:DialogButton>
<vs:DialogButton <vs:DialogButton
Name="RemoveButton" Name="AddButton"
Margin="9 29 0 0" Margin="9 29 0 0"
AutomationProperties.Name="{Binding AddAutomationText}"
Click="Add_Click"
AutomationProperties.AutomationId="AddButton"
Content="{Binding ElementName=dialog, Path=Add}"
Height="Auto" Width="Auto"/>
<vs:DialogButton
Name="RemoveButton"
Margin="9 9 0 0"
IsEnabled="{Binding CanRemove, Mode=OneWay}" IsEnabled="{Binding CanRemove, Mode=OneWay}"
AutomationProperties.Name="{Binding RemoveAutomationText}" AutomationProperties.Name="{Binding RemoveAutomationText}"
Click="Remove_Click" Click="Remove_Click"
AutomationProperties.AutomationId="RemoveButton" AutomationProperties.AutomationId="RemoveButton"
Content="{Binding ElementName=dialog, Path=Remove}" Content="{Binding ElementName=dialog, Path=Remove}"
Height="Auto" Width="Auto"> Height="Auto" Width="Auto"/>
</vs:DialogButton>
<vs:DialogButton <vs:DialogButton
Name="RestoreButton" Name="RestoreButton"
Margin="9 9 0 0" Margin="9 29 0 0"
IsEnabled="{Binding CanRestore, Mode=OneWay}" IsEnabled="{Binding CanRestore, Mode=OneWay}"
Click="Restore_Click" Click="Restore_Click"
AutomationProperties.AutomationId="RestoreButton" AutomationProperties.AutomationId="RestoreButton"
AutomationProperties.Name="{Binding RestoreAutomationText}" AutomationProperties.Name="{Binding RestoreAutomationText}"
Content="{Binding ElementName=dialog, Path=Restore}" Content="{Binding ElementName=dialog, Path=Restore}"
Height="Auto" Width="Auto"/> Height="Auto" Width="Auto"/>
<vs:DialogButton
Margin="9 29 0 0"
AutomationProperties.Name="{Binding AddAutomationText}"
Click="Add_Click"
AutomationProperties.AutomationId="AddButton"
Content="{Binding ElementName=dialog, Path=Add}"
Height="Auto" Width="Auto"/>
</StackPanel> </StackPanel>
</Grid> </Grid>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册