Exemplo n.º 1
0
 /// <summary>
 /// Constructor used by IPy declarations retrieved from the IPy engine
 /// </summary>
 internal PyCompletion(Declaration declaration, IGlyphService glyphService)
     : base(declaration.Title)
 {
     this.InsertionText = declaration.Title;
     this.Description = declaration.Description;
     this.IconSource = glyphService.GetGlyph(GetGroupFromDeclaration(declaration), GetScopeFromDeclaration(declaration));
 }
Exemplo n.º 2
0
 private StandardGlyphGroup GetGroupFromDeclaration(Declaration declaration)
 {
     switch (declaration.Type)
     {
         case Declaration.DeclarationType.Class:
             return StandardGlyphGroup.GlyphGroupClass;
         case Declaration.DeclarationType.Function:
             return StandardGlyphGroup.GlyphGroupMethod;
         case Declaration.DeclarationType.Snippet:
             return StandardGlyphGroup.GlyphCSharpExpansion;
         default:
             return StandardGlyphGroup.GlyphGroupClass;
     }
 }
Exemplo n.º 3
0
 private StandardGlyphItem GetScopeFromDeclaration(Declaration declaration)
 {
     return StandardGlyphItem.GlyphItemPublic;
 }