protected override bool AddLookupItems(T4CodeCompletionContext context, GroupedItemsCollector collector)
        {
            ITreeNode node = context.BasicContext.File.FindNodeAt(context.BasicContext.SelectedTreeRange);

            Assertion.AssertNotNull(node, "node == null");
            var ranges = context.BasicContext.GetRanges(node);

            collector.AddRanges(ranges);

            foreach (string directiveName in _directiveInfoManager.AllDirectives.Select(di => di.Name))
            {
                var item = new KeywordLookupItem(directiveName);
                item.InitializeRanges(ranges, context.BasicContext);
                collector.AddAtDefaultPlace(item);
            }

            return(true);
        }
        protected override bool AddLookupItems(T4CodeCompletionContext context, GroupedItemsCollector collector)
        {
            ITreeNode node = context.BasicContext.File.FindNodeAt(context.BasicContext.SelectedTreeRange);

            Assertion.AssertNotNull(node, "node == null");
            var ranges = context.BasicContext.GetRanges(node);

            collector.AddRanges(ranges);

            var attribute = node.GetContainingNode <IT4DirectiveAttribute>();

            Assertion.AssertNotNull(attribute, "attribute != null");

            var directive = attribute.GetContainingNode <IT4Directive>();

            Assertion.AssertNotNull(directive, "directive != null");

            DirectiveInfo directiveInfo = _directiveInfoManager.GetDirectiveByName(directive.GetName());

            if (directiveInfo == null)
            {
                return(false);
            }

            DirectiveAttributeInfo attributeInfo = directiveInfo.GetAttributeByName(attribute.GetName());

            if (attributeInfo == null)
            {
                return(false);
            }

            foreach (string intellisenseValue in attributeInfo.IntelliSenseValues)
            {
                var item = new KeywordLookupItem(intellisenseValue);
                item.InitializeRanges(ranges, context.BasicContext);
                collector.AddAtDefaultPlace(item);
            }
            return(true);
        }
        protected override bool AddLookupItems(T4CodeCompletionContext context, GroupedItemsCollector collector)
        {
            ITreeNode node = context.BasicContext.File.FindNodeAt(context.BasicContext.SelectedTreeRange);

            Assertion.AssertNotNull(node, "node == null");
            var ranges = context.BasicContext.GetRanges(node);

            collector.AddRanges(ranges);

            var directive = node.GetContainingNode <IT4Directive>();

            Assertion.AssertNotNull(directive, "directive != null");
            DirectiveInfo directiveInfo = _directiveInfoManager.GetDirectiveByName(directive.GetName());

            if (directiveInfo == null)
            {
                return(false);
            }

            JetHashSet <string> existingNames = directive
                                                .GetAttributes()
                                                .Select(attr => attr.GetName())
                                                .ToHashSet(s => s, StringComparer.OrdinalIgnoreCase);

            foreach (string directiveName in directiveInfo.SupportedAttributes.Select(attr => attr.Name))
            {
                if (existingNames.Contains(directiveName))
                {
                    continue;
                }

                var item = new KeywordLookupItem(directiveName);
                item.InitializeRanges(ranges, context.BasicContext);
                collector.AddAtDefaultPlace(item);
            }

            return(true);
        }