SublimeText complitions for TD

Here is a solution for code completions in SublimeText code editor.

Requirements:

  1. SublimeText editor installed (https://www.sublimetext.com/)
  2. Set SublimeText as default text editor: TD preferences → DATs → Text editor

Run:

  1. Drop this script into Network editor:
    https://www.404zero.com/share/sublime_TD_Python.py
  2. Ctrl+r or RMB->Run script

Use:

  1. Create new textDAT
  2. Set textDAT Content Language parameter → Python
  3. Ctrl+e or RMB->Edit Content

That’s it:

Notes:

  • Usually it is required to run this script each time after all TD instances were closed.
  • Completions are not semantically correct but definitely speeds up python coding for TD, especially with stuff like:
    op('someOp').inputConnectors[0].connect(op('base1').inputs[0].inputConnectors[1])

Under the hood:
This script do following:

  1. Collects python code examples (OP names, OP members, methods, pars, stuf like ui.panes e.t.c., all project code [optionally] ) and save it as examples.py into TD tmpFolder
  2. Opens TD tmpFolder in SublimeText as a project.
  3. By default SublimeText scans all scripts inside TD tmpFolder automatically to collect completions examples.
  4. Inside script: lines 130-143 to optionally define what to include into examples.py

Cheers,
Alex