public async Task <ChangeSignatureResult> ChangeSignatureAsync()
        {
            var context = await ChangeSignatureService.GetChangeSignatureContextAsync(InvocationDocument, _testDocument.CursorPosition.Value, restrictToDeclarations : false, Workspace.GlobalOptions.CreateProvider(), CancellationToken.None).ConfigureAwait(false);

            var options = AbstractChangeSignatureService.GetChangeSignatureOptions(context);

            return(await ChangeSignatureService.ChangeSignatureWithContextAsync(context, options, CancellationToken.None));
        }
Ejemplo n.º 2
0
        public async Task <ParameterConfiguration> GetParameterConfigurationAsync()
        {
            WpfTestRunner.RequireWpfFact($"{nameof(AbstractChangeSignatureService.ChangeSignature)} currently needs to run on a WPF Fact because it's factored in a way that tries popping up UI in some cases.");

            var context = await ChangeSignatureService.GetContextAsync(InvocationDocument, _testDocument.CursorPosition.Value, restrictToDeclarations : false, CancellationToken.None);

            return(context.ParameterConfiguration);
        }
        public async Task <ParameterConfiguration> GetParameterConfigurationAsync()
        {
            var context = await ChangeSignatureService.GetChangeSignatureContextAsync(InvocationDocument, _testDocument.CursorPosition.Value, restrictToDeclarations : false, Workspace.GlobalOptions.CreateProvider(), CancellationToken.None);

            if (context is ChangeSignatureAnalysisSucceededContext changeSignatureAnalyzedSucceedContext)
            {
                return(changeSignatureAnalyzedSucceedContext.ParameterConfiguration);
            }

            throw Roslyn.Utilities.ExceptionUtilities.UnexpectedValue(((CannotChangeSignatureAnalyzedContext)context).CannotChangeSignatureReason.ToString());
        }
Ejemplo n.º 4
0
 public ChangeSignatureResult ChangeSignature()
 {
     return(ChangeSignatureService.ChangeSignature(
                InvocationDocument,
                _testDocument.CursorPosition.Value,
                (errorMessage, severity) =>
     {
         this.ErrorMessage = errorMessage;
         this.ErrorSeverity = severity;
     },
                CancellationToken.None));
 }
        public async Task <ParameterConfiguration> GetParameterConfigurationAsync()
        {
            WpfTestRunner.RequireWpfFact($"{nameof(AbstractChangeSignatureService.ChangeSignature)} currently needs to run on a WPF Fact because it's factored in a way that tries popping up UI in some cases.");

            var context = await ChangeSignatureService.GetContextAsync(InvocationDocument, _testDocument.CursorPosition.Value, restrictToDeclarations : false, CancellationToken.None);

            if (context is ChangeSignatureAnalysisSucceededContext changeSignatureAnalyzedSucceedContext)
            {
                return(changeSignatureAnalyzedSucceedContext.ParameterConfiguration);
            }

            throw Roslyn.Utilities.ExceptionUtilities.UnexpectedValue(((CannotChangeSignatureAnalyzedContext)context).CannotChangeSignatureReason.ToString());
        }
        public ChangeSignatureResult ChangeSignature()
        {
            WpfTestRunner.RequireWpfFact($"{nameof(AbstractChangeSignatureService.ChangeSignature)} currently needs to run on a WPF Fact because it's factored in a way that tries popping up UI in some cases.");

            return(ChangeSignatureService.ChangeSignature(
                       InvocationDocument,
                       _testDocument.CursorPosition.Value,
                       (errorMessage, severity) =>
            {
                this.ErrorMessage = errorMessage;
                this.ErrorSeverity = severity;
            },
                       CancellationToken.None));
        }