// Internal for testing
        internal static List <RazorCompletionItem> GetDirectiveCompletionItems(RazorSyntaxTree syntaxTree)
        {
            var directives      = syntaxTree.Options.Directives.Concat(DefaultDirectives);
            var completionItems = new List <RazorCompletionItem>();

            foreach (var directive in directives)
            {
                var completionDisplayText = directive.DisplayName ?? directive.Directive;
                var completionItem        = new RazorCompletionItem(
                    completionDisplayText,
                    directive.Directive,
                    directive.Description,
                    RazorCompletionItemKind.Directive);
                completionItems.Add(completionItem);
            }

            return(completionItems);
        }
 private static void AssertRazorCompletionItem(DirectiveDescriptor directive, RazorCompletionItem item) =>
 AssertRazorCompletionItem(directive.Directive, directive, item);
 private static void AssertRazorCompletionItem(string completionDisplayText, DirectiveDescriptor directive, RazorCompletionItem item)
 {
     Assert.Equal(item.DisplayText, completionDisplayText);
     Assert.Equal(item.InsertText, directive.Directive);
     Assert.Equal(directive.Description, item.Description);
 }