Automatic matching bracket from completion list

SyntaxEditor Python Language Add-on for WPF Forum

Posted 2 years ago by Jane
Version: 22.1.1
Avatar

Hi. We have the Python Add On and when using PythonSyntaxLanguage, I noticed that when typing an opening bracket, it automatically adds the matching closing bracket. I added a custom completion list that has the opening bracket option "[" but when that gets selected/added, it doesn't add the closing bracket automatically. Is there a way for it to recognize it as a typed text instead so it adds the closing bracket automatically too? Thanks.

[Modified 2 years ago]

Comments (2)

Posted 2 years ago by Jane
Avatar

Hi. I figured it out using

CompletionItem(string text, IImageSourceProvider imageSourceProvider, IContentProvider descriptionProvider, string autoCompletePreText, string autoCompletePostText);
Posted 2 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Jane,

Delimiter auto-complete won't really work in that scenario.  But what you can do instead (as you discovered) is to update the post-text of that particular completion item to have "]" so that the "]" is inserted after the caret, which is effectively what you're after.


Actipro Software Support

The latest build of this product (v24.1.2) was released 11 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.