Intra-Text Adornment Location - No multiline support

SyntaxEditor for WPF Forum

The latest build of this product (v25.1.0) was released 18 days ago, which was before this thread was created.
Posted 12 days ago by Dirk Zellerfeld
Version: 25.1.0
Platform: .NET 6
Environment: Windows 11 (64-bit)
Avatar

(FYI: The platform version selection here on the forum needs to be updated. It only goes up to .NET 6.0) I've tried to newest version because I'm excited about the Intra-Text Adornment Location feature. I want to show AI code suggestions but I have the issue that only single line is supported.

For example the user types:

public class Car

and I create a tag which suggests:

public class Car {

public string Model { get; set; }

public string Vendor { get; set; }

}

In the UI of the syntax editor all of this would appear within (around) the current line. It doesn't adds the extra space below this line. Changing the location in AddAdornment doesn't help. It still overlaps with the content of the lines above/below the current. Here are screenshots: https://imgur.com/a/WqYpimk https://imgur.com/a/o56Icrx

Comments (6)

Posted 12 days ago by Dirk Zellerfeld
Avatar

There is also another issue. Current line is:

this is a new floor you have

and the cursor is after the "a" and I'd like to add an adorsement which suggests (adding " very nice"):

this is a very nice new floor you have

all of the existing characters to the right are not moved. The adorsement would be overlapping with the existing text to the right.

[Modified 12 days ago]

Posted 11 days ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Dirk,

There are two features of SyntaxEditor you want to use, intra-text adornments and intra-line adornments

Intra-line adornments let you render within a single line.  New features in v25.1 allow you to put the adornment after the tagged range instead of before, which is useful for AI-prompts at the end of a line.  If your intra-text adornment needs to be in the middle of a line, you can set the spacer's Size.  That will solve the followup question you had.

For injecting prompts for new lines, you'd want to use intra-line adornments.  In your specific example of typing "public class Car", you'd have an intra-text adornment of " {" and an intra-line adornment with the 3 lines after that.  Your first post was running into problems because an intra-text adornment is just for a single line.

I hope that points in you the right direction.


Actipro Software Support

Posted 11 days ago by Dirk Zellerfeld
Avatar

If I set the spacer's size it only moves the adornment. I just cant get it to move the existing chars to the right so the adornment is between the current carret position and the next char to the right.

Maybe I'm doing something wrong. Perhaps in an upcoming version you can add samples for these two cases

Posted 11 days ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Dirk,

Our AdornmentsIntraTextNotes QuickStart shows use of the tag.Size property to reserve space where a button adornment can render.  You'll see that characters on the same line after that taggged range will slide right to accommodate the space.

If you look at that and still can't get it working on your end, please make a new simple sample project showing the issue and send that to our support address.  Be sure to exclude the bin/obj folders from the .zip so it isn't spam blocked.  Thanks!


Actipro Software Support

Posted 10 days ago by Dirk Zellerfeld
Avatar

Ok, it needs more self-written code than I expected. How can I determine the width of the size? It needs to be the width that the text would use in the syntax editor, but how can I determine the value from the code?

[Modified 10 days ago]

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

Hi Dirk,

Please check out the CollapsedRegionsAdvanced QuickStart as it shows how to inject a text-oriented adornment and it measures the size to do so appropriately.


Actipro Software Support

Add Comment

Please log in to a validated account to post comments.