Exemplo n.º 1
0
 public bool ContainsAssemblyOrModuleOrDynamic(ISymbol symbol, bool primary)
 {
     if (_compilationWithReplacement == null)
     {
         // We don't have a compilation yet, so this couldn't have came from us
         return(false);
     }
     else
     {
         return(UnrootedSymbolSet.Create(_compilationWithReplacement).ContainsAssemblyOrModuleOrDynamic(symbol, primary));
     }
 }
Exemplo n.º 2
0
                private FinalState(
                    Compilation finalCompilation,
                    Compilation compilationWithoutGeneratedFiles,
                    bool hasSuccessfullyLoaded,
                    CompilationTrackerGeneratorInfo generatorInfo,
                    UnrootedSymbolSet unrootedSymbolSet)
                    : base(compilationWithoutGeneratedFiles,
                           generatorInfo.WithDocumentsAreFinal(true)) // when we're in a final state, we've ran generators and should not run again
                {
                    Contract.ThrowIfNull(finalCompilation);
                    HasSuccessfullyLoaded = hasSuccessfullyLoaded;
                    FinalCompilationWithGeneratedDocuments = finalCompilation;
                    UnrootedSymbolSet = unrootedSymbolSet;

                    if (this.GeneratorInfo.Documents.IsEmpty)
                    {
                        // In this case, the finalCompilationSource and compilationWithoutGeneratedFilesSource should point to the
                        // same Compilation, which should be compilationWithoutGeneratedFiles itself
                        Debug.Assert(object.ReferenceEquals(finalCompilation, compilationWithoutGeneratedFiles));
                    }
                }
Exemplo n.º 3
0
                private FinalState(
                    Compilation finalCompilation,
                    Compilation compilationWithoutGeneratedFiles,
                    bool hasSuccessfullyLoaded,
                    CompilationTrackerGeneratorInfo generatorInfo,
                    UnrootedSymbolSet unrootedSymbolSet)
                    : base(compilationWithoutGeneratedFiles,
                           generatorInfo.WithDocumentsAreFinal(true)) // when we're in a final state, we've ran generators and should not run again
                {
                    Contract.ThrowIfNull(finalCompilation);
                    HasSuccessfullyLoaded = hasSuccessfullyLoaded;
                    FinalCompilationWithGeneratedDocuments = finalCompilation;
                    UnrootedSymbolSet = unrootedSymbolSet;

                    if (this.GeneratorInfo.Documents.IsEmpty)
                    {
                        // If we have no generated files, the pre-generator compilation and post-generator compilation
                        // should be the exact same instance; that way we're not creating more compilations than
                        // necessary that would be unable to share source symbols.
                        Debug.Assert(object.ReferenceEquals(finalCompilation, compilationWithoutGeneratedFiles));
                    }
                }