fsprojects-archive / zzarchive-VisualFSharpPowerTools

[ARCHIVED] Power commands for F# in Visual Studio
http://fsprojects.github.io/VisualFSharpPowerTools/
Apache License 2.0
310 stars 77 forks source link

Outlining -> FSharp.Editing #1409

Open cloudRoutine opened 7 years ago

cloudRoutine commented 7 years ago

If we want to move the hint text generation into core to enable other editors to take advantage of this feature we cannot depend on SnapshotSpan, SnapshotPoint, ITextSnapshotLine, ITextDocument, the ProjectProvider etc. If we send the text of the file's snapshot to Core this should work, dirty or not.

The Outlining functionality in Core will generate a collection of a type similar to ScopeRange that includes the hint text and hint range/span which will be sent back to the Logic/VsIntegration side. Most of the code in createTagSpan will need to move into Core except creating the buffer and the TagSpan. Logic/VsIntegration project will still handle the filtering, tag generation, and tooltips, but ScopeSpan should probably be changed to store the hint text that way createTagSpan becomes a simple transformation function to the data shape that VS requires.

It could be worthwhile to move the filtering to Core in the future if we decide to enable passing it configuration settings, but this is not a priority.

Code Located @ https://github.com/fsprojects/VisualFSharpPowerTools/blob/master/src/FSharp.Editing.VisualStudio/Outlining/OutliningTagger.fs