internal void AddXSharpKeywords(XCompletionList compList, string startWith) { foreach (var kw in XSharpSyntax.GetKeywords().Where(ti => nameStartsWith(ti.Name, startWith))) { ImageSource icon = _glyphService.GetGlyph(kw.getGlyphGroup(), kw.getGlyphItem()); compList.Add(new XSCompletion(kw.Name, kw.Name, kw.Prototype, icon, null, Kind.Keyword, "")); } }
internal void AddXSharpKeywordTypeNames(XCompletionList compList, string startWith) { // int startLen = 0; int dotPos = startWith.LastIndexOf('.'); if (dotPos != -1) { startLen = dotPos + 1; } // // And our own Types var xsharpTypes = XSharpSyntax.GetTypes(); foreach (var typeInfo in xsharpTypes.Where(ti => nameStartsWith(ti.Name, startWith))) { string realTypeName = typeInfo.FullName; // remove the start if (startLen > 0) { realTypeName = realTypeName.Substring(startLen); } // Do we have another part dotPos = realTypeName.IndexOf('.'); // Then remove it if (dotPos > 0) { realTypeName = realTypeName.Substring(0, dotPos); } ImageSource icon = _glyphService.GetGlyph(typeInfo.getGlyphGroup(), typeInfo.getGlyphItem()); if (!compList.Add(new XSCompletion(realTypeName, realTypeName, typeInfo.Prototype, icon, null, Kind.Class, ""))) { break; } } }