[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [cdt-dev] Getting ITranslationUnit from IASTTranslationUnit
|
I'm not proposing making ITranslationUnit a requirement for creation of IASTTranslationUnit. In cases when IASTTranslationUnit is created by calling ITranslationUnit.getAST method, the IASTTranslationUnit will remember the originating ITranslationUnit. In other cases the IASTTranslationUnit.getAdaptor(ITranslationUnit.class) will return null.
Mapping from IASTTranslationUnit to ITranslationUnit through IASTFileLocation requires additional knowledge of whether the IASTTranslationUnit originated from a working copy or not. This makes it hard and error prone.
-sergey
On Tue, Mar 8, 2011 at 2:34 AM, Chris Recoskie
<recoskie@xxxxxxxxxx> wrote:
The standalone indexer doesn't get any ITranslationUnits, it only receives a list of file paths that it needs to parse. For the standalone indexer, OSGI is not even running.
There are also other clients of the standalone parser that aren't using RDT, so what Mike said about having the remote version of the CModel stuff doesn't apply to everyone.
Can you clarify why this is needed? I would think that you could use the IAstFileLocation to get the path to the file, and then use that to look up a resource in the workspace. From there you can interrogate the CoreModel to get at the ITranslationUnit.
===========================
Chris Recoskie
Team Lead, IBM CDT and RDT
IBM Toronto
Sergey Prigogin ---03/04/2011 08:12:29 PM---Does anybody know why IASTTranslationUnit doesn't provide a method returning the ITranslationUnit fr
Does anybody know why IASTTranslationUnit doesn't provide a method returning the ITranslationUnit from which the AST was built? Such method would be handy in many places, for example in CodanCReconciler.reconciled method.
-sergey_______________________________________________
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev
![GIF image](gifn0dOrCgEMF.gif)
![GIF image](giftyH8YNJLnk.gif)