private string ProcessSnippetFunction(CodeSnippetDeclaration d) { // This item is obfuscated and can not be translated. if (!Regex.IsMatch(d.get_Function().Trim(), @"ClassName\s*\(\s*\)", RegexOptions.IgnoreCase)) { Match match = Regex.Match(d.get_Function().Trim(), @"SimpleTypeName\s*\((.*)\)", RegexOptions.IgnoreCase); if (match.Success) { string str2 = match.Groups[1].Value.Trim(); if (str2.StartsWith("global::")) { str2 = str2.Substring("global::".Length); } return(str2); } if (d.get_Function().Trim() == "DateTime.Now.Year") { return(DateTime.Now.Year.ToString()); } if (d.get_Function().Trim() == "DateTime.Now.Month") { return(DateTime.Now.Month.ToString()); } if (d.get_Function().Trim() == "DateTime.Now.Day") { return(DateTime.Now.Day.ToString()); } return(null); } SemanticParserService.WaitForParse(SemanticParserServiceRequest.GetParseHashKey(base.get_Document(), base.get_Document()), 0x7d0); IAstNode node = base.get_Document().get_SemanticParseData() as IAstNode; if (node != null) { for (IAstNode node2 = node.FindNodeRecursive(base.get_Caret().get_Offset()); node2 == null; node2 = node2.get_ParentNode()) { Label_0065: if (0 == 0) { if (node2 != null) { return(((ClassDeclaration)node2).get_FullName().Split(new char[] { '.', '+' }).Last <string>()); } goto Label_00B6; } } goto Label_0065; } Label_00B6: return(null); }
/// <summary> /// Creates a VB.Net CodeRoot from the result of the semantic parse. /// </summary> /// <param name="request">The <see cref="SemanticParserServiceRequest"/> that contains the parse results.</param> private void CreateCodeRoot(SemanticParserServiceRequest request) { try { if (request == null) throw new ArgumentNullException("request"); // Reset the formatter. formatter = new VBCodeFormatter(document, formatSettings, controller); // Load the document outline CompilationUnit compilationUnit = request.SemanticParseData as CompilationUnit; if (compilationUnit == null) { throw new InvalidOperationException( "The Actipro parser did not return a CompilationUnit object. Unable to process this file."); } foreach (object obj in compilationUnit.SyntaxErrors) { SyntaxError error = (SyntaxError)obj; int lineNumber = document.OffsetToPosition(error.TextRange.StartOffset).Line; ParserSyntaxError pse = new ParserSyntaxError(error.Message, error.TextRange.StartOffset, error.TextRange.Length, lineNumber, currentFilename, document.GetSubstring(error.TextRange)); syntaxErrors.Add(pse); } // Create region objects before handling AST. CreateRegions(compilationUnit); ProcessNode(compilationUnit, compilationUnit); //PostProcessComments(); FixParentReferences(); } catch (ParserException e) { exceptionThrown = e; } catch (Exception e) { exceptionThrown = new ParserException("An exception as thrown during parsing", e); } }
/// <summary> /// Occurs when a semantic parse request is completed. /// </summary> /// <param name="request">A <see cref="T:ActiproSoftware.SyntaxEditor.SemanticParserServiceRequest" /> /// that contains the semantic parse request information and the parse data result.</param> public void NotifySemanticParseComplete(SemanticParserServiceRequest request) { // Call this on a new thread so we don't block the ActiproParserService thread while we do our processing. Thread thread = new Thread(new ThreadStart(delegate { try { CreateCodeRoot(request); } catch (ParserException e) { ExceptionThrown = e; } finally { parseFinished = true; parseWaitHandle.Set(); } })); thread.Start(); }
/// <summary> /// Parses the given code asynchronously and creates a VB.Net CodeRoot from it. /// </summary> /// <param name="filename">The name of the file being parsed. Informational use only.</param> /// <param name="code">The code to parse</param> /// <returns>A WaitHandle that will be signalled when the code is parsed and /// the CodeRoot is ready for use.</returns> public WaitHandle ParseCodeAsync(string filename, string code) { Reset(); parseWaitHandle.Reset(); parseFinished = false; parserGuid = Guid.NewGuid(); ISemanticParserServiceProcessor language = new VBSyntaxLanguage(); // This is needed because the Actipro parser calculates the text offsets of parsed elements // by using /r/n for line breaks (on my windows machine) even if the original text had a /r or /n. // This manifests itself as a bunch of wierd Expressions, all type names, some variable names, and // various other elements will have completely the wrong text. The number of characters in the final // output is correct though. document = new Document(); document.Text = Helper.StandardizeLineBreaks(code, Helper.LineBreaks.Windows); if (SemanticParserService.IsRunning == false) SemanticParserService.Start(); else if (SemanticParserService.IsBusy) { SemanticParserService.Stop(); SemanticParserService.Start(); } // Make a request to the parser service (runs in a separate thread). SemanticParserServiceRequest request = new SemanticParserServiceRequest( SemanticParserServiceRequest.MediumPriority, document, new ActiproSoftware.SyntaxEditor.TextRange(0, document.Length), SemanticParseFlags.None, language, this ); SemanticParserService.Parse(request); return parseWaitHandle; }
/// <summary> /// Provides the core functionality to show an IntelliPrompt member list based on the current context in a <see cref="SyntaxEditor"/>. /// </summary> /// <param name="language">The <see cref="DotNetLanguage"/> to use for quick info formatting.</param> /// <param name="syntaxEditor">The <see cref="SyntaxEditor"/> that will display the IntelliPrompt member list.</param> /// <param name="completeWord">Whether to complete the word.</param> /// <returns> /// <c>true</c> if an auto-complete occurred or if a IntelliPrompt member list is displayed; otherwise, <c>false</c>. /// </returns> internal bool ShowIntelliPromptMemberList(DotNetLanguage language, SyntaxEditor syntaxEditor, SyntaxEditor toEditor, bool completeWord, string parameterName) { // Try and ensure the compilation unit is up-to-date SemanticParserService.WaitForParse(SemanticParserServiceRequest.GetParseHashKey(syntaxEditor.Document, syntaxEditor.Document)); // Get the context //DotNetContext context = this.GetContext(syntaxEditor, syntaxEditor.Caret.Offset, true, false); DotNetContext context = this.GetContext(syntaxEditor, syntaxEditor.Document.GetText(LineTerminator.Newline).Length - 1, true, false); // Initialize the member list IntelliPromptMemberList memberList = toEditor.IntelliPrompt.MemberList;// syntaxEditor.IntelliPrompt.MemberList; memberList.ResetAllowedCharacters(); memberList.Clear(); memberList.ImageList = SyntaxEditor.ReflectionImageList; memberList.Context = context; // GFH if (completeWord && context.InitializationTextRange.StartOffset >= 0) { string partialWord = syntaxEditor.Document.GetText(LineTerminator.Newline).Substring(context.InitializationTextRange.StartOffset, context.InitializationTextRange.Length); if (parameterName.StartsWith(partialWord)) { memberList.Add(new IntelliPromptMemberListItem(parameterName, (int)ActiproSoftware.Products.SyntaxEditor.IconResource.PrivateProperty)); } } // Get the member list items Hashtable memberListItemHashtable = new Hashtable(); switch (context.Type) { case DotNetContextType.AnyCode: // Fill with everything if (context.ProjectResolver != null) { // Fill with child namespace names in the global and imported namespaces //context.ProjectResolver.AddMemberListItemsForChildNamespaces(memberListItemHashtable, null); //foreach (string namespaceName in context.ImportedNamespaces) // context.ProjectResolver.AddMemberListItemsForChildNamespaces(memberListItemHashtable, namespaceName); //// Fill with the types in the global and imported namespaces //context.ProjectResolver.AddMemberListItemsForTypes(memberListItemHashtable, context.TypeDeclarationNode, null, DomBindingFlags.Default, true); //foreach (string namespaceName in context.ImportedNamespaces) // context.ProjectResolver.AddMemberListItemsForTypes(memberListItemHashtable, context.TypeDeclarationNode, namespaceName, DomBindingFlags.Default, true); // Fill with static members of parent types if ((context.TypeDeclarationNode != null) && (context.TypeDeclarationNode.DeclaringType is IDomType)) { context.ProjectResolver.AddMemberListItemsForDeclaringTypeMembers(memberListItemHashtable, context.TypeDeclarationNode, (IDomType)context.TypeDeclarationNode.DeclaringType, DomBindingFlags.Static | DomBindingFlags.AllAccessTypes); } // Fill with nested types if (context.TypeDeclarationNode != null) { context.ProjectResolver.AddMemberListItemsForNestedTypes(memberListItemHashtable, context.TypeDeclarationNode, context.TypeDeclarationNode, DomBindingFlags.Default, true); } // Fill with members if in a member (pay attention to if member is instance or static) if (context.TypeDeclarationNode != null) { if (context.MemberDeclarationNode != null) { if (!((IDomMember)context.MemberDeclarationNode).IsStatic) { // Fill with extension methods context.ProjectResolver.AddMemberListItemsForExtensionMethods(memberListItemHashtable, context, context.TypeDeclarationNode, DomBindingFlags.Instance | context.AdditionalBindingFlags | DomBindingFlags.AllAccessTypes); } // Fill with members context.ProjectResolver.AddMemberListItemsForMembers(memberListItemHashtable, context.TypeDeclarationNode, context.TypeDeclarationNode, (this.LanguageType == DotNetLanguage.CSharp ? DomBindingFlags.ExcludeIndexers : DomBindingFlags.None) | DomBindingFlags.Static | (((IDomMember)context.MemberDeclarationNode).IsStatic ? DomBindingFlags.None : DomBindingFlags.Instance) | context.AdditionalBindingFlags | DomBindingFlags.AllAccessTypes); } else { // Not within a member so fill with static members context.ProjectResolver.AddMemberListItemsForMembers(memberListItemHashtable, context.TypeDeclarationNode, context.TypeDeclarationNode, (this.LanguageType == DotNetLanguage.CSharp ? DomBindingFlags.ExcludeIndexers : DomBindingFlags.None) | DomBindingFlags.Static | context.AdditionalBindingFlags | DomBindingFlags.AllAccessTypes); } } // Fill with variables defined in the scope context.ProjectResolver.AddMemberListItemsForVariables(memberListItemHashtable, context); // Fill with language keywords //this.AddKeywordMemberListItems(memberListItemHashtable); // Fill with code snippets if (this.CodeSnippetsEnabled) { context.ProjectResolver.AddMemberListItemsForCodeSnippets(memberListItemHashtable); } } break; case DotNetContextType.BaseAccess: // If the context is in an instance member declaration... if ((context.ProjectResolver != null) && (context.MemberDeclarationNode != null) && (!((IDomMember)context.MemberDeclarationNode).IsStatic)) { if (context.TargetItem.Type == DotNetContextItemType.Base) { // Fill with extension methods context.ProjectResolver.AddMemberListItemsForExtensionMethods(memberListItemHashtable, context, (IDomType)context.TargetItem.ResolvedInfo, DomBindingFlags.Instance | context.AdditionalBindingFlags | DomBindingFlags.Public | DomBindingFlags.Family | DomBindingFlags.Assembly); // Fill with instance type members context.ProjectResolver.AddMemberListItemsForMembers(memberListItemHashtable, context.TypeDeclarationNode, (IDomType)context.TargetItem.ResolvedInfo, (this.LanguageType == DotNetLanguage.CSharp ? DomBindingFlags.ExcludeIndexers : DomBindingFlags.None) | DomBindingFlags.Instance | context.AdditionalBindingFlags | DomBindingFlags.Public | DomBindingFlags.Family | DomBindingFlags.Assembly); } } break; case DotNetContextType.DocumentationCommentTag: // Add tags if (context.ProjectResolver != null) { context.ProjectResolver.AddMemberListItemsForDocumentationComments(memberListItemHashtable, context, (syntaxEditor.Caret.Offset > 0) && (syntaxEditor.Document[syntaxEditor.Caret.Offset - 1] != '<')); } break; case DotNetContextType.AsType: case DotNetContextType.IsTypeOfType: case DotNetContextType.TryCastType: case DotNetContextType.TypeOfType: if (context.ProjectResolver != null) { if (context.TargetItem != null) { switch (context.TargetItem.Type) { case DotNetContextItemType.Namespace: case DotNetContextItemType.NamespaceAlias: // Fill with child namespaces and types context.ProjectResolver.AddMemberListItemsForChildNamespaces(memberListItemHashtable, context.TargetItem.ResolvedInfo.ToString()); context.ProjectResolver.AddMemberListItemsForTypes(memberListItemHashtable, context.TypeDeclarationNode, context.TargetItem.ResolvedInfo.ToString(), DomBindingFlags.Default, false); break; case DotNetContextItemType.Type: // Fill with nested types context.ProjectResolver.AddMemberListItemsForNestedTypes(memberListItemHashtable, context.TypeDeclarationNode, (IDomType)context.TargetItem.ResolvedInfo, DomBindingFlags.Default, false); break; } } else { // VB requires New added for As specifications if ((context.Type == DotNetContextType.AsType) && (language == DotNetLanguage.VB)) { memberListItemHashtable["New"] = new IntelliPromptMemberListItem("New", (int)ActiproSoftware.Products.SyntaxEditor.IconResource.Keyword); } // Fill with native types context.ProjectResolver.AddMemberListItemsForNativeTypes(language, memberListItemHashtable, context); // Fill with child namespace names in the global and imported namespaces context.ProjectResolver.AddMemberListItemsForChildNamespaces(memberListItemHashtable, null); foreach (string namespaceName in context.ImportedNamespaces) { context.ProjectResolver.AddMemberListItemsForChildNamespaces(memberListItemHashtable, namespaceName); } // Fill with the types in the imported namespaces context.ProjectResolver.AddMemberListItemsForTypes(memberListItemHashtable, context.TypeDeclarationNode, null, DomBindingFlags.Default, false); foreach (string namespaceName in context.ImportedNamespaces) { context.ProjectResolver.AddMemberListItemsForTypes(memberListItemHashtable, context.TypeDeclarationNode, namespaceName, DomBindingFlags.Default, false); } // Fill with nested types if (context.TypeDeclarationNode != null) { context.ProjectResolver.AddMemberListItemsForNestedTypes(memberListItemHashtable, context.TypeDeclarationNode, context.TypeDeclarationNode, DomBindingFlags.Default, true); } } } break; case DotNetContextType.NamespaceTypeOrMember: if (context.ProjectResolver != null) { switch (context.TargetItem.Type) { case DotNetContextItemType.Namespace: case DotNetContextItemType.NamespaceAlias: // Fill with child namespaces and types context.ProjectResolver.AddMemberListItemsForChildNamespaces(memberListItemHashtable, context.TargetItem.ResolvedInfo.ToString()); context.ProjectResolver.AddMemberListItemsForTypes(memberListItemHashtable, context.TypeDeclarationNode, context.TargetItem.ResolvedInfo.ToString(), DomBindingFlags.Default, false); break; case DotNetContextItemType.Constant: case DotNetContextItemType.Type: // Add nested types if (context.TargetItem.ResolvedInfo is IDomType) { // Fill with nested types context.ProjectResolver.AddMemberListItemsForNestedTypes(memberListItemHashtable, context.TypeDeclarationNode, (IDomType)context.TargetItem.ResolvedInfo, DomBindingFlags.Default, false); } // If the context is in a type declaration... if (context.TypeDeclarationNode != null) { // Fill with static type members context.ProjectResolver.AddMemberListItemsForMembers(memberListItemHashtable, context.TypeDeclarationNode, (IDomType)context.TargetItem.ResolvedInfo, (this.LanguageType == DotNetLanguage.CSharp ? DomBindingFlags.ExcludeIndexers : DomBindingFlags.None) | DomBindingFlags.Static | context.AdditionalBindingFlags | DomBindingFlags.AllAccessTypes); } break; case DotNetContextItemType.Member: // If the context is in a type declaration... if (context.TypeDeclarationNode != null) { // Fill with instance type members of member return type IDomType type = context.ProjectResolver.ConstructAndResolveContextItemMemberReturnType(context, context.Items.Length - 1); if (type != null) { // Fill with extension methods context.ProjectResolver.AddMemberListItemsForExtensionMethods(memberListItemHashtable, context, type, DomBindingFlags.Instance | context.AdditionalBindingFlags | DomBindingFlags.AllAccessTypes); // Fill with instance type members context.ProjectResolver.AddMemberListItemsForMembers(memberListItemHashtable, context.TypeDeclarationNode, type, (this.LanguageType == DotNetLanguage.CSharp ? DomBindingFlags.ExcludeIndexers : DomBindingFlags.None) | DomBindingFlags.Instance | context.AdditionalBindingFlags | DomBindingFlags.AllAccessTypes); } } break; case DotNetContextItemType.ArrayItem: case DotNetContextItemType.Parameter: case DotNetContextItemType.Variable: // If the context is in a member declaration... if (context.MemberDeclarationNode != null) { // Fill with extension methods context.ProjectResolver.AddMemberListItemsForExtensionMethods(memberListItemHashtable, context, (IDomType)context.TargetItem.ResolvedInfo, DomBindingFlags.Instance | context.AdditionalBindingFlags | DomBindingFlags.AllAccessTypes); // Fill with instance type members context.ProjectResolver.AddMemberListItemsForMembers(memberListItemHashtable, context.TypeDeclarationNode, (IDomType)context.TargetItem.ResolvedInfo, (this.LanguageType == DotNetLanguage.CSharp ? DomBindingFlags.ExcludeIndexers : DomBindingFlags.None) | DomBindingFlags.Instance | context.AdditionalBindingFlags | DomBindingFlags.AllAccessTypes); } break; } } break; case DotNetContextType.NativeType: // If the context is in a member declaration... if ((context.ProjectResolver != null) && (context.TypeDeclarationNode != null)) { if (context.TargetItem.Type == DotNetContextItemType.Type) { // Fill with static type members context.ProjectResolver.AddMemberListItemsForMembers(memberListItemHashtable, context.TypeDeclarationNode, (IDomType)context.TargetItem.ResolvedInfo, (this.LanguageType == DotNetLanguage.CSharp ? DomBindingFlags.ExcludeIndexers : DomBindingFlags.None) | DomBindingFlags.Static | context.AdditionalBindingFlags | DomBindingFlags.Public); } } break; case DotNetContextType.NewObjectDeclaration: if ((context.ProjectResolver != null) && (context.TypeDeclarationNode != null)) { if (context.TargetItem == null) { // Fill with child namespace names in the global and imported namespaces context.ProjectResolver.AddMemberListItemsForChildNamespaces(memberListItemHashtable, null); foreach (string namespaceName in context.ImportedNamespaces) { context.ProjectResolver.AddMemberListItemsForChildNamespaces(memberListItemHashtable, namespaceName); } // Fill with the creatable types in the global and imported namespaces context.ProjectResolver.AddMemberListItemsForTypes(memberListItemHashtable, context.TypeDeclarationNode, null, DomBindingFlags.Default | DomBindingFlags.HasConstructor, false); foreach (string namespaceName in context.ImportedNamespaces) { context.ProjectResolver.AddMemberListItemsForTypes(memberListItemHashtable, context.TypeDeclarationNode, namespaceName, DomBindingFlags.Default | DomBindingFlags.HasConstructor, false); } // Fill with the creatable nested types context.ProjectResolver.AddMemberListItemsForNestedTypes(memberListItemHashtable, context.TypeDeclarationNode, context.TypeDeclarationNode, DomBindingFlags.Default | DomBindingFlags.HasConstructor, true); } else { switch (context.TargetItem.Type) { case DotNetContextItemType.Namespace: case DotNetContextItemType.NamespaceAlias: // Fill with child namespaces and creatable types context.ProjectResolver.AddMemberListItemsForChildNamespaces(memberListItemHashtable, context.TargetItem.ResolvedInfo.ToString()); context.ProjectResolver.AddMemberListItemsForTypes(memberListItemHashtable, context.TypeDeclarationNode, context.TargetItem.ResolvedInfo.ToString(), DomBindingFlags.Default | DomBindingFlags.HasConstructor, false); break; case DotNetContextItemType.Type: // Fill with the creatable nested types context.ProjectResolver.AddMemberListItemsForNestedTypes(memberListItemHashtable, context.TypeDeclarationNode, (IDomType)context.TargetItem.ResolvedInfo, DomBindingFlags.Default | DomBindingFlags.HasConstructor, false); // Fill with extension methods context.ProjectResolver.AddMemberListItemsForExtensionMethods(memberListItemHashtable, context, (IDomType)context.TargetItem.ResolvedInfo, DomBindingFlags.Instance | context.AdditionalBindingFlags | DomBindingFlags.AllAccessTypes); // Fill with instance type members context.ProjectResolver.AddMemberListItemsForMembers(memberListItemHashtable, context.TypeDeclarationNode, (IDomType)context.TargetItem.ResolvedInfo, (this.LanguageType == DotNetLanguage.CSharp ? DomBindingFlags.ExcludeIndexers : DomBindingFlags.None) | DomBindingFlags.Instance | context.AdditionalBindingFlags | DomBindingFlags.AllAccessTypes); break; } } } break; case DotNetContextType.ThisAccess: // If the context is in an instance member declaration... if ((context.ProjectResolver != null) && (context.MemberDeclarationNode != null) && (!((IDomMember)context.MemberDeclarationNode).IsStatic)) { if (context.TargetItem.Type == DotNetContextItemType.This) { // Fill with extension methods context.ProjectResolver.AddMemberListItemsForExtensionMethods(memberListItemHashtable, context, (IDomType)context.TargetItem.ResolvedInfo, DomBindingFlags.Instance | context.AdditionalBindingFlags | DomBindingFlags.AllAccessTypes); // Fill with instance type members context.ProjectResolver.AddMemberListItemsForMembers(memberListItemHashtable, context.TypeDeclarationNode, (IDomType)context.TargetItem.ResolvedInfo, (this.LanguageType == DotNetLanguage.CSharp ? DomBindingFlags.ExcludeIndexers : DomBindingFlags.None) | DomBindingFlags.Instance | context.AdditionalBindingFlags | DomBindingFlags.AllAccessTypes); } } break; case DotNetContextType.BaseMemberAccess: case DotNetContextType.ThisMemberAccess: // If the context is in an instance member declaration... if ((context.ProjectResolver != null) && (context.MemberDeclarationNode != null) && (!((IDomMember)context.MemberDeclarationNode).IsStatic)) { // Fill with instance type members of member return type IDomType type = null; if (context.TargetItem.ResolvedInfo is IDomType) { type = (IDomType)context.TargetItem.ResolvedInfo; } else { type = context.ProjectResolver.ConstructAndResolveContextItemMemberReturnType(context, context.Items.Length - 1); } if (type != null) { // Fill with extension methods context.ProjectResolver.AddMemberListItemsForExtensionMethods(memberListItemHashtable, context, type, DomBindingFlags.Instance | context.AdditionalBindingFlags | DomBindingFlags.AllAccessTypes); // Fill with instance type members context.ProjectResolver.AddMemberListItemsForMembers(memberListItemHashtable, context.TypeDeclarationNode, type, (this.LanguageType == DotNetLanguage.CSharp ? DomBindingFlags.ExcludeIndexers : DomBindingFlags.None) | DomBindingFlags.Instance | context.AdditionalBindingFlags | DomBindingFlags.AllAccessTypes); } } break; case DotNetContextType.StringLiteral: // If the context is in a member declaration... if (context.ProjectResolver != null) { if (context.TargetItem.Type == DotNetContextItemType.StringLiteral) { // Fill with extension methods context.ProjectResolver.AddMemberListItemsForExtensionMethods(memberListItemHashtable, context, (IDomType)context.TargetItem.ResolvedInfo, DomBindingFlags.Instance | context.AdditionalBindingFlags | DomBindingFlags.Public); // Fill with string instance type members context.ProjectResolver.AddMemberListItemsForMembers(memberListItemHashtable, context.TypeDeclarationNode, (IDomType)context.TargetItem.ResolvedInfo, (this.LanguageType == DotNetLanguage.CSharp ? DomBindingFlags.ExcludeIndexers : DomBindingFlags.None) | DomBindingFlags.Instance | context.AdditionalBindingFlags | DomBindingFlags.Public); } } break; case DotNetContextType.UsingDeclaration: // Fill with namespaces if (context.ProjectResolver != null) { context.ProjectResolver.AddMemberListItemsForChildNamespaces(memberListItemHashtable, (context.TargetItem != null ? context.TargetItem.ResolvedInfo.ToString() : String.Empty)); } break; } // Pre-filter the member list this.OnSyntaxEditorIntelliPromptMemberListPreFilter(syntaxEditor, new IntelliPromptMemberListPreFilterEventArgs(syntaxEditor, context, memberListItemHashtable)); // Add items if (memberListItemHashtable.Count > 0) { IntelliPromptMemberListItem[] items = new IntelliPromptMemberListItem[memberListItemHashtable.Count]; memberListItemHashtable.Values.CopyTo(items, 0); memberList.AddRange(items); } // Show the list if (memberList.Count > 0) { if (context.InitializationTextRange.IsDeleted) { memberList.Show(); } else if (completeWord) { memberList.CompleteWord(toEditor.Caret.Offset - context.InitializationTextRange.Length, context.InitializationTextRange.Length); //memberList.CompleteWord(context.InitializationTextRange.StartOffset, context.InitializationTextRange.Length); } else { memberList.Show(toEditor.Caret.Offset, context.InitializationTextRange.Length); //memberList.Show(context.InitializationTextRange.StartOffset, context.InitializationTextRange.Length); } return(true); } else if (memberList.Visible) { memberList.Abort(); } return(false); }