当前位置: 首页>>代码示例>>C#>>正文


C# CodeAnalysis.TouchedFileLogger类代码示例

本文整理汇总了C#中Microsoft.CodeAnalysis.TouchedFileLogger的典型用法代码示例。如果您正苦于以下问题:C# TouchedFileLogger类的具体用法?C# TouchedFileLogger怎么用?C# TouchedFileLogger使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TouchedFileLogger类属于Microsoft.CodeAnalysis命名空间,在下文中一共展示了TouchedFileLogger类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetExternalMetadataResolver

 internal override MetadataFileReferenceResolver GetExternalMetadataResolver(TouchedFileLogger touchedFiles)
 {
     // We don't log touched files atm.
     return new DesktopMetadataReferenceResolver(
         new RelativePathReferenceResolver(Arguments.ReferencePaths, Arguments.BaseDirectory),
         null,
         new GacFileResolver(GacFileResolver.Default.Architectures, CultureInfo.CurrentCulture));
 }
开发者ID:noahstein,项目名称:roslyn,代码行数:8,代码来源:Csi.cs

示例2: LoggingSourceFileResolver

 public LoggingSourceFileResolver(
     ImmutableArray<string> searchPaths,
     string baseDirectory,
     ImmutableArray<KeyValuePair<string, string>> pathMap,
     TouchedFileLogger logger)
     : base(searchPaths, baseDirectory, pathMap)
 {
     _loggerOpt = logger;
 }
开发者ID:nileshjagtap,项目名称:roslyn,代码行数:9,代码来源:CommonCompiler.LoggingSourceFileResolver.cs

示例3: GetCommandLineMetadataReferenceResolver

 internal override MetadataReferenceResolver GetCommandLineMetadataReferenceResolver(TouchedFileLogger loggerOpt)
 {
     return new RuntimeMetadataReferenceResolver(
         new RelativePathResolver(Arguments.ReferencePaths, Arguments.BaseDirectory),
         null,
         new GacFileResolver(GacFileResolver.Default.Architectures, CultureInfo.CurrentCulture),
         (path, properties) =>
         {
             loggerOpt?.AddRead(path);
             return MetadataReference.CreateFromFile(path);
         });
 }
开发者ID:redjbishop,项目名称:roslyn,代码行数:12,代码来源:Csi.cs

示例4: ExistingReferencesResolver

            public ExistingReferencesResolver(
                ImmutableArray<PortableExecutableReference> availableReferences,
                ImmutableArray<string> referencePaths,
                string baseDirectory,
                AssemblyIdentityComparer assemblyIdentityComparer,
                TouchedFileLogger logger)
                : base(referencePaths, baseDirectory, logger)
            {
                Debug.Assert(!availableReferences.Any(r => r.Properties.Kind != MetadataImageKind.Assembly));

                _availableReferences = availableReferences;
                _assemblyIdentityComparer = assemblyIdentityComparer;
            }
开发者ID:ehsansajjad465,项目名称:roslyn,代码行数:13,代码来源:CommonCompiler.ExistingReferencesResolver.cs

示例5: ResolveAnalyzersFromArguments

        internal ImmutableArray<DiagnosticAnalyzer> ResolveAnalyzersFromArguments(string language, List<DiagnosticInfo> diagnostics, CommonMessageProvider messageProvider, TouchedFileLogger touchedFiles, IAnalyzerAssemblyLoader analyzerLoader)
        {
            var builder = ImmutableArray.CreateBuilder<DiagnosticAnalyzer>();

            EventHandler<AnalyzerLoadFailureEventArgs> errorHandler = (o, e) =>
            {
                var analyzerReference = o as AnalyzerFileReference;
                DiagnosticInfo diagnostic = null;
                switch (e.ErrorCode)
                {
                    case AnalyzerLoadFailureEventArgs.FailureErrorCode.UnableToLoadAnalyzer:
                        diagnostic = new DiagnosticInfo(messageProvider, messageProvider.WRN_UnableToLoadAnalyzer, analyzerReference.FullPath, e.Message);
                        break;
                    case AnalyzerLoadFailureEventArgs.FailureErrorCode.UnableToCreateAnalyzer:
                        diagnostic = new DiagnosticInfo(messageProvider, messageProvider.WRN_AnalyzerCannotBeCreated, e.TypeName, analyzerReference.FullPath, e.Message);
                        break;
                    case AnalyzerLoadFailureEventArgs.FailureErrorCode.NoAnalyzers:
                        diagnostic = new DiagnosticInfo(messageProvider, messageProvider.WRN_NoAnalyzerInAssembly, analyzerReference.FullPath);
                        break;
                    case AnalyzerLoadFailureEventArgs.FailureErrorCode.None:
                    default:
                        return;
                }

                // Filter this diagnostic based on the compilation options so that /nowarn and /warnaserror etc. take effect.
                diagnostic = messageProvider.FilterDiagnosticInfo(diagnostic, this.CompilationOptions);

                if (diagnostic != null)
                {
                    diagnostics.Add(diagnostic);
                }
            };

            foreach (var reference in AnalyzerReferences)
            {
                var resolvedReference = ResolveAnalyzerReference(reference, analyzerLoader);
                if (resolvedReference != null)
                {
                    resolvedReference.AnalyzerLoadFailed += errorHandler;
                    resolvedReference.AddAnalyzers(builder, language);
                    resolvedReference.AnalyzerLoadFailed -= errorHandler;
                }
                else
                {
                    diagnostics.Add(new DiagnosticInfo(messageProvider, messageProvider.ERR_MetadataFileNotFound, reference.FilePath));
                }
            }

            return builder.ToImmutable();
        }
开发者ID:noahstein,项目名称:roslyn,代码行数:50,代码来源:CommonCommandLineArguments.cs

示例6: CreateCompilation

 public abstract Compilation CreateCompilation(TextWriter consoleOutput, TouchedFileLogger touchedFilesLogger, ErrorLogger errorLogger);
开发者ID:SoumikMukherjeeDOTNET,项目名称:roslyn,代码行数:1,代码来源:CommonCompiler.cs

示例7: GetExternalMetadataResolver

 internal virtual MetadataFileReferenceResolver GetExternalMetadataResolver(TouchedFileLogger touchedFiles)
 {
     return CreateLoggingMetadataResolver(touchedFiles);
 }
开发者ID:JRobertGit,项目名称:roslyn,代码行数:4,代码来源:CommonCompiler.cs

示例8: ResolveMetadataReferences

        /// <summary>
        /// Resolves metadata references stored in command line arguments and reports errors for those that can't be resolved.
        /// </summary>
        internal List<MetadataReference> ResolveMetadataReferences(
            MetadataFileReferenceResolver externalReferenceResolver,
            MetadataFileReferenceProvider metadataProvider,
            List<DiagnosticInfo> diagnostics,
            AssemblyIdentityComparer assemblyIdentityComparer,
            TouchedFileLogger touchedFiles,
            out MetadataFileReferenceResolver referenceDirectiveResolver)
        {
            List<MetadataReference> resolved = new List<MetadataReference>();
            Arguments.ResolveMetadataReferences(new AssemblyReferenceResolver(externalReferenceResolver, metadataProvider), diagnostics, this.MessageProvider, resolved);

            if (Arguments.IsInteractive)
            {
                referenceDirectiveResolver = externalReferenceResolver;
            }
            else
            {
                // when compiling into an assembly (csc/vbc) we only allow #r that match references given on command line:
                referenceDirectiveResolver = new ExistingReferencesResolver(
                    CreateLoggingMetadataResolver(touchedFiles),
                    resolved.Where(r => r.Properties.Kind == MetadataImageKind.Assembly).OfType<PortableExecutableReference>().AsImmutable(),
                    assemblyIdentityComparer);
            }

            return resolved;
        }
开发者ID:JRobertGit,项目名称:roslyn,代码行数:29,代码来源:CommonCompiler.cs

示例9: LoggingStrongNameProvider

 public LoggingStrongNameProvider(ImmutableArray<string> keyFileSearchPaths, TouchedFileLogger logger, string tempPath)
     : base(keyFileSearchPaths, tempPath)
 {
     _loggerOpt = logger;
 }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:5,代码来源:CommonCompiler.LoggingStrongNameProvider.cs

示例10: CreateLoggingMetadataResolver

 private MetadataFileReferenceResolver CreateLoggingMetadataResolver(TouchedFileLogger logger)
 {
     MetadataFileReferenceResolver resolver = new RelativePathReferenceResolver(Arguments.ReferencePaths, Arguments.BaseDirectory);
     return (logger == null) ? resolver : new LoggingMetadataReferencesResolver(resolver, logger);
 }
开发者ID:JRobertGit,项目名称:roslyn,代码行数:5,代码来源:CommonCompiler.cs

示例11: GetCommandLineMetadataReferenceResolver

 internal virtual MetadataReferenceResolver GetCommandLineMetadataReferenceResolver(TouchedFileLogger loggerOpt)
 {
     var pathResolver = new RelativePathResolver(Arguments.ReferencePaths, Arguments.BaseDirectory);
     return new LoggingMetadataFileReferenceResolver(pathResolver, GetMetadataProvider(), loggerOpt);
 }
开发者ID:SoumikMukherjeeDOTNET,项目名称:roslyn,代码行数:5,代码来源:CommonCompiler.cs

示例12: LoggingSourceFileResolver

 public LoggingSourceFileResolver(ImmutableArray<string> searchPaths, string baseDirectory, TouchedFileLogger logger)
     : base(searchPaths, baseDirectory)
 {
     _logger = logger;
 }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:5,代码来源:CommonCompiler.LoggingSourceFileResolver.cs

示例13: ResolveAnalyzersFromArguments

 protected abstract ImmutableArray<DiagnosticAnalyzer> ResolveAnalyzersFromArguments(List<DiagnosticInfo> diagnostics, CommonMessageProvider messageProvider, TouchedFileLogger touchedFiles);
开发者ID:SoumikMukherjeeDOTNET,项目名称:roslyn,代码行数:1,代码来源:CommonCompiler.cs

示例14: ResolveMetadataReferences

        /// <summary>
        /// Resolves metadata references stored in command line arguments and reports errors for those that can't be resolved.
        /// </summary>
        internal List<MetadataReference> ResolveMetadataReferences(
            MetadataReferenceResolver externalReferenceResolver,
            MetadataReferenceProvider metadataProvider,
            List<DiagnosticInfo> diagnostics,
            AssemblyIdentityComparer assemblyIdentityComparer,
            TouchedFileLogger touchedFiles,
            out MetadataReferenceResolver referenceDirectiveResolver)
        {
            using (Logger.LogBlock(FunctionId.Common_CommandLineCompiler_ResolveMetadataReferences))
            {
                List<MetadataReference> resolved = new List<MetadataReference>();
                ResolveMetadataReferencesFromArguments(externalReferenceResolver, metadataProvider, diagnostics, resolved);

                if (Arguments.IsInteractive)
                {
                    referenceDirectiveResolver = externalReferenceResolver;
                }
                else
                {
                    // when compiling into an assembly (csc/vbc) we only allow #r that match references given on command line:
                    referenceDirectiveResolver = new ExistingReferencesResolver(
                        resolved.Where(r => r.Properties.Kind == MetadataImageKind.Assembly).OfType<MetadataFileReference>().AsImmutable(),
                        Arguments.ReferencePaths,
                        Arguments.BaseDirectory,
                        assemblyIdentityComparer,
                        touchedFiles);
                }

                return resolved;
            }
        }
开发者ID:riversky,项目名称:roslyn,代码行数:34,代码来源:CommonCompiler.cs

示例15: CreateCompilation

 protected abstract Compilation CreateCompilation(TextWriter consoleOutput, TouchedFileLogger touchedFilesLogger);
开发者ID:riversky,项目名称:roslyn,代码行数:1,代码来源:CommonCompiler.cs


注:本文中的Microsoft.CodeAnalysis.TouchedFileLogger类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。