IntraText Adornment Position range includes the last character of the line

SyntaxEditor for WPF Forum

Posted 10 months ago by Stefano
Version: 24.1.2
Avatar

Hello,

I'm implementing an AI code autocompletion using both IntraText and IntraLine features. 
For the IntraText I want to render the proposed code on the current line after the user code, like VS does.
Then I should handle updates based on what the user writes, if what the user is typing still matches the proposed completion I keep it and update it to remove the same characters the user typed, if not I remove the adornments.


I'm following the example "Adornments 6 - Code Reviewing", but I noticed that the TextSnapshotRange created includes the last character of the line.
So it is not possible to have the caret be in between the user code and the adornment.

So it can be either

public class ActiproTest [Caret here]{[adornment here]

or

public class ActiproTest {[adornment here][Caret here]

I would like to have it like this

public class ActiproTest {[Caret here][adornment here]

This is also particularly noticeable when a WordHighlightTagger (example "Adornments 4 - Highlight Word") is registered,
because the highlight covers also the IntraText adornment.

Can you guys help me here?

Thanks in advance. 

 

[Modified 10 months ago]

Comments (1)

Posted 10 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Stefano,

Intra-text adornments are currently coded to always appear right before the start offset of their tagged text range.  We don't have any options at the moment to shift the adornment location to the end of the tagged tet range instead, which I believe is what you'd need for this.  Doing a quick examination of our intra-text adornment code, there are a lot of areas that would need updating and heavy testing to support that kind of feature, and a new option for it would have to be added to IIntraTextSpacerTag, which would technically be a breaking change.

I've written the request down as a suggestion for possible future implementation.  I can't give you a target date since we have other priorities that we are working on at the moment.  If this is something you'd need sooner than later, we have an option where customers can contract us to add a feature they require.  Feel free to write our support address and mention this thread is that is an option you'd like to pursue.


Actipro Software Support

The latest build of this product (v24.1.5) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.