Beispiel #1
0
 public void Add(PascalABCCompiler.Parsers.SymInfo si, ICompletionData data)
 {
     if (!dict.ContainsKey(si))
     {
         dict[si] = data;
     }
 }
Beispiel #2
0
        public override void Update(PascalABCCompiler.Parsers.SymInfo si)
        {
            ICompletionData val = null;

            if (dict.TryGetValue(si, out val))
            {
                val.Description = si.description;
            }
        }
 public void Add(PascalABCCompiler.Parsers.SymInfo si, ICompletionData data)
 {
     if (!dict.ContainsKey(si))
     {
         dict[si] = data;
     }
     if (!string.IsNullOrEmpty(si.description) && !dict2.ContainsKey(si.description))
     {
         dict2[si.description] = data;
     }
 }
        public override void Update(PascalABCCompiler.Parsers.SymInfo si)
        {
            ICompletionData val = null;

            if (dict.TryGetValue(si, out val))
            {
                val.Description = si.description;
            }
            else if (si.description != null && dict2.TryGetValue(si.description.Split('\n')[0], out val))
            {
                val.Description = si.description;
            }
        }
Beispiel #5
0
        public int GetPictureNum(PascalABCCompiler.Parsers.SymInfo si)
        {
            switch (si.kind)
            {
            case PascalABCCompiler.Parsers.SymbolKind.Field:
                switch (si.acc_mod)
                {
                case PascalABCCompiler.SyntaxTree.access_modifer.private_modifer:
                    return(IconNumberPrivateField);

                case PascalABCCompiler.SyntaxTree.access_modifer.protected_modifer:
                    return(IconNumberProtectedField);

                case PascalABCCompiler.SyntaxTree.access_modifer.internal_modifer:
                    return(IconNumberInternalField);

                default:
                    return(IconNumberField);
                }

            case PascalABCCompiler.Parsers.SymbolKind.Method:
                switch (si.acc_mod)
                {
                case PascalABCCompiler.SyntaxTree.access_modifer.private_modifer:
                    return(IconNumberPrivateMethod);

                case PascalABCCompiler.SyntaxTree.access_modifer.protected_modifer:
                    return(IconNumberProtectedMethod);

                case PascalABCCompiler.SyntaxTree.access_modifer.internal_modifer:
                    return(IconNumberInternalMethod);

                default:
                    if (si.description != null && si.description.Contains("(" + PascalABCCompiler.StringResources.Get("CODE_COMPLETION_EXTENSION")))
                    {
                        return(IconNumberExtensionMethod);
                    }
                    return(IconNumberMethod);
                }

            case PascalABCCompiler.Parsers.SymbolKind.Property:
                switch (si.acc_mod)
                {
                case PascalABCCompiler.SyntaxTree.access_modifer.private_modifer:
                    return(IconNumberPrivateProperty);

                case PascalABCCompiler.SyntaxTree.access_modifer.protected_modifer:
                    return(IconNumberProtectedProperty);

                case PascalABCCompiler.SyntaxTree.access_modifer.internal_modifer:
                    return(IconNumberInternalProperty);

                default:
                    return(IconNumberProperty);
                }

            case PascalABCCompiler.Parsers.SymbolKind.Event:
                switch (si.acc_mod)
                {
                case PascalABCCompiler.SyntaxTree.access_modifer.private_modifer:
                    return(IconNumberPrivateEvent);

                case PascalABCCompiler.SyntaxTree.access_modifer.protected_modifer:
                    return(IconNumberProtectedEvent);

                case PascalABCCompiler.SyntaxTree.access_modifer.internal_modifer:
                    return(IconNumberInternalEvent);

                default:
                    return(IconNumberEvent);
                }

            case PascalABCCompiler.Parsers.SymbolKind.Delegate:
                switch (si.acc_mod)
                {
                case PascalABCCompiler.SyntaxTree.access_modifer.private_modifer:
                    return(IconNumberPrivateDelegate);

                case PascalABCCompiler.SyntaxTree.access_modifer.protected_modifer:
                    return(IconNumberProtectedDelegate);

                case PascalABCCompiler.SyntaxTree.access_modifer.internal_modifer:
                    return(IconNumberInternalDelegate);

                default:
                    return(IconNumberDelegate);
                }

            case PascalABCCompiler.Parsers.SymbolKind.Variable:
            case PascalABCCompiler.Parsers.SymbolKind.Parameter:
                return(IconNumberLocal);

            case PascalABCCompiler.Parsers.SymbolKind.Type:
            case PascalABCCompiler.Parsers.SymbolKind.Class:
                return(IconNumberClass);

            case PascalABCCompiler.Parsers.SymbolKind.Namespace:
                if (si.IsUnitNamespace)
                {
                    return(IconNumberUnitNamespace);
                }
                else
                {
                    return(IconNumberNamespace);
                }

            case PascalABCCompiler.Parsers.SymbolKind.Interface:
                return(IconNumberInterface);

            case PascalABCCompiler.Parsers.SymbolKind.Struct:
                return(IconNumberStruct);

            case PascalABCCompiler.Parsers.SymbolKind.Enum:
                return(IconNumberEnum);

            case PascalABCCompiler.Parsers.SymbolKind.Constant:
                switch (si.acc_mod)
                {
                case PascalABCCompiler.SyntaxTree.access_modifer.private_modifer:
                    return(IconNumberPrivateConstant);

                case PascalABCCompiler.SyntaxTree.access_modifer.protected_modifer:
                    return(IconNumberProtectedConstant);

                case PascalABCCompiler.SyntaxTree.access_modifer.internal_modifer:
                    return(IconNumberInternalConstant);

                default:
                    return(IconNumberConstant);
                }
            }
            return(IconNumberMethod);
        }