protected BaseCodeActionService(
            OmniSharpWorkspace workspace,
            IEnumerable <ICodeActionProvider> providers,
            ILogger logger,
            ICsDiagnosticWorker diagnostics,
            CachingCodeFixProviderForProjects codeFixesForProject)
        {
            Workspace                       = workspace;
            Providers                       = providers;
            Logger                          = logger;
            _diagnostics                    = diagnostics;
            _codeFixesForProject            = codeFixesForProject;
            OrderedCodeRefactoringProviders = new Lazy <List <CodeRefactoringProvider> >(() => GetSortedCodeRefactoringProviders());

            // Sadly, the CodeAction.NestedCodeActions property is still internal.
            var nestedCodeActionsProperty = typeof(CodeAction).GetProperty("NestedCodeActions", BindingFlags.NonPublic | BindingFlags.Instance);

            if (nestedCodeActionsProperty == null)
            {
                throw new InvalidOperationException("Could not find CodeAction.NestedCodeActions property.");
            }

            this._getNestedCodeActions = nestedCodeActionsProperty.GetGetMethod(nonPublic: true);

            if (this._getNestedCodeActions == null)
            {
                throw new InvalidOperationException("Could not retrieve 'get' method for CodeAction.NestedCodeActions property.");
            }
        }
예제 #2
0
 public CodeCheckService(
     OmniSharpWorkspace workspace,
     ILoggerFactory loggerFactory,
     OmniSharpOptions options,
     ICsDiagnosticWorker diagWorker)
 {
     _diagWorker = diagWorker;
     _logger     = loggerFactory.CreateLogger <CodeCheckService>();
 }
예제 #3
0
 public GetFixAllCodeActionService(
     OmniSharpWorkspace workspace,
     [ImportMany] IEnumerable <ICodeActionProvider> providers,
     ILoggerFactory loggerFactory,
     ICsDiagnosticWorker diagnostics,
     CachingCodeFixProviderForProjects codeFixesForProject
     ) : base(workspace, providers, loggerFactory.CreateLogger <GetFixAllCodeActionService>(), diagnostics, codeFixesForProject)
 {
 }
 public RunCodeActionService(
     IAssemblyLoader loader,
     OmniSharpWorkspace workspace,
     CodeActionHelper helper,
     [ImportMany] IEnumerable <ICodeActionProvider> providers,
     ILoggerFactory loggerFactory,
     ICsDiagnosticWorker diagnostics,
     CachingCodeFixProviderForProjects codeFixesForProjects)
     : base(workspace, providers, loggerFactory.CreateLogger <RunCodeActionService>(), diagnostics, codeFixesForProjects)
 {
     _loader            = loader;
     _workspaceAssembly = _loader.LazyLoad(Configuration.RoslynWorkspaces);
 }
예제 #5
0
 protected BaseCodeActionService(
     OmniSharpWorkspace workspace,
     IEnumerable <ICodeActionProvider> providers,
     ILogger logger,
     ICsDiagnosticWorker diagnostics,
     CachingCodeFixProviderForProjects codeFixesForProject)
 {
     Workspace                       = workspace;
     Providers                       = providers;
     Logger                          = logger;
     _diagnostics                    = diagnostics;
     _codeFixesForProject            = codeFixesForProject;
     OrderedCodeRefactoringProviders = new Lazy <List <CodeRefactoringProvider> >(() => GetSortedCodeRefactoringProviders());
 }
 public RunFixAllCodeActionService(ICsDiagnosticWorker diagnosticWorker,
                                   [ImportMany] IEnumerable <ICodeActionProvider> providers,
                                   CachingCodeFixProviderForProjects codeFixProvider,
                                   OmniSharpWorkspace workspace,
                                   ILoggerFactory loggerFactory) :
     base(
         workspace,
         providers,
         loggerFactory.CreateLogger <RunFixAllCodeActionService>(),
         diagnosticWorker,
         codeFixProvider)
 {
     _logger = loggerFactory.CreateLogger <RunFixAllCodeActionService>();
     _fixAllDiagnosticProvider = new FixAllDiagnosticProvider(diagnosticWorker);
 }
 public CsharpDiagnosticWorkerComposer(
     OmniSharpWorkspace workspace,
     [ImportMany] IEnumerable <ICodeActionProvider> providers,
     ILoggerFactory loggerFactory,
     DiagnosticEventForwarder forwarder,
     OmniSharpOptions options)
 {
     if (options.RoslynExtensionsOptions.EnableAnalyzersSupport)
     {
         _implementation = new CSharpDiagnosticWorkerWithAnalyzers(workspace, providers, loggerFactory, forwarder, options);
     }
     else
     {
         _implementation = new CSharpDiagnosticWorker(workspace, forwarder, loggerFactory);
     }
 }
 public DiagnosticsService(DiagnosticEventForwarder forwarder, ICsDiagnosticWorker diagWorker)
 {
     _forwarder  = forwarder;
     _diagWorker = diagWorker;
 }
예제 #9
0
 public ReAnalyzeService(ICsDiagnosticWorker diagWorker, OmniSharpWorkspace workspace, ILoggerFactory loggerFactory)
 {
     _diagWorker = diagWorker;
     _workspace  = workspace;
     _logger     = loggerFactory.CreateLogger <ReAnalyzeService>();
 }
 public FixAllDiagnosticProvider(ICsDiagnosticWorker diagnosticWorker)
 {
     _diagnosticWorker = diagnosticWorker;
 }