Build complete AST structure -- find all includes
Opened this issue · 3 comments
Mathiasdm commented
Some include statements, such as <stdio.h> cannot be resolved.
Build up knowledge of the AST and the indexer to find out how to resolve these statements.
Mathiasdm commented
1: you have an IASTTranslationUnit.
2. IASTTranslationUnit to IIndexFile??? getFilePath! Has StandaloneIndexerInputAdapter
3. IIndex.findIncludes(IIndexFile file) returns an IIndexInclude.
4. IIndexInclude has a method IIndexFileLocation getIncludesLocation()
5. IIndexFileLocation has String getFullPath()
6. TranslationUnitHelper has loadTranslationUnit(String filename)
Mathiasdm commented
If you have an IASTTranslationUnit and you want to include it:
ast.getFileLocation().getContextInclusionStatement();
Mathiasdm commented
Possible inspiration: AddIncludeOnSelectionAction