Closed jmborer closed 5 years ago
You can start looking here how to use JavaSource class: https://platform.netbeans.org/tutorials/60/nbm-copyfqn.html
Maybe, I won't do that because it's expensive to use a parser.
Not sure it is so expensive. You would be just re-using something that already exists for completion for example, no?
I'm not sure whether we can use the same parser result as other features. Perhaps, can't use it. If we have to use it to implement very useful features, I would use it. Otherwise, I would like to avoid using it.
The plugin for Java is currently based on regexp expressions. To take is big step further, it would require the plugin to use the abstract source tree (AST) provided by the source code lexer (the same that is used during completion to provide the methods, vars etc.) instead of regular expressions. This would open a whole new world for the plugin: it can then recognize Color constants or declarations of any subclass of color such as ColorUIResource.