public DeclaredSymbolInfo(ISymbol symbol, string assemblyName = null)
 {
     ID           = SymbolIdService.GetIdULong(symbol);
     Name         = SymbolIdService.GetName(symbol);
     Kind         = SymbolKindText.GetSymbolKind(symbol);
     Description  = SymbolIdService.GetDisplayString(symbol);
     Glyph        = SymbolIdService.GetGlyphNumber(symbol);
     AssemblyName = assemblyName;
 }
Exemple #2
0
        private void GenerateDeclarations()
        {
            Log.Write("Declarations...");

            var lines = new List <string>();

            if (DeclaredSymbols != null)
            {
                foreach (var declaredSymbol in DeclaredSymbols
                         .OrderBy(s => SymbolIdService.GetName(s.Key))
                         .ThenBy(s => s.Value))
                {
                    lines.Add(string.Join(";",
                                          SymbolIdService.GetName(declaredSymbol.Key),                                   // symbol name
                                          declaredSymbol.Value,                                                          // 8-byte symbol ID
                                          SymbolKindText.GetSymbolKind(declaredSymbol.Key),                              // kind (e.g. "class")
                                          Markup.EscapeSemicolons(SymbolIdService.GetDisplayString(declaredSymbol.Key)), // symbol full name and signature
                                          SymbolIdService.GetGlyphNumber(declaredSymbol.Key)));                          // icon number
                }
            }

            if (OtherFiles != null)
            {
                foreach (var document in OtherFiles.OrderBy(d => d))
                {
                    lines.Add(string.Join(";",
                                          Path.GetFileName(document),
                                          SymbolIdService.GetId(document),
                                          "file",
                                          Markup.EscapeSemicolons(document),
                                          Serialization.GetIconForExtension(document)));
                }
            }

            Serialization.WriteDeclaredSymbols(ProjectDestinationFolder, lines);
        }