blob: 4e867566f81b8bb8e9005c5b23f078d76e090f14 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
## Eclipse insertion point for newly generated code
We need to figure out which of the bodyStart/bodyDeclarationStart/sourceStart blocks are used as where insertions happen, and set it to the entire line of a field and not just the annotation.
Don't forget to extend past the opening brace for @Data!
## javadoc
Either just let people run lombokc and javadoc that, -or-, use a doclet and presumptively cast our way into javadoc's AST.
## lombokc
To keep comments, try:
com.sun.tools.javac.main.JavaCompiler.instance(context).keepComments = true;
## netbeans agent plugin
module: java.source
class: org.netbeans.modules.java.source.parsing.JavacParser
to instrument:
class: JavacTaskImpl
method1: public JCBlock reparseMethodBody(CompilationUnitTree topLevel, MethodTree methodBody, String newText, int annonIndex) {}
method2: public Iterable<? extends CompilationUnitTree> parse();
in either case, returned value could be null/empty. CompilationUnitTree are MethodTree are superinterfaces of JCCU and JCMD.
problem: the agent stops receiving requests to transform classes early in the netbeans load process.
Possible work-around: Rewrite the entire JavacTaskImpl.class file on disk. It's in:
/NetBeans 6.7 RC3.app/Contents/Resources/NetBeans/java2/modules/ext/javac-impl-nb-7.0-b07.jar
Some work has been done in the addNetbeans branch.
## website
## javadoc
## screencasts
## installers
## hook into class file writing
on javac: com.sun.tools.javac.jvm.ClassWriter.writeClassFile(OutputStream out, ClassSymbol c) - hack the one line where out.write() is called.
|