Ejemplo n.º 1
0
 public ExtensionManager(
     IOptionService optionsService,
     IErrorReportingService errorReportingService,
     IErrorLoggerService errorLoggerService,
     List<IExtensionErrorHandler> errorHandlers)
 {
     _optionsService = optionsService;
     _errorHandlers = errorHandlers;
     _errorReportingService = errorReportingService;
     _errorLoggerService = errorLoggerService;
 }
Ejemplo n.º 2
0
 private static TestWorkspace ServiceSetup(CodeFixProvider codefix, out TestDiagnosticAnalyzerService diagnosticService, out CodeFixService fixService, out IErrorLoggerService errorLogger)
 {
     diagnosticService = new TestDiagnosticAnalyzerService(DiagnosticExtensions.GetCompilerDiagnosticAnalyzersMap());
     var fixers = SpecializedCollections.SingletonEnumerable(
         new Lazy<CodeFixProvider, CodeChangeProviderMetadata>(
         () => codefix,
         new CodeChangeProviderMetadata("Test", languages: LanguageNames.CSharp)));
     var code = @"class Program { }";
     var workspace = CSharpWorkspaceFactory.CreateWorkspaceFromFile(code);
     var logger = SpecializedCollections.SingletonEnumerable(new Lazy<IErrorLoggerService>(() => new TestErrorLogger()));
     errorLogger = logger.First().Value;
     fixService = new CodeFixService(
             diagnosticService, logger, fixers, SpecializedCollections.EmptyEnumerable<Lazy<ISuppressionFixProvider, CodeChangeProviderMetadata>>());
     return workspace;
 }