예제 #1
0
        private void SetupIntelliSense()
        {
            // Start the parser service (only call this once at the start of your application)
            SemanticParserService.Start();
            string temp = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), Branding.ProductName + Path.DirectorySeparatorChar + "Temp");

            if (!Directory.Exists(temp))
            {
                Directory.CreateDirectory(temp);
            }

            string intellisenseCacheDir = Path.Combine(temp, @"IntellisenseCacheModelScripts");

            TempAssembliesDir = Path.Combine(temp, @"TempAssemblies");

            if (!Directory.Exists(intellisenseCacheDir))
            {
                Directory.CreateDirectory(intellisenseCacheDir);
            }

            dotNetProjectResolver.CachePath = intellisenseCacheDir;
            //AddMainFunctionAssemblyToProjectResolver();
            ActiproSoftware.SyntaxEditor.Addons.CSharp.CSharpSyntaxLanguage cSharpLanguage = new ActiproSoftware.SyntaxEditor.Addons.CSharp.CSharpSyntaxLanguage();
            syntaxEditorOffscreen.Document.Language     = cSharpLanguage;
            syntaxEditorOffscreen.Document.LanguageData = dotNetProjectResolver;
            syntaxEditorOffscreen.Document.Filename     = System.Guid.NewGuid().ToString() + ".cs";

            ArchAngel.Common.Generator gen = new ArchAngel.Common.Generator(null, Controller.Instance.CurrentProject.TemplateLoader);
            gen.ClearAllDebugLines();

            if (!backgroundWorkerAddReferences.IsBusy)
            {
                backgroundWorkerAddReferences.RunWorkerAsync();
            }
        }
예제 #2
0
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                // Stop the parser service... note that you should only do this if you are closing your application down
                //   and are sure no other languages are still using the service... in the case of this sample project,
                //   each QuickStart Form is modal so we know another window doesn't have a language that is still accessing the service
                SemanticParserService.Stop();

                // Dispose the project resolver... this releases all its resources
                try
                {
                    dotNetProjectResolver.Dispose();
                }
                catch
                {
                    // Do nothing
                }

                // Prune the cache to remove files that no longer apply... note that you should only do this if you are closing your application down
                //   and are sure no other project resolvers are still using the cache... in the case of this sample project,
                //   each QuickStart Form is modal so we know another window is still not accessing the cache
                dotNetProjectResolver.PruneCache();

                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }
예제 #3
0
        public MainWindow()
        {
            InitializeComponent();
            InitSkinGallery();

            SemanticParserService.Start();
        }
 internal static void ForceSynchronousReparse(Document document)
 {
     lock (CSharpExtendedSyntaxLanguage.SemanticParserSyncLock)
     {
         if (document == null)
         {
             return;
         }
         SemanticParserService.Stop();
         SemanticParserService.Parse(new SemanticParserServiceRequest(0, document, new ActiproSoftware.SyntaxEditor.TextRange(0, document.Length + 1), SemanticParseFlags.None, (ISemanticParserServiceProcessor)document.Language, (ISemanticParseDataTarget)document));
         SemanticParserService.Start();
     }
 }
예제 #5
0
        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);
        }
예제 #6
0
 private static void StartSemanticParsingService()
 {
     SemanticParserService.Start();
 }
        /// <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);
        }