• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# CodeAnalysis.TouchedFileLogger类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: GetCommandLineMetadataReferenceResolver

 internal override MetadataReferenceResolver GetCommandLineMetadataReferenceResolver(TouchedFileLogger loggerOpt)
 {
     return CommandLineRunner.GetMetadataReferenceResolver(Arguments, loggerOpt);
 }
开发者ID:SoumikMukherjeeDOTNET,项目名称:roslyn,代码行数:4,代码来源:Csi.cs


示例17: ResolveAnalyzersFromArguments

        internal ImmutableArray<IDiagnosticAnalyzer> ResolveAnalyzersFromArguments(List<DiagnosticInfo> diagnostics, CommonMessageProvider messageProvider, TouchedFileLogger touchedFiles)
        {
            var builder = ImmutableArray.CreateBuilder<IDiagnosticAnalyzer>();
            foreach (var reference in AnalyzerReferences)
            {
                var resolvedReference = ResolveAnalyzerReference(reference);
                if (resolvedReference != null)
                {
                    resolvedReference.AddAnalyzers(builder, diagnostics, messageProvider);
                }
                else
                {
                    diagnostics.Add(new DiagnosticInfo(messageProvider, messageProvider.ERR_MetadataFileNotFound, reference.FilePath));
                }
            }

            return builder.ToImmutable();
        }
开发者ID:modulexcite,项目名称:pattern-matching-csharp,代码行数:18,代码来源:CommonCommandLineArguments.cs


示例18: ResolveAdditionalFilesFromArguments

        protected virtual ImmutableArray<AdditionalTextFile> ResolveAdditionalFilesFromArguments(List<DiagnosticInfo> diagnostics, CommonMessageProvider messageProvider, TouchedFileLogger touchedFilesLogger)
        {
            var builder = ImmutableArray.CreateBuilder<AdditionalTextFile>();

            foreach (var file in Arguments.AdditionalFiles)
            {
                builder.Add(new AdditionalTextFile(file, this));
            }

            return builder.ToImmutableArray();
        }
开发者ID:SoumikMukherjeeDOTNET,项目名称:roslyn,代码行数:11,代码来源:CommonCompiler.cs


示例19: GetExternalMetadataResolver

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


示例20: 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(
            List<DiagnosticInfo> diagnostics,
            TouchedFileLogger touchedFiles,
            out MetadataReferenceResolver referenceDirectiveResolver)
        {
            var commandLineReferenceResolver = GetCommandLineMetadataReferenceResolver(touchedFiles);

            List<MetadataReference> resolved = new List<MetadataReference>();
            Arguments.ResolveMetadataReferences(commandLineReferenceResolver, diagnostics, this.MessageProvider, resolved);

            if (Arguments.IsScriptRunner)
            {
                referenceDirectiveResolver = commandLineReferenceResolver;
            }
            else
            {
                // when compiling into an assembly (csc/vbc) we only allow #r that match references given on command line:
                referenceDirectiveResolver = new ExistingReferencesResolver(commandLineReferenceResolver, resolved.ToImmutableArray());
            }

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# CodeAnalysis.Workspace类代码示例发布时间:2022-05-26
下一篇:
C# CodeAnalysis.TextLoader类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap