ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Text​Debugging

Adds prinf-style debugging.

Details

Installs

  • Total 2K
  • Win 2K
  • Mac 234
  • Linux 316
May 30 May 29 May 28 May 27 May 26 May 25 May 24 May 23 May 22 May 21 May 20 May 19 May 18 May 17 May 16 May 15 May 14 May 13 May 12 May 11 May 10 May 9 May 8 May 7 May 6 May 5 May 4 May 3 May 2 May 1 Apr 30 Apr 29 Apr 28 Apr 27 Apr 26 Apr 25 Apr 24 Apr 23 Apr 22 Apr 21 Apr 20 Apr 19 Apr 18 Apr 17 Apr 16
Windows 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

Text Debugging

Adds prinf-style debugging. Select some variables or expressions and a blank line, and this command will insert language-appropriate debugging statements. I try to insert dynamic line numbers when possible (easy in some languages, impossible in others). It falls back to static line numbers if the language doesn't have “compile time” line numbers.

Installation

Using Package Control, install “TextDebugging” or clone this repo in your packages folder.

I recommended you add key bindings for the commands. I've included my preferred bindings below. Copy them to your key bindings file (⌘⇧,).

Commands

text_debugging: First, select multiple variables. Then put an empty cursor somewhere and run this command (recommended: ctrl+p). You'll get some good debug output that looks like this (Python example):

print("""=============== Untitled at line {0} ===============
looks: {1!r}
like: {2!r}
this: {3!r}
""".format(__import__('sys')._getframe().f_lineno - 2, looks, like, this, ))

This package supports many languages, here's a ruby example:

puts("=============== at line 49 ===============
looks: #{looks.inspect}
like: #{like.inspect}
this: #{this.inspect}")

Key Bindings

Copy these to your user key bindings file.

{ "keys": ["ctrl+p"], "command": "text_debugging" },