Exemple #1
0
        private async Task <RunCodeActionResponse> RunRefactoringsAsync(string source, string identifier, bool wantsChanges = false)
        {
            var request = CreateRunCodeActionRequest(source, identifier, wantsChanges);

            _host      = _host ?? TestHelpers.CreatePluginHost(new[] { typeof(RoslynCodeActionProvider).GetTypeInfo().Assembly, typeof(NRefactoryCodeActionProvider).GetTypeInfo().Assembly, typeof(GetCodeActionsService).GetTypeInfo().Assembly });
            _workspace = _workspace ?? await TestHelpers.CreateSimpleWorkspace(_host, request.Buffer, bufferPath);

            var controller = new RunCodeActionService(_workspace, new ICodeActionProvider[] { new RoslynCodeActionProvider(), new NRefactoryCodeActionProvider() }, new FakeLoggerFactory());
            var response   = await controller.Handle(request);

            return(response);
        }
        private async Task <RunCodeActionResponse> RunRefactoringsAsync(
            string source,
            string identifier,
            bool wantsChanges = false)
        {
            var request   = CreateRunCodeActionRequest(source, identifier, wantsChanges);
            var workspace = await GetOmniSharpWorkspace(request);

            var codeActions = CreateCodeActionProviders();

            var controller = new RunCodeActionService(workspace, codeActions, _fixture.FakeLoggerFactory);
            var response   = await controller.Handle(request);

            return(response);
        }
 private async Task<RunCodeActionResponse> RunRefactoringsAsync(string source, string identifier, bool wantsChanges = false)
 {
     var request = CreateRunCodeActionRequest(source, identifier, wantsChanges);
     _host = _host ?? TestHelpers.CreatePluginHost(new[] { typeof(RoslynCodeActionProvider).GetTypeInfo().Assembly, typeof(NRefactoryCodeActionProvider).GetTypeInfo().Assembly, typeof(GetCodeActionsService).GetTypeInfo().Assembly });
     _workspace = _workspace ?? await TestHelpers.CreateSimpleWorkspace(_host, request.Buffer, bufferPath);
     var controller = new RunCodeActionService(_workspace, new ICodeActionProvider[] { new RoslynCodeActionProvider(), new NRefactoryCodeActionProvider() }, new FakeLoggerFactory());
     var response = await controller.Handle(request);
     return response;
 }