Summary: | [dom] Need a way to get back from an AST to the originating ICompilationUnit | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Markus Keller <markus.kell.r> |
Component: | Core | Assignee: | Jerome Lanneluc <jerome_lanneluc> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | enhancement | ||
Priority: | P3 | CC: | jerome_lanneluc |
Version: | 3.0 | ||
Target Milestone: | 3.1 M6 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Markus Keller
2004-10-06 07:08:07 EDT
The current API makes the ICompilationUnit available in ASTRequestor#acceptAST(CompilationUnit ast, ICompilationUnit source). I would still favor a query on AST or ASTNode to get back to IJavaElements from an AST. Changing severity to enhancement, since the way back is available now. This is already work in progress. Actually no work has started on this API. Markus can you confirm that CompilationUnit#getJavaElement() (that would return an ICompilationUnit) is the only thing that you really need ? And that you currently have a workaround that is to set a property on the CompilationUnit ? Exactly. As a workaround, we currently parse everything with our RefactoringASTParser, which stores the originating ICompilationUnit in a property of the CompilationUnit node. The getJavaElement() on any ASTNode was just an idea for convenience and is currently not required (however, that functionality should in fact already be available when bindings are resolved: aNode.resolveBinding().getJavaElement()). Added CompilationUnit#getJavaElement(). Added test ASTConvertTest2#test0573() Verified in I20050330-0500 |