sdk
sdk copied to clipboard
Is that possible to set breakpoints in the macro code itself?
Hi!
I'm wondering - what are the possible ways to debug we have while developing new macros? The main question - is that possible somehow to put breakpoints into the code of macros itself to introspect something inside?
Like, for example:
import 'dart:async';
import 'dart:developer';
import 'package:macros/macros.dart';
macro class EmptyMacro implements ClassDeclarationsMacro {
@override
FutureOr<void> buildDeclarationsForClass(ClassDeclaration clazz, MemberDeclarationBuilder builder) async {
debugger(message: 'I want to see, what the inside of "clazz"'); // <- I wanna put a breakpoint here to see, what the inside of "clazz"
}
}
The way with Builder.report
is something, at least, but definitely not the best. Maybe there is something better already?