2 people like it.

Visual Studio 2017 extension: Displaying Light Bulb Suggestions

Example follows this, translated to FSharp: https://msdn.microsoft.com/en-us/library/dn903708.aspx Just instead of copy&pasting C#, add a new F# class library and paste this code to there, then add that to reference to your C#-project.

  1: 
  2: 
  3: 
  4: 
  5: 
  6: 
  7: 
  8: 
  9: 
 10: 
 11: 
 12: 
 13: 
 14: 
 15: 
 16: 
 17: 
 18: 
 19: 
 20: 
 21: 
 22: 
 23: 
 24: 
 25: 
 26: 
 27: 
 28: 
 29: 
 30: 
 31: 
 32: 
 33: 
 34: 
 35: 
 36: 
 37: 
 38: 
 39: 
 40: 
 41: 
 42: 
 43: 
 44: 
 45: 
 46: 
 47: 
 48: 
 49: 
 50: 
 51: 
 52: 
 53: 
 54: 
 55: 
 56: 
 57: 
 58: 
 59: 
 60: 
 61: 
 62: 
 63: 
 64: 
 65: 
 66: 
 67: 
 68: 
 69: 
 70: 
 71: 
 72: 
 73: 
 74: 
 75: 
 76: 
 77: 
 78: 
 79: 
 80: 
 81: 
 82: 
 83: 
 84: 
 85: 
 86: 
 87: 
 88: 
 89: 
 90: 
 91: 
 92: 
 93: 
 94: 
 95: 
 96: 
 97: 
 98: 
 99: 
100: 
101: 
102: 
103: 
104: 
105: 
106: 
107: 
108: 
109: 
110: 
111: 
112: 
113: 
114: 
115: 
116: 
117: 
118: 
119: 
120: 
121: 
122: 
123: 
124: 
125: 
126: 
127: 
128: 
129: 
130: 
131: 
132: 
133: 
134: 
135: 
136: 
137: 
138: 
139: 
140: 
141: 
142: 
143: 
144: 
145: 
146: 
147: 
148: 
149: 
150: 
151: 
152: 
153: 
154: 
155: 
// Example follows this, translated to FSharp:
// https://msdn.microsoft.com/en-us/library/dn903708.aspx 

// Just instead of copy&pasting C#, add a new F# class library and paste this code to there,
// then add that to reference to your C#-project.

// If you want to deploy without C# project, see e.g. this:
// You need to use some VSIX-package to deploy the code:
// https://github.com/fsharp-vsix/FsVSIX

// One more thing to get this to work: Open the source.extension.vsixmanifest file
// Go to Assets -> Edit -> Project and change your fsharp dll to dropdown.
// This tells MEF to which dll to use to inject dependencies to Visual Studio.
// Corresponding XML: 
// <Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="..." Path="|...|" />

#if INTERACTIVE
#I @"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VSSDK\VisualStudioIntegration\Common\Assemblies\v4.0\"

#r "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime.dll"
#r "Microsoft.VisualStudio.Language.Intellisense.dll"
#r "Microsoft.VisualStudio.CoreUtility.dll"
#r "Microsoft.VisualStudio.Text.Data.dll"
#r "Microsoft.VisualStudio.Text.Logic.dll"
#r "Microsoft.VisualStudio.Text.UI.dll"
#r "Microsoft.VisualStudio.Text.UI.Wpf.dll"

#I @"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6\"

#r "PresentationFramework.Core.dll"
#r "PresentationFramework.dll"
#r "WindowsBase.dll"

#r "System.ComponentModel.Composition.dll"


#endif
namespace VisualStudioTooltips

open Microsoft.VisualStudio.Imaging.Interop
open System.Windows
open System.Windows.Controls
open System.Windows.Documents
open Microsoft.VisualStudio.Text

open System.Threading.Tasks

open System
open System.Collections.Generic
open Microsoft.VisualStudio.Language.Intellisense
open Microsoft.VisualStudio.Text.Editor
open Microsoft.VisualStudio.Text.Operations
open Microsoft.VisualStudio.Utilities
open System.ComponentModel.Composition

type internal UpperCaseSuggestedAction (span:ITrackingSpan) =
    let snapshot = span.TextBuffer.CurrentSnapshot
    let upper = span.GetText(snapshot).ToUpper()
    let display = sprintf "Convert '%s' to upper case" (span.GetText snapshot)
    
    interface ISuggestedAction with

        member __.GetPreviewAsync (_) =
            let textBlock = TextBlock(Padding = Thickness(5.)) 
            textBlock.Inlines.Add (Run upper)
            Task.FromResult<obj> textBlock
    
        member __.GetActionSetsAsync (_) =
            Task.FromResult<IEnumerable<SuggestedActionSet>>(null)

        member val HasActionSets = false with get
        member val DisplayText = display with get
        member val IconMoniker = Unchecked.defaultof<ImageMoniker> with get
        member val IconAutomationText = Unchecked.defaultof<string> with get
        member val InputGestureText = Unchecked.defaultof<string> with get
        member val HasPreview = true with get

        member __.Invoke (_) =
            span.TextBuffer.Replace(span.GetSpan(snapshot).Span, upper) |> ignore
            ()

        member __.TryGetTelemetryId
                ([<System.Runtime.InteropServices.Out>] telemetryId : Guid byref) =
            telemetryId <- Guid.Empty
            false

        member __.Dispose() = ()

//type internal LowerCaseSuggestedAction : ISuggestedAction

[<Export(typeof<ISuggestedActionsSourceProvider>)>]
[<Name "Test Suggested Actions">]
[<ContentType "text">]
type internal TestSuggestedActionsSourceProvider() as this = 
    [<Import(typeof<ITextStructureNavigatorSelectorService>)>]  
    member val NavigatorService = 
        Unchecked.defaultof<ITextStructureNavigatorSelectorService> with get, set

    interface ISuggestedActionsSourceProvider with 
        member this.CreateSuggestedActionsSource(textView, textBuffer) =
            if textBuffer = null && textView = null then
                Unchecked.defaultof<ISuggestedActionsSource>
            else 
                new TestSuggestedActionsSource(this, textView, textBuffer)
                :> ISuggestedActionsSource


and internal TestSuggestedActionsSource
        ( prov:TestSuggestedActionsSourceProvider, 
          textView:ITextView, textBuffer:ITextBuffer) =

    let event = DelegateEvent<EventHandler<EventArgs>>()

    let tryGetWordUnderCaret() =
        let caret = textView.Caret
        if caret.Position.BufferPosition.Position <= 0 then
            false, Unchecked.defaultof<TextExtent>
        else  
        let point = caret.Position.BufferPosition - 1
        let navigator = prov.NavigatorService.GetTextStructureNavigator textBuffer
        true, navigator.GetExtentOfWord point

    interface ISuggestedActionsSource with 

        member __.HasSuggestedActionsAsync(requestedActionCategories, range, cToken) =
            System.Threading.Tasks.Task.Factory.StartNew(fun () ->
                let ok, extent = tryGetWordUnderCaret()
                if ok then  // don't display the action if the extent has whitespace  
                    extent.IsSignificant
                else false
            )

        member __.GetSuggestedActions(requestedActionCategories, range, cToken) =
            let ok, extent = tryGetWordUnderCaret()
            if ok && extent.IsSignificant then
                let trackingSpan = 
                    range.Snapshot.CreateTrackingSpan(
                        extent.Span.Span, SpanTrackingMode.EdgeInclusive)
                use upperAction = new UpperCaseSuggestedAction(trackingSpan)
                //let lowerAction = LowerCaseSuggestedAction trackingSpan :> ISuggestedAction
                [| (SuggestedActionSet [| upperAction; (* lowerAction *) |]) |] 
                :> IEnumerable<SuggestedActionSet>
            else 
                [||] :> IEnumerable<SuggestedActionSet>

        [<CLIEvent>]
        member __.SuggestedActionsChanged = event.Publish

        member __.TryGetTelemetryId(
                [<System.Runtime.InteropServices.Out>] telemetryId : Guid byref) =
            telemetryId <- Guid.Empty
            false

    interface IDisposable with 
        member __.Dispose() = ()
namespace Microsoft
namespace Microsoft.VisualStudio
namespace Microsoft.VisualStudio.Imaging
namespace Microsoft.VisualStudio.Imaging.Interop
namespace System
namespace System.Windows
namespace System.Windows.Controls
namespace System.Windows.Documents
namespace Microsoft.VisualStudio.Text
namespace System.Threading
namespace System.Threading.Tasks
namespace System.Collections
namespace System.Collections.Generic
namespace Microsoft.VisualStudio.Language
namespace Microsoft.VisualStudio.Language.Intellisense
namespace Microsoft.VisualStudio.Text.Editor
namespace Microsoft.VisualStudio.Text.Operations
namespace Microsoft.VisualStudio.Utilities
namespace System.ComponentModel
namespace System.ComponentModel.Composition
Multiple items
type internal UpperCaseSuggestedAction =
  interface ISuggestedAction
  new : span:ITrackingSpan -> UpperCaseSuggestedAction

Full name: VisualStudioTooltips.UpperCaseSuggestedAction

--------------------
internal new : span:ITrackingSpan -> UpperCaseSuggestedAction
val span : ITrackingSpan
type ITrackingSpan =
  member GetEndPoint : snapshot:ITextSnapshot -> SnapshotPoint
  member GetSpan : snapshot:ITextSnapshot -> SnapshotSpan + 1 overload
  member GetStartPoint : snapshot:ITextSnapshot -> SnapshotPoint
  member GetText : snapshot:ITextSnapshot -> string
  member TextBuffer : ITextBuffer
  member TrackingFidelity : TrackingFidelityMode
  member TrackingMode : SpanTrackingMode

Full name: Microsoft.VisualStudio.Text.ITrackingSpan
val snapshot : ITextSnapshot
property ITrackingSpan.TextBuffer: ITextBuffer
property ITextBuffer.CurrentSnapshot: ITextSnapshot
val upper : string
ITrackingSpan.GetText(snapshot: ITextSnapshot) : string
val display : string
val sprintf : format:Printf.StringFormat<'T> -> 'T

Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.sprintf
type ISuggestedAction =
  member DisplayText : string
  member GetActionSetsAsync : cancellationToken:CancellationToken -> Task<IEnumerable<SuggestedActionSet>>
  member GetPreviewAsync : cancellationToken:CancellationToken -> Task<obj>
  member HasActionSets : bool
  member HasPreview : bool
  member IconAutomationText : string
  member IconMoniker : ImageMoniker
  member InputGestureText : string
  member Invoke : cancellationToken:CancellationToken -> unit

Full name: Microsoft.VisualStudio.Language.Intellisense.ISuggestedAction
override internal UpperCaseSuggestedAction.GetPreviewAsync : Threading.CancellationToken -> Task<obj>

Full name: VisualStudioTooltips.UpperCaseSuggestedAction.GetPreviewAsync
val textBlock : TextBlock
Multiple items
type TextBlock =
  inherit FrameworkElement
  new : unit -> TextBlock + 1 overload
  member Background : Brush with get, set
  member BaselineOffset : float with get, set
  member BreakAfter : LineBreakCondition
  member BreakBefore : LineBreakCondition
  member ContentEnd : TextPointer
  member ContentStart : TextPointer
  member FontFamily : FontFamily with get, set
  member FontSize : float with get, set
  member FontStretch : FontStretch with get, set
  ...

Full name: System.Windows.Controls.TextBlock

--------------------
TextBlock() : unit
TextBlock(inline: Inline) : unit
Multiple items
type Thickness =
  struct
    new : uniformLength:float -> Thickness + 1 overload
    member Bottom : float with get, set
    member Equals : obj:obj -> bool + 1 overload
    member GetHashCode : unit -> int
    member Left : float with get, set
    member Right : float with get, set
    member ToString : unit -> string
    member Top : float with get, set
  end

Full name: System.Windows.Thickness

--------------------
Thickness()
Thickness(uniformLength: float) : unit
Thickness(left: float, top: float, right: float, bottom: float) : unit
property TextBlock.Inlines: InlineCollection
TextElementCollection.Add(item: Inline) : unit
InlineCollection.Add(uiElement: UIElement) : unit
InlineCollection.Add(text: string) : unit
Multiple items
type Run =
  inherit Inline
  new : unit -> Run + 2 overloads
  member ShouldSerializeText : manager:XamlDesignerSerializationManager -> bool
  member Text : string with get, set
  static val TextProperty : DependencyProperty

Full name: System.Windows.Documents.Run

--------------------
Run() : unit
Run(text: string) : unit
Run(text: string, insertionPosition: TextPointer) : unit
Multiple items
type Task =
  new : action:Action -> Task + 7 overloads
  member AsyncState : obj
  member ContinueWith : continuationAction:Action<Task> -> Task + 9 overloads
  member CreationOptions : TaskCreationOptions
  member Dispose : unit -> unit
  member Exception : AggregateException
  member Id : int
  member IsCanceled : bool
  member IsCompleted : bool
  member IsFaulted : bool
  ...

Full name: System.Threading.Tasks.Task

--------------------
type Task<'TResult> =
  inherit Task
  new : function:Func<'TResult> -> Task<'TResult> + 7 overloads
  member ContinueWith : continuationAction:Action<Task<'TResult>> -> Task + 9 overloads
  member Result : 'TResult with get, set
  static member Factory : TaskFactory<'TResult>

Full name: System.Threading.Tasks.Task<_>

--------------------
Task(action: Action) : unit
Task(action: Action, cancellationToken: Threading.CancellationToken) : unit
Task(action: Action, creationOptions: TaskCreationOptions) : unit
Task(action: Action<obj>, state: obj) : unit
Task(action: Action, cancellationToken: Threading.CancellationToken, creationOptions: TaskCreationOptions) : unit
Task(action: Action<obj>, state: obj, cancellationToken: Threading.CancellationToken) : unit
Task(action: Action<obj>, state: obj, creationOptions: TaskCreationOptions) : unit
Task(action: Action<obj>, state: obj, cancellationToken: Threading.CancellationToken, creationOptions: TaskCreationOptions) : unit

--------------------
Task(function: Func<'TResult>) : unit
Task(function: Func<'TResult>, cancellationToken: Threading.CancellationToken) : unit
Task(function: Func<'TResult>, creationOptions: TaskCreationOptions) : unit
Task(function: Func<obj,'TResult>, state: obj) : unit
Task(function: Func<'TResult>, cancellationToken: Threading.CancellationToken, creationOptions: TaskCreationOptions) : unit
Task(function: Func<obj,'TResult>, state: obj, cancellationToken: Threading.CancellationToken) : unit
Task(function: Func<obj,'TResult>, state: obj, creationOptions: TaskCreationOptions) : unit
Task(function: Func<obj,'TResult>, state: obj, cancellationToken: Threading.CancellationToken, creationOptions: TaskCreationOptions) : unit
type obj = Object

Full name: Microsoft.FSharp.Core.obj
val __ : UpperCaseSuggestedAction
override internal UpperCaseSuggestedAction.GetActionSetsAsync : Threading.CancellationToken -> Task<IEnumerable<SuggestedActionSet>>

Full name: VisualStudioTooltips.UpperCaseSuggestedAction.GetActionSetsAsync
type IEnumerable<'T> =
  member GetEnumerator : unit -> IEnumerator<'T>

Full name: System.Collections.Generic.IEnumerable<_>
Multiple items
type SuggestedActionSet =
  new : actions:IEnumerable<ISuggestedAction> * ?priority:SuggestedActionSetPriority * ?applicableToSpan:Nullable<Span> -> SuggestedActionSet + 1 overload
  member Actions : IEnumerable<ISuggestedAction> with get, set
  member ApplicableToSpan : Nullable<Span> with get, set
  member Priority : SuggestedActionSetPriority with get, set
  member Title : obj with get, set

Full name: Microsoft.VisualStudio.Language.Intellisense.SuggestedActionSet

--------------------
SuggestedActionSet(actions: IEnumerable<ISuggestedAction>, ?priority: SuggestedActionSetPriority, ?applicableToSpan: Nullable<Span>) : unit
SuggestedActionSet(actions: IEnumerable<ISuggestedAction>, title: obj, ?priority: SuggestedActionSetPriority, ?applicableToSpan: Nullable<Span>) : unit
module Unchecked

from Microsoft.FSharp.Core.Operators
val defaultof<'T> : 'T

Full name: Microsoft.FSharp.Core.Operators.Unchecked.defaultof
type ImageMoniker =
  struct
    val Guid : Guid
    val Id : int
  end

Full name: Microsoft.VisualStudio.Imaging.Interop.ImageMoniker
Multiple items
val string : value:'T -> string

Full name: Microsoft.FSharp.Core.Operators.string

--------------------
type string = String

Full name: Microsoft.FSharp.Core.string
override internal UpperCaseSuggestedAction.Invoke : Threading.CancellationToken -> unit

Full name: VisualStudioTooltips.UpperCaseSuggestedAction.Invoke
ITextBuffer.Replace(replaceSpan: Span, replaceWith: string) : ITextSnapshot
ITrackingSpan.GetSpan(version: ITextVersion) : Span
ITrackingSpan.GetSpan(snapshot: ITextSnapshot) : SnapshotSpan
Multiple items
type Span =
  struct
    new : start:int * length:int -> Span
    member Contains : position:int -> bool + 1 overload
    member End : int
    member Equals : obj:obj -> bool
    member GetHashCode : unit -> int
    member Intersection : span:Span -> Nullable<Span>
    member IntersectsWith : span:Span -> bool
    member IsEmpty : bool
    member Length : int
    member Overlap : span:Span -> Nullable<Span>
    ...
  end

Full name: Microsoft.VisualStudio.Text.Span

--------------------
Span()
Span(start: int, length: int) : unit
val ignore : value:'T -> unit

Full name: Microsoft.FSharp.Core.Operators.ignore
override internal UpperCaseSuggestedAction.TryGetTelemetryId : telemetryId:byref<Guid> -> bool

Full name: VisualStudioTooltips.UpperCaseSuggestedAction.TryGetTelemetryId
namespace System.Runtime
namespace System.Runtime.InteropServices
Multiple items
type OutAttribute =
  inherit Attribute
  new : unit -> OutAttribute

Full name: System.Runtime.InteropServices.OutAttribute

--------------------
Runtime.InteropServices.OutAttribute() : unit
val telemetryId : byref<Guid>
Multiple items
type Guid =
  struct
    new : b:byte[] -> Guid + 4 overloads
    member CompareTo : value:obj -> int + 1 overload
    member Equals : o:obj -> bool + 1 overload
    member GetHashCode : unit -> int
    member ToByteArray : unit -> byte[]
    member ToString : unit -> string + 2 overloads
    static val Empty : Guid
    static member NewGuid : unit -> Guid
    static member Parse : input:string -> Guid
    static member ParseExact : input:string * format:string -> Guid
    ...
  end

Full name: System.Guid

--------------------
Guid()
Guid(b: byte []) : unit
Guid(g: string) : unit
Guid(a: int, b: int16, c: int16, d: byte []) : unit
Guid(a: uint32, b: uint16, c: uint16, d: byte, e: byte, f: byte, g: byte, h: byte, i: byte, j: byte, k: byte) : unit
Guid(a: int, b: int16, c: int16, d: byte, e: byte, f: byte, g: byte, h: byte, i: byte, j: byte, k: byte) : unit
type byref<'T> = (# "<Common IL Type Omitted>" #)

Full name: Microsoft.FSharp.Core.byref<_>
field Guid.Empty
override internal UpperCaseSuggestedAction.Dispose : unit -> unit

Full name: VisualStudioTooltips.UpperCaseSuggestedAction.Dispose
Multiple items
type ExportAttribute =
  inherit Attribute
  new : unit -> ExportAttribute + 3 overloads
  member ContractName : string with get, set
  member ContractType : Type with get, set

Full name: System.ComponentModel.Composition.ExportAttribute

--------------------
ExportAttribute() : unit
ExportAttribute(contractType: Type) : unit
ExportAttribute(contractName: string) : unit
ExportAttribute(contractName: string, contractType: Type) : unit
val typeof<'T> : Type

Full name: Microsoft.FSharp.Core.Operators.typeof
type ISuggestedActionsSourceProvider =
  member CreateSuggestedActionsSource : textView:ITextView * textBuffer:ITextBuffer -> ISuggestedActionsSource

Full name: Microsoft.VisualStudio.Language.Intellisense.ISuggestedActionsSourceProvider
Multiple items
type NameAttribute =
  inherit SingletonBaseMetadataAttribute
  new : name:string -> NameAttribute
  member Name : string

Full name: Microsoft.VisualStudio.Utilities.NameAttribute

--------------------
NameAttribute(name: string) : unit
Multiple items
type ContentTypeAttribute =
  inherit MultipleBaseMetadataAttribute
  new : name:string -> ContentTypeAttribute
  member ContentTypes : string

Full name: Microsoft.VisualStudio.Utilities.ContentTypeAttribute

--------------------
ContentTypeAttribute(name: string) : unit
Multiple items
type internal TestSuggestedActionsSourceProvider =
  interface ISuggestedActionsSourceProvider
  new : unit -> TestSuggestedActionsSourceProvider
  member NavigatorService : ITextStructureNavigatorSelectorService
  member NavigatorService : ITextStructureNavigatorSelectorService with set

Full name: VisualStudioTooltips.TestSuggestedActionsSourceProvider

--------------------
internal new : unit -> TestSuggestedActionsSourceProvider
val this : TestSuggestedActionsSourceProvider
Multiple items
type ImportAttribute =
  inherit Attribute
  new : unit -> ImportAttribute + 3 overloads
  member AllowDefault : bool with get, set
  member AllowRecomposition : bool with get, set
  member ContractName : string with get, set
  member ContractType : Type with get, set
  member RequiredCreationPolicy : CreationPolicy with get, set

Full name: System.ComponentModel.Composition.ImportAttribute

--------------------
ImportAttribute() : unit
ImportAttribute(contractType: Type) : unit
ImportAttribute(contractName: string) : unit
ImportAttribute(contractName: string, contractType: Type) : unit
type ITextStructureNavigatorSelectorService =
  member CreateTextStructureNavigator : textBuffer:ITextBuffer * contentType:IContentType -> ITextStructureNavigator
  member GetTextStructureNavigator : textBuffer:ITextBuffer -> ITextStructureNavigator

Full name: Microsoft.VisualStudio.Text.Operations.ITextStructureNavigatorSelectorService
val set : elements:seq<'T> -> Set<'T> (requires comparison)

Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.set
override internal TestSuggestedActionsSourceProvider.CreateSuggestedActionsSource : textView:ITextView * textBuffer:ITextBuffer -> ISuggestedActionsSource

Full name: VisualStudioTooltips.TestSuggestedActionsSourceProvider.CreateSuggestedActionsSource
val textView : ITextView
val textBuffer : ITextBuffer
type ISuggestedActionsSource =
  member GetSuggestedActions : requestedActionCategories:ISuggestedActionCategorySet * range:SnapshotSpan * cancellationToken:CancellationToken -> IEnumerable<SuggestedActionSet>
  member HasSuggestedActionsAsync : requestedActionCategories:ISuggestedActionCategorySet * range:SnapshotSpan * cancellationToken:CancellationToken -> Task<bool>
  event SuggestedActionsChanged : EventHandler<EventArgs>

Full name: Microsoft.VisualStudio.Language.Intellisense.ISuggestedActionsSource
Multiple items
type internal TestSuggestedActionsSource =
  interface IDisposable
  interface ISuggestedActionsSource
  new : prov:TestSuggestedActionsSourceProvider * textView:ITextView * textBuffer:ITextBuffer -> TestSuggestedActionsSource

Full name: VisualStudioTooltips.TestSuggestedActionsSource

--------------------
internal new : prov:TestSuggestedActionsSourceProvider * textView:ITextView * textBuffer:ITextBuffer -> TestSuggestedActionsSource
val prov : TestSuggestedActionsSourceProvider
type ITextView =
  member BufferGraph : IBufferGraph
  member Caret : ITextCaret
  member Close : unit -> unit
  member DisplayTextLineContainingBufferPosition : bufferPosition:SnapshotPoint * verticalDistance:float * relativeTo:ViewRelativePosition -> unit + 1 overload
  member GetTextElementSpan : point:SnapshotPoint -> SnapshotSpan
  member GetTextViewLineContainingBufferPosition : bufferPosition:SnapshotPoint -> ITextViewLine
  member HasAggregateFocus : bool
  member InLayout : bool
  member IsClosed : bool
  member IsMouseOverViewOrAdornments : bool
  ...

Full name: Microsoft.VisualStudio.Text.Editor.ITextView
type ITextBuffer =
  member ChangeContentType : newContentType:IContentType * editTag:obj -> unit
  member CheckEditAccess : unit -> bool
  member ContentType : IContentType
  member CreateEdit : unit -> ITextEdit + 1 overload
  member CreateReadOnlyRegionEdit : unit -> IReadOnlyRegionEdit
  member CurrentSnapshot : ITextSnapshot
  member Delete : deleteSpan:Span -> ITextSnapshot
  member EditInProgress : bool
  member GetReadOnlyExtents : span:Span -> NormalizedSpanCollection
  member Insert : position:int * text:string -> ITextSnapshot
  ...

Full name: Microsoft.VisualStudio.Text.ITextBuffer
val event : DelegateEvent<EventHandler<EventArgs>>
Multiple items
type DelegateEvent<'Delegate (requires 'Delegate :> Delegate)> =
  new : unit -> DelegateEvent<'Delegate>
  member Trigger : args:obj [] -> unit
  member Publish : IDelegateEvent<'Delegate>

Full name: Microsoft.FSharp.Control.DelegateEvent<_>

--------------------
new : unit -> DelegateEvent<'Delegate>
Multiple items
type EventHandler =
  delegate of obj * EventArgs -> unit

Full name: System.EventHandler

--------------------
type EventHandler<'TEventArgs (requires 'TEventArgs :> EventArgs)> =
  delegate of obj * 'TEventArgs -> unit

Full name: System.EventHandler<_>
Multiple items
type EventArgs =
  new : unit -> EventArgs
  static val Empty : EventArgs

Full name: System.EventArgs

--------------------
EventArgs() : unit
val tryGetWordUnderCaret : (unit -> bool * TextExtent)
val caret : ITextCaret
property ITextView.Caret: ITextCaret
property ITextCaret.Position: CaretPosition
property CaretPosition.BufferPosition: SnapshotPoint
property SnapshotPoint.Position: int
Multiple items
type TextExtent =
  struct
    new : textExtent:TextExtent -> TextExtent + 1 overload
    member Equals : obj:obj -> bool
    member GetHashCode : unit -> int
    member IsSignificant : bool
    member Span : SnapshotSpan
  end

Full name: Microsoft.VisualStudio.Text.Operations.TextExtent

--------------------
TextExtent()
TextExtent(textExtent: TextExtent) : unit
TextExtent(span: SnapshotSpan, isSignificant: bool) : unit
val point : SnapshotPoint
val navigator : ITextStructureNavigator
property TestSuggestedActionsSourceProvider.NavigatorService: ITextStructureNavigatorSelectorService
ITextStructureNavigatorSelectorService.GetTextStructureNavigator(textBuffer: ITextBuffer) : ITextStructureNavigator
ITextStructureNavigator.GetExtentOfWord(currentPosition: SnapshotPoint) : TextExtent
override internal TestSuggestedActionsSource.HasSuggestedActionsAsync : requestedActionCategories:ISuggestedActionCategorySet * range:SnapshotSpan * cToken:Threading.CancellationToken -> Task<bool>

Full name: VisualStudioTooltips.TestSuggestedActionsSource.HasSuggestedActionsAsync
val requestedActionCategories : ISuggestedActionCategorySet
val range : SnapshotSpan
val cToken : Threading.CancellationToken
Multiple items
type Task<'TResult> =
  inherit Task
  new : function:Func<'TResult> -> Task<'TResult> + 7 overloads
  member ContinueWith : continuationAction:Action<Task<'TResult>> -> Task + 9 overloads
  member Result : 'TResult with get, set
  static member Factory : TaskFactory<'TResult>

Full name: System.Threading.Tasks.Task<_>

--------------------
type Task =
  new : action:Action -> Task + 7 overloads
  member AsyncState : obj
  member ContinueWith : continuationAction:Action<Task> -> Task + 9 overloads
  member CreationOptions : TaskCreationOptions
  member Dispose : unit -> unit
  member Exception : AggregateException
  member Id : int
  member IsCanceled : bool
  member IsCompleted : bool
  member IsFaulted : bool
  ...

Full name: System.Threading.Tasks.Task

--------------------
Task(function: Func<'TResult>) : unit
Task(function: Func<'TResult>, cancellationToken: Threading.CancellationToken) : unit
Task(function: Func<'TResult>, creationOptions: TaskCreationOptions) : unit
Task(function: Func<obj,'TResult>, state: obj) : unit
Task(function: Func<'TResult>, cancellationToken: Threading.CancellationToken, creationOptions: TaskCreationOptions) : unit
Task(function: Func<obj,'TResult>, state: obj, cancellationToken: Threading.CancellationToken) : unit
Task(function: Func<obj,'TResult>, state: obj, creationOptions: TaskCreationOptions) : unit
Task(function: Func<obj,'TResult>, state: obj, cancellationToken: Threading.CancellationToken, creationOptions: TaskCreationOptions) : unit

--------------------
Task(action: Action) : unit
Task(action: Action, cancellationToken: Threading.CancellationToken) : unit
Task(action: Action, creationOptions: TaskCreationOptions) : unit
Task(action: Action<obj>, state: obj) : unit
Task(action: Action, cancellationToken: Threading.CancellationToken, creationOptions: TaskCreationOptions) : unit
Task(action: Action<obj>, state: obj, cancellationToken: Threading.CancellationToken) : unit
Task(action: Action<obj>, state: obj, creationOptions: TaskCreationOptions) : unit
Task(action: Action<obj>, state: obj, cancellationToken: Threading.CancellationToken, creationOptions: TaskCreationOptions) : unit
Multiple items
property Task.Factory: TaskFactory

--------------------
property Task.Factory: TaskFactory<'TResult>
Multiple items
TaskFactory.StartNew<'TResult>(function: Func<'TResult>) : Task<'TResult>
   (+0 other overloads)
TaskFactory.StartNew(action: Action) : Task
   (+0 other overloads)
TaskFactory.StartNew<'TResult>(function: Func<obj,'TResult>, state: obj) : Task<'TResult>
   (+0 other overloads)
TaskFactory.StartNew<'TResult>(function: Func<'TResult>, creationOptions: TaskCreationOptions) : Task<'TResult>
   (+0 other overloads)
TaskFactory.StartNew<'TResult>(function: Func<'TResult>, cancellationToken: Threading.CancellationToken) : Task<'TResult>
   (+0 other overloads)
TaskFactory.StartNew(action: Action<obj>, state: obj) : Task
   (+0 other overloads)
TaskFactory.StartNew(action: Action, creationOptions: TaskCreationOptions) : Task
   (+0 other overloads)
TaskFactory.StartNew(action: Action, cancellationToken: Threading.CancellationToken) : Task
   (+0 other overloads)
TaskFactory.StartNew<'TResult>(function: Func<obj,'TResult>, state: obj, creationOptions: TaskCreationOptions) : Task<'TResult>
   (+0 other overloads)
TaskFactory.StartNew<'TResult>(function: Func<obj,'TResult>, state: obj, cancellationToken: Threading.CancellationToken) : Task<'TResult>
   (+0 other overloads)

--------------------
TaskFactory.StartNew(function: Func<'TResult>) : Task<'TResult>
TaskFactory.StartNew(function: Func<obj,'TResult>, state: obj) : Task<'TResult>
TaskFactory.StartNew(function: Func<'TResult>, creationOptions: TaskCreationOptions) : Task<'TResult>
TaskFactory.StartNew(function: Func<'TResult>, cancellationToken: Threading.CancellationToken) : Task<'TResult>
TaskFactory.StartNew(function: Func<obj,'TResult>, state: obj, creationOptions: TaskCreationOptions) : Task<'TResult>
TaskFactory.StartNew(function: Func<obj,'TResult>, state: obj, cancellationToken: Threading.CancellationToken) : Task<'TResult>
TaskFactory.StartNew(function: Func<'TResult>, cancellationToken: Threading.CancellationToken, creationOptions: TaskCreationOptions, scheduler: TaskScheduler) : Task<'TResult>
TaskFactory.StartNew(function: Func<obj,'TResult>, state: obj, cancellationToken: Threading.CancellationToken, creationOptions: TaskCreationOptions, scheduler: TaskScheduler) : Task<'TResult>
val ok : bool
val extent : TextExtent
property TextExtent.IsSignificant: bool
val __ : TestSuggestedActionsSource
override internal TestSuggestedActionsSource.GetSuggestedActions : requestedActionCategories:ISuggestedActionCategorySet * range:SnapshotSpan * cToken:Threading.CancellationToken -> IEnumerable<SuggestedActionSet>

Full name: VisualStudioTooltips.TestSuggestedActionsSource.GetSuggestedActions
val trackingSpan : ITrackingSpan
property SnapshotSpan.Snapshot: ITextSnapshot
ITextSnapshot.CreateTrackingSpan(span: Span, trackingMode: SpanTrackingMode) : ITrackingSpan
ITextSnapshot.CreateTrackingSpan(start: int, length: int, trackingMode: SpanTrackingMode) : ITrackingSpan
ITextSnapshot.CreateTrackingSpan(span: Span, trackingMode: SpanTrackingMode, trackingFidelity: TrackingFidelityMode) : ITrackingSpan
ITextSnapshot.CreateTrackingSpan(start: int, length: int, trackingMode: SpanTrackingMode, trackingFidelity: TrackingFidelityMode) : ITrackingSpan
property TextExtent.Span: SnapshotSpan
property SnapshotSpan.Span: Span
type SpanTrackingMode =
  | EdgeExclusive = 0
  | EdgeInclusive = 1
  | EdgePositive = 2
  | EdgeNegative = 3
  | Custom = 4

Full name: Microsoft.VisualStudio.Text.SpanTrackingMode
field SpanTrackingMode.EdgeInclusive = 1
val upperAction : UpperCaseSuggestedAction
Multiple items
type CLIEventAttribute =
  inherit Attribute
  new : unit -> CLIEventAttribute

Full name: Microsoft.FSharp.Core.CLIEventAttribute

--------------------
new : unit -> CLIEventAttribute
override internal TestSuggestedActionsSource.SuggestedActionsChanged : IDelegateEvent<EventHandler<EventArgs>>

Full name: VisualStudioTooltips.TestSuggestedActionsSource.SuggestedActionsChanged
property DelegateEvent.Publish: IDelegateEvent<EventHandler<EventArgs>>
override internal TestSuggestedActionsSource.TryGetTelemetryId : telemetryId:byref<Guid> -> bool

Full name: VisualStudioTooltips.TestSuggestedActionsSource.TryGetTelemetryId
type IDisposable =
  member Dispose : unit -> unit

Full name: System.IDisposable
override internal TestSuggestedActionsSource.Dispose : unit -> unit

Full name: VisualStudioTooltips.TestSuggestedActionsSource.Dispose
Raw view New version

More information

Link:http://fssnip.net/7SQ
Posted:4 months ago
Author:Tuomas Hietanen
Tags: extension , plugin , visual studio