Community
Participate
Working Groups
20021001 Quick Fix issue, I hope you can help: public class A { void foo() { A.NewClass c; } } NewClass is not existing. I get the binding of A to find out if A is a class or package so I can suggest to add a new inner class. Unfortunatly, no binding is returned for A. Would it be possible to get the binding even in this incomplete code case? I'm hoping because in the editor code resolve on A works.
I don't have the compiler bindings in this case. The binding for A.NewClass is a problem binding. I don't have any information on the binding for A. So there is no much I can do in this case.
The editor code resolve is a different mecanism from parsing and resoluting binding. Ok to close as WONTFIX?
Maybe Philippe can help? It would be really helpful to have. I'm currently using 'code resolve' to resolve. Note that with qualified field references, bindings are accessible e.g. A.i= 1; A has a binding
My point is that your first test case cannot be done using DOM/AST. If you want to use code resolve, it is fine for me, but I have no way to fix it using DOM/AST. We might not retrieve any bindings when the compilation unit contains errors. Changing anything in the compiler ast node in order to fix this might have really bad side effects on binding resolution for the compiler. So I would say this is not an option. Don't try to use the DOM/AST API for a purpose for which it wasn't designed. Your case A.i doesn't mean we can get a binding for A.NewClass. When your have errors in a CU, it is really difficult to specify what bindings you can get. Using "code resolve" seems to be the solution in this case. DOM/AST won't help you.
I don't want to add an extra binding resolution to simply solve this case. Close as WONTFIX.