Exemplo n.º 1
0
        FirstUseOptimizationLoader(IThemeClassificationTypeService themeClassificationTypeService, ITextBufferFactoryService textBufferFactoryService, IRoslynDocumentationProviderFactory docFactory, IRoslynDocumentChangedService roslynDocumentChangedService)
        {
            // This method is currently only called when compiling the code so add an early test
            // that it's still working in case ImmutableArray<T> gets updated.
            ImmutableArrayUtilities <byte> .ToImmutableArray(Array.Empty <byte>());

            new FirstUseOptimization(themeClassificationTypeService, textBufferFactoryService, docFactory, roslynDocumentChangedService);
        }
Exemplo n.º 2
0
        public static MetadataReference CreateMetadataReference(this CompilerMetadataReference mdRef, IRoslynDocumentationProviderFactory docFactory)
        {
            var docProvider = docFactory.TryCreate(mdRef.Filename);

            if (mdRef.IsAssemblyReference)
            {
                return(MetadataReference.CreateFromImage(ImmutableArrayUtilities <byte> .ToImmutableArray(mdRef.Data), MetadataReferenceProperties.Assembly, docProvider, mdRef.Filename));
            }
            var moduleMetadata = ModuleMetadata.CreateFromImage(ImmutableArrayUtilities <byte> .ToImmutableArray(mdRef.Data));

            return(moduleMetadata.GetReference(docProvider, mdRef.Filename));
        }