internal static ChangeSignatureOptionsResult?GetChangeSignatureOptions(ChangeSignatureAnalysisSucceededContext context)
        {
            var changeSignatureOptionsService = context.Solution.Workspace.Services.GetRequiredService <IChangeSignatureOptionsService>();

            return(changeSignatureOptionsService.GetChangeSignatureOptions(
                       context.Document, context.InsertPosition, context.Symbol, context.ParameterConfiguration));
        }
Ejemplo n.º 2
0
 public ChangeSignatureCodeAction(
     AbstractChangeSignatureService changeSignatureService,
     ChangeSignatureAnalysisSucceededContext context
     )
 {
     _changeSignatureService = changeSignatureService;
     _context = context;
 }
        private ChangeSignatureResult ChangeSignatureWithContext(ChangeSignatureAnalysisSucceededContext context, CancellationToken cancellationToken)
        {
            var options = GetChangeSignatureOptions(context);

            if (options == null)
            {
                return(new ChangeSignatureResult(succeeded: false));
            }

            return(ChangeSignatureWithContext(context, options, cancellationToken));
        }
        internal ChangeSignatureResult ChangeSignatureWithContext(ChangeSignatureAnalysisSucceededContext context, ChangeSignatureOptionsResult options, CancellationToken cancellationToken)
        {
            var succeeded = TryCreateUpdatedSolution(context, options, cancellationToken, out var updatedSolution);

            return(new ChangeSignatureResult(succeeded, updatedSolution, context.Symbol.ToDisplayString(), context.Symbol.GetGlyph(), options.PreviewChanges));
        }