예제 #1
0
        public void VisitModuleSymbol(ModuleSymbol tr)
        {
            if (isVariableInstance)
            {
                return;
            }

            foreach (var i in tr.Definition)
            {
                var di = i as DNode;
                if (di == null)
                {
                    if (i != null)
                    {
                        CompletionDataGenerator.Add(i);
                    }
                    continue;
                }

                if (di.IsPublic && CanItemBeShownGenerally(i) && AbstractVisitor.CanAddMemberOfType(MemberFilter, i))
                {
                    CompletionDataGenerator.Add(i);
                }
            }
        }
예제 #2
0
 protected override void BuildCompletionDataInternal(IEditorData Editor, char enteredChar)
 {
     foreach (var kv in TraitsExpressionCompletionItems)
     {
         CompletionDataGenerator.AddTextItem(kv.Key, kv.Value);
     }
 }
예제 #3
0
 protected override void BuildCompletionDataInternal(IEditorData Editor, char enteredChar)
 {
     if (Attribute is VersionCondition)
     {
         foreach (var kv in VersionCompletionItems)
         {
             CompletionDataGenerator.AddTextItem(kv.Key, kv.Value);
         }
     }
     else if (Attribute is PragmaAttribute)
     {
         var p = Attribute as PragmaAttribute;
         if (string.IsNullOrEmpty(p.Identifier))
         {
             foreach (var kv in PragmaAttributeCompletionItems)
             {
                 CompletionDataGenerator.AddTextItem(kv.Key, kv.Value);
             }
         }
     }
     else if (Attribute is Modifier && ((Modifier)Attribute).Token == DTokens.Extern)
     {
         foreach (var kv in ExternAttributeCompletionItems)
         {
             CompletionDataGenerator.AddTextItem(kv.Key, kv.Value);
         }
     }
 }
예제 #4
0
        protected override void BuildCompletionDataInternal(IEditorData Editor, char enteredChar)
        {
            var ctxt = ResolutionContext.Create(Editor, false);

            foreach (var kv in VersionCompletionItems)
            {
                CompletionDataGenerator.AddTextItem(kv.Key, kv.Value);
            }

            CodeCompletion.DoTimeoutableCompletionTask(CompletionDataGenerator, ctxt, () => {
                ctxt.Push(Editor);
                var cs = ctxt.CurrentContext.DeclarationCondititons;
                foreach (var v in cs.GlobalFlags.Versions)
                {
                    if (!VersionCompletionItems.ContainsKey(v))
                    {
                        CompletionDataGenerator.AddTextItem(v, "");
                    }
                }
                foreach (var v in cs.LocalFlags.Versions)
                {
                    if (!VersionCompletionItems.ContainsKey(v))
                    {
                        CompletionDataGenerator.AddTextItem(v, "");
                    }
                }
            });
        }
예제 #5
0
        protected override void BuildCompletionDataInternal(IEditorData Editor, char enteredChar)
        {
            var dc = begunNode.Parent as DClassLike;

            if (dc == null || dc.ClassType != DTokens.Class)
            {
                return;
            }

            var classType = DResolver.ResolveClassOrInterface(dc, ResolutionContext.Create(Editor), null) as TemplateIntermediateType;

            if (classType == null)
            {
                return;
            }

            var typesToScan = new List <TemplateIntermediateType>();

            IterateThroughBaseClassesInterfaces(typesToScan, classType);

            foreach (var t in typesToScan)
            {
                foreach (var n in t.Definition)
                {
                    var dm = n as DMethod;
                    if (dm == null ||
                        dm.ContainsAttribute(DTokens.Final, DTokens.Private, DTokens.Static))
                    {
                        continue;                         //TODO: Other attributes?
                    }
                    CompletionDataGenerator.AddCodeGeneratingNodeItem(dm, GenerateOverridingMethodStub(dm, begunNode, !(t is InterfaceType)));
                }
            }
        }
예제 #6
0
 protected override void BuildCompletionDataInternal(IEditorData ed, char enteredChar)
 {
     foreach (var v in completionItemData)
     {
         CompletionDataGenerator.AddIconItem(v.IconID, v.DisplayName, v.Description);
     }
 }
예제 #7
0
 public void VisitEnumType(EnumType en)
 {
     foreach (var e in en.Definition)
     {
         CompletionDataGenerator.Add(e);
     }
     // TODO: Enlist ufcs items&stat props here aswell?
 }
예제 #8
0
 protected override void BuildCompletionDataInternal(IEditorData Editor, char enteredChar)
 {
     if (string.IsNullOrEmpty(Attribute.Identifier))
     {
         foreach (var kv in PragmaAttributeCompletionItems)
         {
             CompletionDataGenerator.AddTextItem(kv.Key, kv.Value);
         }
     }
 }
예제 #9
0
 protected override void BuildCompletionDataInternal(IEditorData Editor, char enteredChar)
 {
     if (Attribute is Modifier && ((Modifier)Attribute).Token == DTokens.Extern)
     {
         foreach (var kv in ExternAttributeCompletionItems)
         {
             CompletionDataGenerator.AddTextItem(kv.Key, kv.Value);
         }
     }
 }
예제 #10
0
 void GenUfcsAndStaticProperties(AbstractType t)
 {
     if (isVariableInstance && CompletionOptions.Instance.ShowUFCSItems)
     {
         foreach (var ufcsItem in UFCSResolver.TryResolveUFCS(t, 0, ed.CaretLocation, ctxt))
         {
             CompletionDataGenerator.Add((ufcsItem as DSymbol).Definition);
         }
     }
     StaticProperties.ListProperties(CompletionDataGenerator, MemberFilter, t, isVariableInstance);
 }
예제 #11
0
 protected override void BuildCompletionDataInternal(IEditorData Editor, string EnteredText)
 {
     foreach (var kv in new Dictionary <string, string> {
         { "exit", "Executes on leaving current scope" },
         { "success", "Executes if no error occurred in current scope" },
         { "failure", "Executes if error occurred in current scope" }
     })
     {
         CompletionDataGenerator.AddTextItem(kv.Key, kv.Value);
     }
 }
예제 #12
0
 protected override void BuildCompletionDataInternal(IEditorData Editor, char enteredChar)
 {
     foreach (var kv in new Dictionary <string, string> {
         { "exit", "Выполняется при выходе из текущего масштаба" },
         { "success", "Выполняется, если в текущем масштабе не было ошибок при выполнении кода" },
         { "failure", "Выполняется, если в текущем масштабе были ошибки при выполнении кода" }
     })
     {
         CompletionDataGenerator.AddTextItem(kv.Key, kv.Value);
     }
 }
예제 #13
0
        void BuildCompletionData(PackageSymbol mpr)
        {
            foreach (var kv in mpr.Package.Packages)
            {
                CompletionDataGenerator.AddPackage(kv.Value.Name);
            }

            foreach (var kv in mpr.Package.Modules)
            {
                CompletionDataGenerator.AddModule(kv.Value);
            }
        }
 protected override void BuildCompletionDataInternal(IEditorData Editor, char enteredChar)
 {
     foreach (var propAttr in new[] {
         "disable",
         "property",
         "safe",
         "system",
         "trusted"
     })
     {
         CompletionDataGenerator.AddPropertyAttribute(propAttr);
     }
 }
예제 #15
0
 void GenUfcsAndStaticProperties(AbstractType t)
 {
     if (t.NonStaticAccess && CompletionOptions.Instance.ShowUFCSItems)
     {
         CodeCompletion.DoTimeoutableCompletionTask(null, ctxt, () =>
         {
             foreach (var ufcsItem in UFCSResolver.TryResolveUFCS(t, 0, ed.CaretLocation, ctxt))
             {
                 CompletionDataGenerator.Add((ufcsItem as DSymbol).Definition);
             }
         });
     }
     StaticProperties.ListProperties(CompletionDataGenerator, ctxt, MemberFilter, t, t.NonStaticAccess);
 }
        protected override void BuildCompletionDataInternal(IEditorData Editor, string EnteredText)
        {
            if (Editor.ParseCache == null)
            {
                return;
            }

            if (imp != null)
            {
                string pack = null;

                if (imp.ModuleIdentifier != null && imp.ModuleIdentifier.InnerDeclaration != null)
                {
                    pack = imp.ModuleIdentifier.InnerDeclaration.ToString();

                    // Will occur after an initial dot
                    if (string.IsNullOrEmpty(pack))
                    {
                        return;
                    }
                }

                foreach (var p in Editor.ParseCache.LookupPackage(pack))
                {
                    foreach (var kv_pack in p.Packages)
                    {
                        CompletionDataGenerator.Add(kv_pack.Key);
                    }

                    foreach (var kv_mod in p.Modules)
                    {
                        CompletionDataGenerator.Add(kv_mod.Key, kv_mod.Value);
                    }
                }
            }
            else if (impBind != null)
            {
                /*
                 * Show all members of the imported modules
                 * + public imports
                 * + items of anonymous enums
                 */
            }
        }
예제 #17
0
        void BuildCompletionData(ModuleSymbol tr)
        {
            foreach (var i in tr.Definition)
            {
                var di = i as DNode;
                if (di == null)
                {
                    if (i != null)
                    {
                        CompletionDataGenerator.Add(i);
                    }
                    continue;
                }

                if (di.IsPublic && CanItemBeShownGenerally(i))
                {
                    CompletionDataGenerator.Add(i);
                }
            }
        }
예제 #18
0
        protected override void BuildCompletionDataInternal(IEditorData Editor, string EnteredText)
        {
            foreach (var kv in new Dictionary <string, string> {
                { "isArithmetic", "If the arguments are all either types that are arithmetic types, or expressions that are typed as arithmetic types, then true is returned. Otherwise, false is returned. If there are no arguments, false is returned." },
                { "isFloating", "Works like isArithmetic, except it's for floating point types (including imaginary and complex types)." },
                { "isIntegral", "Works like isArithmetic, except it's for integral types (including character types)." },
                { "isScalar", "Works like isArithmetic, except it's for scalar types." },
                { "isUnsigned", "Works like isArithmetic, except it's for unsigned types." },
                { "isStaticArray", "Works like isArithmetic, except it's for static array types." },
                { "isAssociativeArray", "Works like isArithmetic, except it's for associative array types." },
                { "isAbstractClass", "If the arguments are all either types that are abstract classes, or expressions that are typed as abstract classes, then true is returned. Otherwise, false is returned. If there are no arguments, false is returned." },
                { "isFinalClass", "Works like isAbstractClass, except it's for final classes." },
                { "isVirtualFunction", "The same as isVirtualMethod, except that final functions that don't override anything return true." },
                { "isVirtualMethod", "Takes one argument. If that argument is a virtual function, true is returned, otherwise false. Final functions that don't override anything return false." },
                { "isAbstractFunction", "Takes one argument. If that argument is an abstract function, true is returned, otherwise false." },
                { "isFinalFunction", "Takes one argument. If that argument is a final function, true is returned, otherwise false." },
                { "isStaticFunction", "Takes one argument. If that argument is a static function, meaning it has no context pointer, true is returned, otherwise false." },
                { "isRef", "Takes one argument. If that argument is a declaration, true is returned if it is ref, otherwise false." },
                { "isOut", "Takes one argument. If that argument is a declaration, true is returned if it is out, otherwise false." },
                { "isLazy", "Takes one argument. If that argument is a declaration, true is returned if it is lazy, otherwise false." },
                { "hasMember", "The first argument is a type that has members, or is an expression of a type that has members. The second argument is a string. If the string is a valid property of the type, true is returned, otherwise false." },
                { "identifier", "Takes one argument, a symbol. Returns the identifier for that symbol as a string literal." },
                { "getMember", "Takes two arguments, the second must be a string. The result is an expression formed from the first argument, followed by a ‘.’, followed by the second argument as an identifier." },
                { "getOverloads", "The first argument is a class type or an expression of class type. The second argument is a string that matches the name of one of the functions of that class. The result is a tuple of all the overloads of that function." },
                { "getVirtualFunctions", "The same as getVirtualMethods, except that final functions that do not override anything are included." },
                { "getVirtualMethods", "The first argument is a class type or an expression of class type. The second argument is a string that matches the name of one of the functions of that class. The result is a tuple of the virtual overloads of that function. It does not include final functions that do not override anything." },
                { "parent", "Takes a single argument which must evaluate to a symbol. The result is the symbol that is the parent of it." },
                { "classInstanceSize", "Takes a single argument, which must evaluate to either a class type or an expression of class type. The result is of type size_t, and the value is the number of bytes in the runtime instance of the class type. It is based on the static type of a class, not the polymorphic type." },
                { "allMembers", "Takes a single argument, which must evaluate to either a type or an expression of type. A tuple of string literals is returned, each of which is the name of a member of that type combined with all of the members of the base classes (if the type is a class). No name is repeated. Builtin properties are not included." },
                { "derivedMembers", "Takes a single argument, which must evaluate to either a type or an expression of type. A tuple of string literals is returned, each of which is the name of a member of that type. No name is repeated. Base class member names are not included. Builtin properties are not included." },
                { "isSame", "Takes two arguments and returns bool true if they are the same symbol, false if not." },
                { "compiles", @"Returns a bool true if all of the arguments compile (are semantically correct). The arguments can be symbols, types, or expressions that are syntactically correct. The arguments cannot be statements or declarations.

If there are no arguments, the result is false." },
            })
            {
                CompletionDataGenerator.AddTextItem(kv.Key, kv.Value);
            }
        }
        protected override void BuildCompletionDataInternal(IEditorData Editor, char enteredChar)
        {
            if (Editor.ParseCache == null)
            {
                return;
            }

            string pack = null;

            if (imp.ModuleIdentifier != null && imp.ModuleIdentifier.InnerDeclaration != null)
            {
                pack = imp.ModuleIdentifier.InnerDeclaration.ToString();

                // Will occur after an initial dot
                if (string.IsNullOrEmpty(pack))
                {
                    return;
                }
            }

            foreach (var p in Editor.ParseCache.LookupPackage(pack))
            {
                if (p == null)
                {
                    continue;
                }

                foreach (var kv_pack in p.Packages)
                {
                    CompletionDataGenerator.AddPackage(kv_pack.Value.Name);
                }

                foreach (var kv_mod in p.Modules)
                {
                    CompletionDataGenerator.AddModule(kv_mod.Value);
                }
            }
        }
예제 #20
0
        protected override void BuildCompletionDataInternal(IEditorData Editor, char enteredChar)
        {
            var visibleMembers = MemberFilter.All;

            if (!GetVisibleMemberFilter(Editor, enteredChar, ref visibleMembers, ref curStmt))
            {
                return;
            }

            MemberCompletionEnumeration.EnumAllAvailableMembers(
                CompletionDataGenerator,
                curBlock,
                curStmt,
                Editor.CaretLocation,
                Editor.ParseCache,
                visibleMembers,
                new ConditionalCompilationFlags(Editor));

            //TODO: Split the keywords into such that are allowed within block statements and non-block statements
            // Insert typable keywords
            if (visibleMembers.HasFlag(MemberFilter.Keywords))
            {
                foreach (var kv in DTokens.Keywords)
                {
                    CompletionDataGenerator.Add(kv.Key);
                }
            }

            else if (visibleMembers.HasFlag(MemberFilter.StructsAndUnions))
            {
                foreach (var kv in DTokens.BasicTypes_Array)
                {
                    CompletionDataGenerator.Add(kv);
                }
            }
        }
예제 #21
0
        void BuildCompletionData(
            AbstractType rr,
            IBlockNode currentlyScopedBlock,
            bool isVariableInstance   = false,
            AbstractType resultParent = null)
        {
            if (rr == null)
            {
                return;
            }

            if (rr.DeclarationOrExpressionBase is ITypeDeclaration)
            {
                isVariableInstance |= (rr.DeclarationOrExpressionBase as ITypeDeclaration).ExpressesVariableAccess;
            }

            if (rr is ArrayAccessSymbol)
            {
                isVariableInstance = true;
                rr = (rr as ArrayAccessSymbol).Base;
            }

            if (rr is MemberSymbol)
            {
                BuildCompletionData((MemberSymbol)rr, currentlyScopedBlock, isVariableInstance);
            }

            // A module path has been typed
            else if (!isVariableInstance && rr is ModuleSymbol)
            {
                BuildCompletionData((ModuleSymbol)rr);
            }

            else if (rr is PackageSymbol)
            {
                BuildCompletionData((PackageSymbol)rr);
            }

            #region A type was referenced directly
            else if (rr is EnumType)
            {
                var en = (EnumType)rr;

                foreach (var e in en.Definition)
                {
                    CompletionDataGenerator.Add(e);
                }
            }

            else if (rr is TemplateIntermediateType)
            {
                var tr = (TemplateIntermediateType)rr;

                if (tr.DeclarationOrExpressionBase is TokenExpression)
                {
                    int token = ((TokenExpression)tr.DeclarationOrExpressionBase).Token;

                    isVariableInstance = token == DTokens.This || token == DTokens.Super;
                }

                // Cases:

                // myVar. (located in basetype definition)		<-- Show everything
                // this.                                        <-- Show everything
                // myVar. (not located in basetype definition)  <-- Show public and public static members
                // super.                                       <-- Show all base type members
                // myClass. (not located in myClass)			<-- Show all static members
                // myClass. (located in myClass)				<-- Show all static members

                BuildCompletionData(tr, isVariableInstance);
            }
            #endregion

            else if (rr is PointerType)
            {
                var pt = (PointerType)rr;
                if (!(pt.Base is PrimitiveType && pt.Base.DeclarationOrExpressionBase is PointerDecl))
                {
                    BuildCompletionData(pt.Base, currentlyScopedBlock, true, pt);
                }
            }

            else
            {
                StaticProperties.ListProperties(CompletionDataGenerator, MemberFilter, rr, isVariableInstance);
            }
        }
예제 #22
0
        protected override void BuildCompletionDataInternal(IEditorData Editor, string EnteredText)
        {
            if (Attribute is DeclarationCondition)
            {
                var c = Attribute as DeclarationCondition;

                if (c.IsVersionCondition)
                {
                    foreach (var kv in new Dictionary <string, string> {
                        { "DigitalMars", "DMD (Digital Mars D) is the compiler" },
                        { "GNU", "GDC (GNU D Compiler) is the compiler" },
                        { "LDC", "LDC (LLVM D Compiler) is the compiler" },
                        { "SDC", "SDC (Stupid D Compiler) is the compiler" },
                        { "D_NET", "D.NET is the compiler" },
                        { "Windows", "Microsoft Windows systems" },
                        { "Win32", "Microsoft 32-bit Windows systems" },
                        { "Win64", "Microsoft 64-bit Windows systems" },
                        { "linux", "All Linux systems" },
                        { "OSX", "Mac OS X" },
                        { "FreeBSD", "FreeBSD" },
                        { "OpenBSD", "OpenBSD" },
                        { "BSD", "All other BSDs" },
                        { "Solaris", "Solaris" },
                        { "Posix", "All POSIX systems (includes Linux, FreeBSD, OS X, Solaris, etc.)" },
                        { "AIX", "IBM Advanced Interactive eXecutive OS" },
                        { "SkyOS", "The SkyOS operating system" },
                        { "SysV3", "System V Release 3" },
                        { "SysV4", "System V Release 4" },
                        { "Hurd", "GNU Hurd" },
                        { "Cygwin", "The Cygwin environment" },
                        { "MinGW", "The MinGW environment" },
                        { "X86", "Intel and AMD 32-bit processors" },
                        { "X86_64", "AMD and Intel 64-bit processors" },
                        { "ARM", "The Advanced RISC Machine architecture (32-bit)" },
                        { "PPC", "The PowerPC architecture, 32-bit" },
                        { "PPC64", "The PowerPC architecture, 64-bit" },
                        { "IA64", "The Itanium architecture (64-bit)" },
                        { "MIPS", "The MIPS architecture, 32-bit" },
                        { "MIPS64", "The MIPS architecture, 64-bit" },
                        { "SPARC", "The SPARC architecture, 32-bit" },
                        { "SPARC64", "The SPARC architecture, 64-bit" },
                        { "S390", "The System/390 architecture, 32-bit" },
                        { "S390X", "The System/390X architecture, 64-bit" },
                        { "HPPA", "The HP PA-RISC architecture, 32-bit" },
                        { "HPPA64", "The HP PA-RISC architecture, 64-bit" },
                        { "SH", "The SuperH architecture, 32-bit" },
                        { "SH64", "The SuperH architecture, 64-bit" },
                        { "Alpha", "The Alpha architecture" },
                        { "LittleEndian", "Byte order, least significant first" },
                        { "BigEndian", "Byte order, most significant first" },
                        { "D_Coverage", "Code coverage analysis instrumentation (command line switch -cov) is being generated" },
                        { "D_Ddoc", "Ddoc documentation (command line switch -D) is being generated" },
                        { "D_InlineAsm_X86", "Inline assembler for X86 is implemented" },
                        { "D_InlineAsm_X86_64", "Inline assembler for X86-64 is implemented" },
                        { "D_LP64", "Pointers are 64 bits (command line switch -m64)" },
                        { "D_PIC", "Position Independent Code (command line switch -fPIC) is being generated" },
                        { "D_SIMD", "Vector Extensions are supported" },
                        { "unittest", "Unit tests are enabled (command line switch -unittest)" },
                        { "D_Version2", "This is a D version 2 compiler" },
                        { "none", "Never defined; used to just disable a section of code" },
                        { "all", "Always defined; used as the opposite of none" }
                    })
                    {
                        CompletionDataGenerator.AddTextItem(kv.Key, kv.Value);
                    }
                }
            }
            else if (Attribute.Token == DTokens.Extern)
            {
                foreach (var kv in new Dictionary <string, string> {
                    { "C", "" },
                    { "C++", "C++ is reserved for future use" },
                    { "D", "" },
                    { "Windows", "Implementation Note: for Win32 platforms, Windows and Pascal should exist" },
                    { "Pascal", "Implementation Note: for Win32 platforms, Windows and Pascal should exist" },
                    { "System", "System is the same as Windows on Windows platforms, and C on other platforms" }
                })
                {
                    CompletionDataGenerator.AddTextItem(kv.Key, kv.Value);
                }
            }
            else if (Attribute is PragmaAttribute)
            {
                var p = Attribute as PragmaAttribute;
                if (string.IsNullOrEmpty(p.Identifier))
                {
                    foreach (var kv in new Dictionary <string, string> {
                        { "lib", "Inserts a directive in the object file to link in" },
                        { "msg", "Prints a message while compiling" },
                        { "startaddress", "Puts a directive into the object file saying that the function specified in the first argument will be the start address for the program" }
                    })
                    {
                        CompletionDataGenerator.AddTextItem(kv.Key, kv.Value);
                    }
                }
            }
        }
예제 #23
0
        protected override void BuildCompletionDataInternal(IEditorData Editor, char enteredChar)
        {
            if (Editor.ParseCache == null)
            {
                return;
            }

            if (impBind != null)
            {
                DModule mod = null;

                var modName = imp.ModuleIdentifier.ToString(true);
                foreach (var pc in Editor.ParseCache)
                {
                    if ((mod = pc.GetModule(modName)) != null)
                    {
                        break;
                    }
                }

                if (mod == null)
                {
                    return;
                }

                var ctxt = ResolutionContext.Create(Editor);

                /*
                 * Show all members of the imported module
                 * + public imports
                 * + items of anonymous enums
                 */

                MemberCompletionEnumeration.EnumChildren(CompletionDataGenerator, ctxt, mod, true, MemberFilter.All);

                return;
            }


            string pack = null;

            if (imp.ModuleIdentifier != null && imp.ModuleIdentifier.InnerDeclaration != null)
            {
                pack = imp.ModuleIdentifier.InnerDeclaration.ToString();

                // Will occur after an initial dot
                if (string.IsNullOrEmpty(pack))
                {
                    return;
                }
            }

            foreach (var p in Editor.ParseCache.LookupPackage(pack))
            {
                if (p == null)
                {
                    continue;
                }

                foreach (var kv_pack in p.Packages)
                {
                    CompletionDataGenerator.AddPackage(kv_pack.Value.Name);
                }

                foreach (var kv_mod in p.Modules)
                {
                    CompletionDataGenerator.AddModule(kv_mod.Value);
                }
            }
        }
예제 #24
0
        void BuildCompletionData(
            AbstractType rr,
            IBlockNode currentlyScopedBlock,
            bool isVariableInstance   = false,
            AbstractType resultParent = null)
        {
            if (rr == null)
            {
                return;
            }

            if (rr.DeclarationOrExpressionBase is ITypeDeclaration)
            {
                isVariableInstance |= (rr.DeclarationOrExpressionBase as ITypeDeclaration).ExpressesVariableAccess;
            }

            if (rr is MemberSymbol)
            {
                BuildCompletionData((MemberSymbol)rr, currentlyScopedBlock, isVariableInstance);
            }

            // A module path has been typed
            else if (!isVariableInstance && rr is ModuleSymbol)
            {
                BuildCompletionData((ModuleSymbol)rr);
            }

            else if (rr is PackageSymbol)
            {
                BuildCompletionData((PackageSymbol)rr);
            }

            #region A type was referenced directly
            else if (rr is EnumType)
            {
                var en = (EnumType)rr;

                foreach (var e in en.Definition)
                {
                    CompletionDataGenerator.Add(e);
                }
            }

            else if (rr is TemplateIntermediateType)
            {
                var tr  = (TemplateIntermediateType)rr;
                var vis = ItemVisibility.All;

                bool HasSameAncestor = HaveSameAncestors(currentlyScopedBlock, tr.Definition);
                bool IsThis = false, IsSuper = false;

                if (tr.DeclarationOrExpressionBase is TokenExpression)
                {
                    int token = ((TokenExpression)tr.DeclarationOrExpressionBase).Token;
                    IsThis  = token == DTokens.This;
                    IsSuper = token == DTokens.Super;
                }

                // Cases:

                // myVar. (located in basetype definition)		<-- Show everything
                // this.                                        <-- Show everything
                if (IsThis || (isVariableInstance && HasSameAncestor))
                {
                    vis = ItemVisibility.All;
                }

                // myVar. (not located in basetype definition)  <-- Show public and public static members
                else if (isVariableInstance && !HasSameAncestor)
                {
                    vis = ItemVisibility.PublicMembers | ItemVisibility.PublicStaticMembers;
                }

                // super.                                       <-- Show protected|public or protected|public static base type members
                else if (IsSuper)
                {
                    vis = ItemVisibility.ProtectedMembers | ItemVisibility.PublicMembers | ItemVisibility.PublicStaticMembers;
                }

                // myClass. (not located in myClass)			<-- Show public static members
                else if (!isVariableInstance && !HasSameAncestor)
                {
                    vis = ItemVisibility.PublicStaticMembers;
                }

                // myClass. (located in myClass)				<-- Show all static members
                else if (!isVariableInstance && HasSameAncestor)
                {
                    vis = ItemVisibility.StaticMembers;
                }

                BuildCompletionData(tr, vis);

                if (resultParent == null)
                {
                    StaticTypePropertyProvider.AddGenericProperties(rr, CompletionDataGenerator, tr.Definition);
                }

                StaticTypePropertyProvider.AddClassTypeProperties(CompletionDataGenerator, tr.Definition);
            }
            #endregion

            #region Things like int. or char.
            else if (rr is PrimitiveType)
            {
                var primType = (PrimitiveType)rr;

                if (resultParent == null)
                {
                    StaticTypePropertyProvider.AddGenericProperties(rr, CompletionDataGenerator, null);
                }

                if (primType.TypeToken > 0)
                {
                    // Determine whether float by the var's base type
                    bool isFloat = DTokens.BasicTypes_FloatingPoint[primType.TypeToken];

                    // Float implies integral props
                    if (DTokens.BasicTypes_Integral[primType.TypeToken] || isFloat)
                    {
                        StaticTypePropertyProvider.AddIntegralTypeProperties(primType.TypeToken, rr, CompletionDataGenerator, null, isFloat);
                    }

                    if (isFloat)
                    {
                        StaticTypePropertyProvider.AddFloatingTypeProperties(primType.TypeToken, rr, CompletionDataGenerator, null);
                    }
                }
            }
            #endregion

            else if (rr is PointerType)
            {
                var pt = (PointerType)rr;
                if (!(pt.Base is PrimitiveType && pt.Base.DeclarationOrExpressionBase is PointerDecl))
                {
                    BuildCompletionData(pt.Base, currentlyScopedBlock, true, pt);
                }
            }

            else if (rr is AssocArrayType)
            {
                var ar = (AssocArrayType)rr;

                if (ar is ArrayType)
                {
                    StaticTypePropertyProvider.AddArrayProperties(rr, CompletionDataGenerator, ar.DeclarationOrExpressionBase as ArrayDecl);
                }
                else
                {
                    StaticTypePropertyProvider.AddAssocArrayProperties(rr, CompletionDataGenerator, ar.DeclarationOrExpressionBase as ArrayDecl);
                }
            }
        }
예제 #25
0
        void BuildCompletionData(UserDefinedType tr, ItemVisibility visMod)
        {
            var n = tr.Definition;

            if (n is DClassLike)             // Add public static members of the class and including all base classes
            {
                var propertyMethodsToIgnore = new List <string>();

                var curlevel = tr;
                var tvisMod  = visMod;
                while (curlevel != null)
                {
                    foreach (var i in curlevel.Definition as DBlockNode)
                    {
                        var dn = i as DNode;

                        if (i != null && dn == null)
                        {
                            CompletionDataGenerator.Add(i);
                            continue;
                        }

                        bool add = false;

                        if (tvisMod.HasFlag(ItemVisibility.All))
                        {
                            add = true;
                        }
                        else
                        {
                            if (tvisMod.HasFlag(ItemVisibility.ProtectedMembers))
                            {
                                add |= dn.ContainsAttribute(DTokens.Protected);
                            }
                            if (tvisMod.HasFlag(ItemVisibility.ProtectedStaticMembers))
                            {
                                add |= dn.ContainsAttribute(DTokens.Protected) && (dn.IsStatic || IsTypeNode(i));
                            }
                            if (tvisMod.HasFlag(ItemVisibility.PublicMembers))
                            {
                                add |= dn.IsPublic;
                            }
                            if (tvisMod.HasFlag(ItemVisibility.PublicStaticMembers))
                            {
                                add |= dn.IsPublic && (dn.IsStatic || IsTypeNode(i));
                            }
                            if (tvisMod.HasFlag(ItemVisibility.StaticMembers))
                            {
                                add |= dn.IsStatic || IsTypeNode(i);
                            }
                        }

                        if (add)
                        {
                            if (CanItemBeShownGenerally(dn))
                            {
                                // Convert @property getters&setters to one unique property
                                if (dn is DMethod && dn.ContainsPropertyAttribute())
                                {
                                    if (!propertyMethodsToIgnore.Contains(dn.Name))
                                    {
                                        var  dm       = dn as DMethod;
                                        bool isGetter = dm.Parameters.Count < 1;

                                        var virtPropNode = new DVariable();

                                        virtPropNode.AssignFrom(dn);

                                        if (!isGetter)
                                        {
                                            virtPropNode.Type = dm.Parameters[0].Type;
                                        }

                                        CompletionDataGenerator.Add(virtPropNode);

                                        propertyMethodsToIgnore.Add(dn.Name);
                                    }
                                }
                                else
                                {
                                    CompletionDataGenerator.Add(dn);
                                }
                            }

                            // Add members of anonymous enums
                            else if (dn is DEnum && string.IsNullOrEmpty(dn.Name))
                            {
                                foreach (var k in dn as DEnum)
                                {
                                    CompletionDataGenerator.Add(k);
                                }
                            }
                        }
                    }
                    curlevel = curlevel.Base as UserDefinedType;

                    // After having shown all items on the current node level,
                    // allow showing public (static) and/or protected items in the more basic levels then
                    if (tvisMod.HasFlag(ItemVisibility.All))
                    {
                        if ((n as DClassLike).ContainsAttribute(DTokens.Static))
                        {
                            tvisMod = ItemVisibility.ProtectedStaticMembers | ItemVisibility.PublicStaticMembers;
                        }
                        else
                        {
                            tvisMod = ItemVisibility.ProtectedMembers | ItemVisibility.PublicMembers;
                        }
                    }
                }
            }
            else if (n is DEnum)
            {
                var de = n as DEnum;

                foreach (var i in de)
                {
                    if (i is DEnumValue)
                    {
                        CompletionDataGenerator.Add(i);
                    }
                }
            }
        }
예제 #26
0
        protected override void BuildCompletionDataInternal(IEditorData Editor, char enteredChar)
        {
            MemberCompletionEnumeration.EnumAllAvailableMembers(
                CompletionDataGenerator,
                curBlock,
                Editor.CaretLocation,
                Editor.ParseCache,
                visibleMembers,
                new ConditionalCompilationFlags(Editor));

            var bits = new BitArray(DTokens.MaxToken, false);

            CompletionDataGenerator.Add(DTokens.__EOF__);

            // Insert typable keywords
            if ((visibleMembers & MemberFilter.BlockKeywords) != 0)
            {
                for (byte tk = DTokens.MaxToken - 1; tk > 0; tk--)
                {
                    if (!bits [tk] && IsBlockKw(tk))
                    {
                        CompletionDataGenerator.Add(tk);
                        bits [tk] = true;
                    }
                }
            }

            if ((visibleMembers & MemberFilter.StatementBlockKeywords) != 0)
            {
                foreach (var kv in statementKeywords)
                {
                    if (!bits [kv])
                    {
                        CompletionDataGenerator.Add(kv);
                        bits [kv] = true;
                    }
                }
            }

            if ((visibleMembers & MemberFilter.ExpressionKeywords) != 0)
            {
                foreach (var kv in expressionKeywords)
                {
                    if (!bits [kv])
                    {
                        CompletionDataGenerator.Add(kv);
                        bits [kv] = true;
                    }
                }
            }

            if ((visibleMembers & MemberFilter.Labels) != 0)
            {
                var  stmt           = DResolver.SearchStatementDeeplyAt(curBlock, Editor.CaretLocation);
                bool addedSwitchKWs = false;
                while (stmt != null && stmt.Parent != null)
                {
                    stmt = stmt.Parent;
                    if (!addedSwitchKWs && stmt is SwitchStatement)
                    {
                        addedSwitchKWs = true;
                        CompletionDataGenerator.Add(DTokens.Case);
                        CompletionDataGenerator.Add(DTokens.Default);
                    }
                }

                if (stmt != null)
                {
                    stmt.Accept(new LabelVisitor(CompletionDataGenerator));
                }
            }

            if ((visibleMembers & MemberFilter.x86Registers) != 0)
            {
                foreach (var kv in AsmRegisterExpression.x86RegisterTable)
                {
                    CompletionDataGenerator.AddTextItem(kv.Key, kv.Value);
                }
            }

            if ((visibleMembers & MemberFilter.x64Registers) != 0)
            {
                foreach (var kv in AsmRegisterExpression.x64RegisterTable)
                {
                    CompletionDataGenerator.AddTextItem(kv.Key, kv.Value);
                }
            }

            if ((visibleMembers & (MemberFilter.x86Registers | MemberFilter.x64Registers)) != 0)
            {
                CompletionDataGenerator.Add(DTokens.__LOCAL_SIZE);

                CompletionDataGenerator.AddTextItem("offsetof", "");
                CompletionDataGenerator.AddTextItem("seg", "The seg means load the segment number that the symbol is in. This is not relevant for flat model code. Instead, do a move from the relevant segment register.");

                // Provide AsmTypePrefixes
                CompletionDataGenerator.AddTextItem("near", "");
                CompletionDataGenerator.AddTextItem("far", "");
                CompletionDataGenerator.AddTextItem("word", "");
                CompletionDataGenerator.AddTextItem("dword", "");
                CompletionDataGenerator.AddTextItem("qword", "");
                CompletionDataGenerator.AddTextItem("ptr", "");
            }

            if ((visibleMembers & MemberFilter.BuiltInPropertyAttributes) != 0)
            {
                foreach (var propAttr in PropertyAttributeCompletionItems)
                {
                    CompletionDataGenerator.AddPropertyAttribute(propAttr);
                }
            }
        }
예제 #27
0
 protected override void BuildCompletionDataInternal(IEditorData Editor, char enteredChar)
 {
     if (Attribute is VersionCondition)
     {
         foreach (var kv in new Dictionary <string, string> {
             { "DigitalMars", "Используется компилятор DMD (Digital Mars D)" },
             { "GNU", "Используется компилятор GDC (GNU D Compiler)" },
             { "LDC", "Используется компилятор LDC (LLVM D Compiler)" },
             { "SDC", "Используется компилятор SDC (Stupid D Compiler)" },
             { "D_NET", "Используется компилятор D.NET" },
             { "Windows", "Системы Microsoft Windows systems" },
             { "Win32", "32-битные системы Microsoft Windows" },
             { "Win64", "64-битные системы Microsoft Windows" },
             { "linux", "Все системы Linux" },
             { "OSX", "Mac OS X" },
             { "FreeBSD", "FreeBSD" },
             { "OpenBSD", "OpenBSD" },
             { "BSD", "Все другие BSD" },
             { "Solaris", "Solaris" },
             { "Posix", "Все системы POSIX (включая Linux, FreeBSD, OS X, Solaris и т.д.)" },
             { "AIX", "IBM Advanced Interactive eXecutive OS" },
             { "SkyOS", "Операционная система SkyOS" },
             { "SysV3", "Система V Выпуск 3" },
             { "SysV4", "Система V Выпуск 4" },
             { "Hurd", "GNU Hurd" },
             { "Cygwin", "Среда Cygwin" },
             { "MinGW", "Среда MinGW" },
             { "X86", "Intel и AMD 32-битные процессоры" },
             { "X86_64", "AMD и Intel 64-битные процессоры" },
             { "ARM", "Продвинутая архитектура машины RISC (32-битная)" },
             { "PPC", "Архитектура PowerPC, 32-битная" },
             { "PPC64", "Архитектура PowerPC, 64-битная" },
             { "IA64", "Архитектура Itanium (64-битная)" },
             { "MIPS", "Архитектура MIPS, 32-битная" },
             { "MIPS64", "Архитектура MIPS, 64-битная" },
             { "SPARC", "Архитектура SPARC, 32-битная" },
             { "SPARC64", "Архитектура SPARC, 64-битная" },
             { "S390", "Архитектура System/390, 32-битная" },
             { "S390X", "Архитектура System/390X, 64-битная" },
             { "HPPA", "Архитектура HP PA-RISC, 32-битная" },
             { "HPPA64", "Архитектура HP PA-RISC, 64-битная" },
             { "SH", "Архитектура SuperH, 32-битная" },
             { "SH64", "Архитектура SuperH, 64-битная" },
             { "Alpha", "Архитектура Alpha" },
             { "LittleEndian", "Порядок байт, наименее значимый первым" },
             { "BigEndian", "Порядок байт, наиболее значимый первым" },
             { "D_Coverage", "Code coverage analysis instrumentation (command line switch -cov) is being generated" },
             { "D_Ddoc", "Ddoc documentation (command line switch -D) is being generated" },
             { "D_InlineAsm_X86", "Inline assembler for X86 is implemented" },
             { "D_InlineAsm_X86_64", "Inline assembler for X86-64 is implemented" },
             { "D_LP64", "Pointers are 64 bits (command line switch -m64)" },
             { "D_PIC", "Position Independent Code (command line switch -fPIC) is being generated" },
             { "D_SIMD", "Vector Extensions are supported" },
             { "unittest", "Unit tests are enabled (command line switch -unittest)" },
             { "D_Version2", "This is a D version 2 compiler" },
             { "none", "Never defined; used to just disable a section of code" },
             { "all", "Always defined; used as the opposite of none" }
         })
         {
             CompletionDataGenerator.AddTextItem(kv.Key, kv.Value);
         }
     }
     else if (Attribute is PragmaAttribute)
     {
         var p = Attribute as PragmaAttribute;
         if (string.IsNullOrEmpty(p.Identifier))
         {
             foreach (var kv in new Dictionary <string, string> {
                 { "lib", "Inserts a directive in the object file to link in" },
                 { "msg", "Prints a message while compiling" },
                 { "startaddress", "Puts a directive into the object file saying that the function specified in the first argument will be the start address for the program" }
             })
             {
                 CompletionDataGenerator.AddTextItem(kv.Key, kv.Value);
             }
         }
     }
     else if (Attribute is Modifier && ((Modifier)Attribute).Token == DTokens.Extern)
     {
         foreach (var kv in new Dictionary <string, string> {
             { "C", "" },
             { "C++", "C++ is reserved for future use" },
             { "D", "" },
             { "Windows", "Implementation Note: for Win32 platforms, Windows and Pascal should exist" },
             { "Pascal", "Implementation Note: for Win32 platforms, Windows and Pascal should exist" },
             { "System", "System is the same as Windows on Windows platforms, and C on other platforms" }
         })
         {
             CompletionDataGenerator.AddTextItem(kv.Key, kv.Value);
         }
     }
 }
        protected override void BuildCompletionDataInternal(IEditorData Editor, string EnteredText)
        {
            IEnumerable <INode> listedItems = null;
            var visibleMembers = MemberFilter.All;

            IStatement curStmt = null;

            if (curBlock == null)
            {
                curBlock = D_Parser.Resolver.TypeResolution.DResolver.SearchBlockAt(Editor.SyntaxTree, Editor.CaretLocation, out curStmt);
            }

            if (curBlock == null)
            {
                return;
            }

            // 1) Get current context the caret is at
            if (parsedBlock == null)
            {
                parsedBlock = FindCurrentCaretContext(
                    Editor.ModuleCode,
                    curBlock,
                    Editor.CaretOffset,
                    Editor.CaretLocation,
                    out trackVars);
            }

            // 2) If in declaration and if node identifier is expected, do not show any data
            if (trackVars == null)
            {
                // --> Happens if no actual declaration syntax given --> Show types/imports/keywords anyway
                visibleMembers = MemberFilter.Imports | MemberFilter.Types | MemberFilter.Keywords;

                listedItems = ItemEnumeration.EnumAllAvailableMembers(curBlock, null, Editor.CaretLocation, Editor.ParseCache, visibleMembers);
            }
            else
            {
                var n  = trackVars.LastParsedObject as INode;
                var dv = n as DVariable;
                if (dv != null && dv.IsAlias && dv.Type == null && trackVars.ExpectingIdentifier)
                {
                    // Show completion because no aliased type has been entered yet
                }
                else if (n != null && string.IsNullOrEmpty(n.Name) && trackVars.ExpectingIdentifier)
                {
                    return;
                }

                else if (trackVars.LastParsedObject is TokenExpression &&
                         DTokens.BasicTypes[(trackVars.LastParsedObject as TokenExpression).Token] &&
                         !string.IsNullOrEmpty(EnteredText) &&
                         IsIdentifierChar(EnteredText[0]))
                {
                    return;
                }

                if (trackVars.LastParsedObject is DAttribute)
                {
                    var attr = trackVars.LastParsedObject as DAttribute;

                    if (attr.IsStorageClass && attr.Token != DTokens.Abstract)
                    {
                        return;
                    }
                }

                if (trackVars.LastParsedObject is ImportStatement)
                {
                    visibleMembers = MemberFilter.Imports;
                }
                else if ((trackVars.LastParsedObject is NewExpression && trackVars.IsParsingInitializer) ||
                         trackVars.LastParsedObject is TemplateInstanceExpression && ((TemplateInstanceExpression)trackVars.LastParsedObject).Arguments == null)
                {
                    visibleMembers = MemberFilter.Imports | MemberFilter.Types;
                }
                else if (EnteredText == " ")
                {
                    return;
                }
                // In class bodies, do not show variables
                else if (!(parsedBlock is BlockStatement || trackVars.IsParsingInitializer))
                {
                    visibleMembers = MemberFilter.Imports | MemberFilter.Types | MemberFilter.Keywords;
                }

                /*
                 * Handle module-scoped things:
                 * When typing a dot without anything following, trigger completion and show types, methods and vars that are located in the module & import scope
                 */
                else if (trackVars.LastParsedObject is TokenExpression &&
                         ((TokenExpression)trackVars.LastParsedObject).Token == DTokens.Dot)
                {
                    visibleMembers = MemberFilter.Methods | MemberFilter.Types | MemberFilter.Variables;
                    curBlock       = Editor.SyntaxTree;
                    curStmt        = null;
                }

                // In a method, parse from the method's start until the actual caret position to get an updated insight
                if (visibleMembers.HasFlag(MemberFilter.Variables) &&
                    curBlock is DMethod &&
                    parsedBlock is BlockStatement)
                {
                    var bs = parsedBlock as BlockStatement;

                    // Insert the updated locals insight.
                    // Do not take the caret location anymore because of the limited parsing of our code.
                    curStmt = bs.SearchStatementDeeply(bs.EndLocation);
                }
                else
                {
                    curStmt = null;
                }



                if (visibleMembers != MemberFilter.Imports)                 // Do not pass the curStmt because we already inserted all updated locals a few lines before!
                {
                    listedItems = ItemEnumeration.EnumAllAvailableMembers(curBlock, curStmt, Editor.CaretLocation, Editor.ParseCache, visibleMembers);
                }
            }

            // Add all found items to the referenced list
            if (listedItems != null)
            {
                foreach (var i in listedItems)
                {
                    if (i is IAbstractSyntaxTree)                     // Modules and stuff will be added later on
                    {
                        continue;
                    }

                    if (CanItemBeShownGenerally(i))
                    {
                        CompletionDataGenerator.Add(i);
                    }
                }
            }

            //TODO: Split the keywords into such that are allowed within block statements and non-block statements
            // Insert typable keywords
            if (visibleMembers.HasFlag(MemberFilter.Keywords))
            {
                foreach (var kv in DTokens.Keywords)
                {
                    CompletionDataGenerator.Add(kv.Key);
                }
            }

            else if (visibleMembers.HasFlag(MemberFilter.Types))
            {
                foreach (var kv in DTokens.BasicTypes_Array)
                {
                    CompletionDataGenerator.Add(kv);
                }
            }

            #region Add module name stubs of importable modules
            if (visibleMembers.HasFlag(MemberFilter.Imports))
            {
                var nameStubs    = new Dictionary <string, string>();
                var availModules = new List <IAbstractSyntaxTree>();

                foreach (var sstmt in Editor.SyntaxTree.StaticStatements)
                {
                    if (sstmt is ImportStatement)
                    {
                        var impStmt = (ImportStatement)sstmt;

                        foreach (var imp in impStmt.Imports)
                        {
                            if (string.IsNullOrEmpty(imp.ModuleAlias))
                            {
                                var id = imp.ModuleIdentifier.ToString();

                                IAbstractSyntaxTree mod = null;
                                foreach (var m in Editor.ParseCache.LookupModuleName(id))
                                {
                                    mod = m;
                                    break;
                                }

                                if (mod == null || string.IsNullOrEmpty(mod.ModuleName))
                                {
                                    continue;
                                }

                                var stub = imp.ModuleIdentifier.InnerMost.ToString();

                                if (!nameStubs.ContainsKey(stub) && !availModules.Contains(mod))
                                {
                                    if (stub == mod.ModuleName)
                                    {
                                        availModules.Add(mod);
                                    }
                                    else
                                    {
                                        nameStubs.Add(stub, GetModulePath(mod.FileName, id.Split('.').Length, 1));
                                    }
                                }
                            }
                        }
                    }
                }

                foreach (var kv in nameStubs)
                {
                    CompletionDataGenerator.Add(kv.Key, null, kv.Value);
                }

                foreach (var mod in availModules)
                {
                    CompletionDataGenerator.Add(mod.ModuleName, mod);
                }
            }
            #endregion
        }
예제 #29
0
 protected override void BuildCompletionDataInternal(IEditorData Editor, char enteredChar)
 {
     CompletionDataGenerator.AddModule(Editor.SyntaxTree, Editor.SyntaxTree.ModuleName);
 }
        protected override void BuildCompletionDataInternal(IEditorData Editor, char enteredChar)
        {
            MemberCompletionEnumeration.EnumAllAvailableMembers(
                CompletionDataGenerator,
                curBlock,
                curStmt,
                Editor.CaretLocation,
                Editor.ParseCache,
                visibleMembers,
                new ConditionalCompilationFlags(Editor));

            //TODO: Split the keywords into such that are allowed within block statements and non-block statements
            // Insert typable keywords
            if ((visibleMembers & MemberFilter.Keywords) != 0)
            {
                foreach (var kv in DTokens.Keywords)
                {
                    CompletionDataGenerator.Add(kv.Key);
                }
            }
            else if ((visibleMembers & MemberFilter.StructsAndUnions) != 0)
            {
                foreach (var kv in DTokens.BasicTypes_Array)
                {
                    CompletionDataGenerator.Add(kv);
                }
            }

            if ((visibleMembers & MemberFilter.Labels) != 0)
            {
                IStatement stmt = curStmt;
                do
                {
                    stmt = stmt.Parent;
                    if (stmt is SwitchStatement)
                    {
                        CompletionDataGenerator.Add(DTokens.Case);
                        CompletionDataGenerator.Add(DTokens.Default);
                        break;
                    }
                } while(stmt != null && stmt.Parent != null);

                if (stmt != null)
                {
                    stmt.Accept(new LabelVisitor(CompletionDataGenerator));
                }
            }

            if ((visibleMembers & MemberFilter.x86Registers) != 0)
            {
                foreach (var kv in AsmRegisterExpression.x86RegisterTable)
                {
                    CompletionDataGenerator.AddTextItem(kv.Key, kv.Value);
                }
            }

            if ((visibleMembers & MemberFilter.x64Registers) != 0)
            {
                foreach (var kv in AsmRegisterExpression.x64RegisterTable)
                {
                    CompletionDataGenerator.AddTextItem(kv.Key, kv.Value);
                }
            }

            if ((visibleMembers & (MemberFilter.x86Registers | MemberFilter.x64Registers)) != 0)
            {
                CompletionDataGenerator.Add(DTokens.__LOCAL_SIZE);

                CompletionDataGenerator.AddTextItem("offsetof", "");
                CompletionDataGenerator.AddTextItem("seg", "The seg means load the segment number that the symbol is in. This is not relevant for flat model code. Instead, do a move from the relevant segment register.");

                // Provide AsmTypePrefixes
                CompletionDataGenerator.AddTextItem("near", "");
                CompletionDataGenerator.AddTextItem("far", "");
                CompletionDataGenerator.AddTextItem("word", "");
                CompletionDataGenerator.AddTextItem("dword", "");
                CompletionDataGenerator.AddTextItem("qword", "");
                CompletionDataGenerator.AddTextItem("ptr", "");
            }

            if ((visibleMembers & MemberFilter.BuiltInPropertyAttributes) != 0)
            {
                foreach (var propAttr in PropertyAttributeCompletionItems)
                {
                    CompletionDataGenerator.AddPropertyAttribute(propAttr);
                }
            }
        }