Ted2Go.tips: Code templates

Code templates

  1. Use Tab or mouse-click to choose template from completion list.
  2. You can add/remove your own templates in Preferences — CodeTemplates section.
  3. Templates showing in completion even for ‘unknown’ vars (local variables).
  4. We can specify ‘where’ to show templates by adding dot-prefixes:
    • Without dots – shows only for single idents like abc
    • Single dot . – shows for any idents: single like abc ; and dot-separated like abc.def
    • Double-dot ..– shows only for dot-separated idents like abc.def
  5. Dots are used just for definition not for typing in code.

Examples

"..adc":
"AddComponent<${Cursor}>()", 

"..gec":
"GetComponent<${Cursor}>()", 

"each":
"For Local ${Cursor}:=Eachin _

Next", 

".len":
"Length"

(^ it’s a part of json, internal presentations of templates ^)

If we typed on a new line adc we can’t see ..adc template in completion because double-dots prefix require instanse.
But abrakadabra.a shows us adc template in the list, and we can insert AddComponent<>() by pressing Tab.

.len will work for both len and arr.len cases.

And each template will work when it typed as a single ident and will don’t work for myVar.each.

ted2go_code_templ

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s