Posted 14 years ago by Jason Whitted - Owner, Etalisoft, LLC
Avatar
Is there a simple way to do bracket completion?

The language I am working with uses DO...END blocks and I'd like to be able to autocomplete the END bracket when the user types DO and presses enter.
IF X < 20 THEN
DO|
IF X < 20 THEN
DO
  |
END
I tried watching the KeyTyping event for the enter key and then checking the previous token to see if it is a DO token and then inserting the text; however, this had an undesired effect. I do not want the block to be autocompleted if the user puts their cursor after an already existing DO token and presses enter.

Is there some event I can use to determine when a token is initially typed/parsed? Or will I need to incorporate a KeyTyping buffer?

Comments (1)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Jason,

Probably your idea of a keytyping buffer would be best. Store the last offset that was typed at and compare that with the current one.

Also, since we hope to do some major parsing improvements for the 4.0 version, we're open to any detailed suggestions you'd like to make regarding auto-complete features. By that, I mean what classes/methods/properties/events would you like to see implemented to help you create those features.


Actipro Software Support

The latest build of this product (v2018.1 build 0341) was released 10 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.