6

How can I debug a (custom) transformer using the debugger in DartEditor.

I tried use the transformer shown in http://dovdev.com/smoke-and-mirrors/ but it fails.

I checked these documents but couldn't find anything about debugging.

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567
  • I've updated the article and the GitHub repo. The transformer should work now. Please open an issue on GitHub if you still have problems with it. I agree that the transformer debugging experience is not too pleasant currently. – Pixel Elephant Oct 07 '14 at 05:48

1 Answers1

2

Since pub runs transformers in its process, inside isolates, and doesn't redirect a transformers stdout, it's fairly hard to debug from within pub itself, so the best option is to run the transformer outside of pub by setting up a barback environment along with mocked files.

The code_transformers package makes this easier. See its tests library: http://www.dartdocs.org/documentation/code_transformers/0.2.3+1/index.html#code_transformers/code_transformers-tests

Justin Fagnani
  • 10,483
  • 2
  • 27
  • 37
  • 1
    `pub` is Dart code, isn't it? Is there no way to connect a debugger to a running Dart script? Is there no way to use this for example with `pause_isolates_on_start` or something? – Günter Zöchbauer Nov 08 '14 at 11:00