public TypeScriptCompletionItem(CompletionEntry entry, CompletionEntryDetailsProvider completionDetailsProvider)
     : base(entry.name)
 {
     this.entry = entry;
     this.completionDetailsProvider = completionDetailsProvider;
     Image = GetImage(entry);
 }
        IImage GetImage(CompletionEntry entry)
        {
            switch (entry.kind)
            {
            case "property":
                return(ClassBrowserIconService.Property);

            case "constructor":
            case "getter":
            case "setter":
            case "method":
            case "function":
            case "local function":
                return(ClassBrowserIconService.Method);

            case "keyword":
                return(ClassBrowserIconService.Keyword);

            case "class":
                return(ClassBrowserIconService.Class);

            case "var":
            case "local var":
                return(ClassBrowserIconService.LocalVariable);

            case "interface":
                return(ClassBrowserIconService.Interface);

            case "module":
                return(ClassBrowserIconService.Namespace);

            default:
                return(null);
            }
        }
示例#3
0
        protected override int InternalCompareTo(CompletionEntry other)
        {
            VersionCompletionEntry otherEntry = other as VersionCompletionEntry;

            // The version completion list should be displayed in descending order.
            int result = -CompareSemanticVersion(SemVersion, otherEntry?.SemVersion);

            return((result == 0) ? base.InternalCompareTo(other) : result);
        }
示例#4
0
        public PythonCompletionData(string name, string fullName, string description, string insertText)
        {
            Name        = fullName;
            Description = description;
            Text        = insertText;

            Example = MacroCommandHelp.ResourceManager.GetString($"{name.ToUpper()}_COMMAND_EXAMPLE");

            Content = new CompletionEntry(fullName, Example);
        }
示例#5
0
        protected override int InternalCompareTo(CompletionEntry other)
        {
            SimpleCompletionEntry otherEntry = other as SimpleCompletionEntry;

            if (_specificVersion != 0 && otherEntry != null)
            {
                return(_specificVersion.CompareTo(otherEntry._specificVersion));
            }

            return(base.InternalCompareTo(other));
        }
        public static string ToHtmlString(this CompletionEntry ce)
        {
            switch (ce)
            {
            case CompletionEntry.Missing:
                return("<span style='color: #f00'>(Missing)</span>");

            default:
                return(string.Empty);
            }
        }
        protected override int InternalCompareTo(CompletionEntry other)
        {
            SimpleCompletionEntry otherEntry = other as SimpleCompletionEntry;

            if(_specificVersion != 0 && otherEntry != null)
            {
                return _specificVersion.CompareTo(otherEntry._specificVersion);
            }

            return base.InternalCompareTo(other);
        }
示例#8
0
            private void NotifyCompletions(PipelineCallbackType callbackType)
            {
                List <CompletionEntry> matchingEntries;

                lock (_entries)
                {
                    matchingEntries = new(_entries.Count);
                    for (int i = 0; i < _entries.Count; i++)
                    {
                        CompletionEntry entry = _entries[i];
                        if (_entries[i].CallbackType == callbackType)
                        {
                            _entries.RemoveAt(i);
                            matchingEntries.Add(entry);
                            i--;
                        }
                    }
                }

                foreach (CompletionEntry entry in matchingEntries)
                {
                    entry.Complete();
                }
            }