public InternalFSharpNavigableItem(FSharpNavigableItem item)
 {
     Glyph = FSharpGlyphHelpers.ConvertTo(item.Glyph);
     DisplayTaggedParts = item.DisplayTaggedParts;
     Document           = item.Document;
     SourceSpan         = item.SourceSpan;
 }
Beispiel #2
0
        internal void MapsCorrectly(FSharpGlyph glyph)
        {
            var actual   = FSharpGlyphHelpers.ConvertTo(glyph);
            var expected = GetExpectedGlyph(glyph);

            Assert.Equal(expected, actual);
        }
        public static CompletionItem Create(
            string displayText,
            string displayTextSuffix,
            CompletionItemRules rules,
            FSharpGlyph?glyph = null,
            ImmutableArray <SymbolDisplayPart> description = default,
            string sortText       = null,
            string filterText     = null,
            bool showsWarningIcon = false,
            ImmutableDictionary <string, string> properties = null,
            ImmutableArray <string> tags = default,
            string inlineDescription     = null
            )
        {
            var roslynGlyph = glyph.HasValue
                ? FSharpGlyphHelpers.ConvertTo(glyph.Value)
                : (Glyph?)null;

            return(CommonCompletionItem.Create(
                       displayText,
                       displayTextSuffix,
                       rules,
                       roslynGlyph,
                       description,
                       sortText,
                       filterText,
                       showsWarningIcon,
                       properties,
                       tags,
                       inlineDescription
                       ));
        }
Beispiel #4
0
 private static NavigationBarItem ConvertToNavigationBarItem(FSharpNavigationBarItem item, ITextSnapshot textSnapshot)
 {
     return(new InternalNavigationBarItem(
                item.Text,
                FSharpGlyphHelpers.ConvertTo(item.Glyph),
                NavigationBarItem.GetTrackingSpans(textSnapshot, item.Spans.ToImmutableArrayOrEmpty()),
                ConvertItems(textSnapshot, item.ChildItems),
                item.Indent,
                item.Bolded,
                item.Grayed));
 }
Beispiel #5
0
 private static NavigationBarItem ConvertToNavigationBarItem(FSharpNavigationBarItem item)
 {
     return
         (new InternalNavigationBarItem(
              item.Text,
              FSharpGlyphHelpers.ConvertTo(item.Glyph),
              item.Spans,
              item.ChildItems?.Select(x => ConvertToNavigationBarItem(x)).ToList(),
              item.Indent,
              item.Bolded,
              item.Grayed));
 }
Beispiel #6
0
        private static NavigationBarItem ConvertToNavigationBarItem(FSharpNavigationBarItem item)
        {
            var childItems = item.ChildItems ?? SpecializedCollections.EmptyList <FSharpNavigationBarItem>();

            return(new InternalNavigationBarItem(
                       item.Text,
                       FSharpGlyphHelpers.ConvertTo(item.Glyph),
                       item.Spans.ToImmutableArrayOrEmpty(),
                       childItems.SelectAsArray(x => ConvertToNavigationBarItem(x)),
                       item.Indent,
                       item.Bolded,
                       item.Grayed));
        }
        private static NavigationBarItem ConvertToNavigationBarItem(FSharpNavigationBarItem item, ITextVersion textVersion)
        {
            var spans = item.Spans.ToImmutableArrayOrEmpty();

            return(new SimpleNavigationBarItem(
                       textVersion,
                       item.Text,
                       FSharpGlyphHelpers.ConvertTo(item.Glyph),
                       spans,
                       ConvertItems(item.ChildItems, textVersion),
                       item.Indent,
                       item.Bolded,
                       item.Grayed));
        }
 public FSharpFileSystemCompletionHelper(
     FSharpGlyph folderGlyph,
     FSharpGlyph fileGlyph,
     ImmutableArray <string> searchPaths,
     string baseDirectoryOpt,
     ImmutableArray <string> allowableExtensions,
     CompletionItemRules itemRules)
 {
     _fileSystemCompletionHelper =
         new FileSystemCompletionHelper(
             FSharpGlyphHelpers.ConvertTo(folderGlyph),
             FSharpGlyphHelpers.ConvertTo(fileGlyph),
             searchPaths,
             baseDirectoryOpt,
             allowableExtensions,
             itemRules);
 }
Beispiel #9
0
 public static ImmutableArray <string> GetTags(FSharpGlyph glyph)
 {
     return(GlyphTags.GetTags(FSharpGlyphHelpers.ConvertTo(glyph)));
 }