コード例 #1
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());

            // 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)
 {
 }
コード例 #4
0
 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());
 }
コード例 #6
0
 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);
 }
コード例 #7
0
 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);
     }
 }
コード例 #8
0
 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>();
 }
コード例 #10
0
 public FixAllDiagnosticProvider(ICsDiagnosticWorker diagnosticWorker)
 {
     _diagnosticWorker = diagnosticWorker;
 }