
We are beginning to investigate adding a feature to SyntaxEditor that would allow you to reserve space above or below lines so that custom adornments can render in those spaces.
Example usages of this kind of feature in Visual Studio are CodeLens (references, changes, etc. listing above type/member declaration lines) and Peek Definition (shows a nested code editor).
We started this thread since there have been many requests for this feature and we wanted to have a way to communicate with and get feedback from everyone in one central location. Please feel free to offer up ideas and jump in with comments.
Tagging
I think everyone can agree that some sort of text range tagging mechanism is appropriate for this feature. We currently have an IIntraTextSpacerTag interface with Baseline, Key, and Size properties on it. That tag can reserve space between text characters and then you can render adornments in that space. This is shown in our AdornmentsIntraTextNotes QuickStart.
The Visual Studio API has a SpaceNegotiatingAdornmentTag that is similar in concept to our IIntraTextSpacerTag and allows for intra-text spacing and adornments. That tag can also reserve space above or below a line. However when investigating more, it seems like it is NOT used (at least any more) for the VS CodeLens and Peek Definition features, and an InterLineAdornmentTag is used for those instead.
InterLineAdornmentTag is only focused on providing some vertical space either above or below a line. There also seems to be a more basic ILineTransformSource that can reserve space too.
Questions
Have any of you worked with these VS APIs and do you have any input on why they are separate?
How would you like to see it implemented in our product? Should we just add features to IIntraTextSpacerTag (like TopMargin and BottomMargin properties that wouldn't affect text layout on the line) or add another tag for this feature?
Should "top" space be above the line containing the start offset of the tagged range, and "bottom" space be below the line containing the end offset of the tagged range?
If you have multiple tags reserving space for the same line, how would you ensure that UI’s don’t overlay each other?
Would the “top” space be a sum of all top space requested for a line or just the highest top space amount requested?
Actipro Software Support