IImage GetImage(CompletionEntry entry) { switch (entry.kind) { case "property": return ClassBrowserIconService.Property; case "constructor": case "getter": case "setter": case "method": case "function": case "local function": return ClassBrowserIconService.Method; case "keyword": return ClassBrowserIconService.Keyword; case "class": return ClassBrowserIconService.Class; case "var": case "local var": return ClassBrowserIconService.LocalVariable; case "interface": return ClassBrowserIconService.Interface; case "module": return ClassBrowserIconService.Namespace; default: return null; } }
public TypeScriptCompletionItem(CompletionEntry entry, CompletionEntryDetailsProvider completionDetailsProvider) : base(entry.name) { this.entry = entry; this.completionDetailsProvider = completionDetailsProvider; Image = GetImage(entry); }
string GetDocCommentPrecededByNewLine(CompletionEntry entry) { if (String.IsNullOrEmpty(entry.docComment)) return String.Empty; return String.Format("\r\n{0}", entry.docComment); }
public TypeScriptCompletionItem(CompletionEntry entry) : base(entry.name) { this.entry = entry; Description = GetDescription(entry); Image = GetImage(entry); }
string GetDescription(CompletionEntry entry) { return String.Format( "{0}: {1}{2}", entry.name, entry.type, GetDocCommentPrecededByNewLine(entry)); }
public CompletionInfo() { entries = new CompletionEntry[0]; }