mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-06 17:26:01 +02:00
Add ITranslationUnit constant for skip function bodies option
This commit is contained in:
parent
9bb901a2bf
commit
b9d0c01c06
3 changed files with 11 additions and 2 deletions
|
@ -33,6 +33,13 @@ import org.eclipse.core.runtime.IProgressMonitor;
|
|||
*/
|
||||
public interface ITranslationUnit extends ICElement, IParent, IOpenable, ISourceReference, ISourceManipulation {
|
||||
|
||||
/**
|
||||
* Style constant for {@link #getAST(IIndex, int)}.
|
||||
* Meaning: Skip function and method bodies.
|
||||
* @since 4.0
|
||||
*/
|
||||
public static final int AST_SKIP_FUNCTION_BODIES= 1;
|
||||
|
||||
/**
|
||||
* Style constant for {@link #getAST(IIndex, int)}.
|
||||
* Meaning: Skip over headers that are found in the index, parse all others.
|
||||
|
|
|
@ -67,7 +67,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
|||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier.ICPPASTBaseSpecifier;
|
||||
import org.eclipse.cdt.core.index.IIndex;
|
||||
import org.eclipse.cdt.core.index.IIndexManager;
|
||||
import org.eclipse.cdt.core.model.AbstractLanguage;
|
||||
import org.eclipse.cdt.core.model.CModelException;
|
||||
import org.eclipse.cdt.core.model.ICElement;
|
||||
import org.eclipse.cdt.core.model.IContributedModelBuilder;
|
||||
|
@ -241,7 +240,7 @@ public class CModelBuilder2 implements IContributedModelBuilder {
|
|||
final CElementInfo elementInfo= fTranslationUnit.getElementInfo();
|
||||
int parseFlags= quickParseMode ? ITranslationUnit.AST_SKIP_ALL_HEADERS : ITranslationUnit.AST_SKIP_INDEXED_HEADERS;
|
||||
if (!(elementInfo instanceof ASTHolderTUInfo)) {
|
||||
parseFlags |= AbstractLanguage.OPTION_SKIP_FUNCTION_BODIES;
|
||||
parseFlags |= ITranslationUnit.AST_SKIP_FUNCTION_BODIES;
|
||||
}
|
||||
final IASTTranslationUnit ast= fTranslationUnit.getAST(index, parseFlags);
|
||||
Util.debugLog("CModelBuilder2: parsing " //$NON-NLS-1$
|
||||
|
|
|
@ -747,6 +747,9 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
|
|||
if (language != null) {
|
||||
if (language instanceof AbstractLanguage) {
|
||||
int options= 0;
|
||||
if ((style & AST_SKIP_FUNCTION_BODIES) != 0) {
|
||||
options |= AbstractLanguage.OPTION_SKIP_FUNCTION_BODIES;
|
||||
}
|
||||
if ((style & AST_CREATE_COMMENT_NODES) != 0) {
|
||||
options |= AbstractLanguage.OPTION_ADD_COMMENTS;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue