1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Added token counts to debug message in content assist.

This commit is contained in:
Doug Schaefer 2005-04-19 17:58:35 +00:00
parent e832d582ff
commit b829c4ed8e
3 changed files with 14 additions and 3 deletions

View file

@ -33,6 +33,9 @@ public class ASTCompletionNode {
private IASTTranslationUnit translationUnit; private IASTTranslationUnit translationUnit;
// used for debug
public int count;
/** /**
* Only constructor. * Only constructor.
* *

View file

@ -212,7 +212,10 @@ public class InternalASTServiceProvider implements IASTServiceProvider {
// Run the parse and return the completion node // Run the parse and return the completion node
parser.parse(); parser.parse();
return parser.getCompletionNode(); ASTCompletionNode node = parser.getCompletionNode();
if (node != null)
node.count = scanner.getCount();
return node;
} }
/* /*

View file

@ -121,8 +121,13 @@ public class CCompletionProcessor2 implements IContentAssistProcessor {
if (CUIPlugin.getDefault().getPreferenceStore().getBoolean(ContentAssistPreference.TIME_DOM)) { if (CUIPlugin.getDefault().getPreferenceStore().getBoolean(ContentAssistPreference.TIME_DOM)) {
long propTime = System.currentTimeMillis(); long propTime = System.currentTimeMillis();
System.out.println("Completion Parse: " + (stopTime - startTime) + " + Proposals: " //$NON-NLS-1$ //$NON-NLS-2$ System.out.print("Completion Parse: " + (stopTime - startTime) + " + Proposals: " //$NON-NLS-1$ //$NON-NLS-2$
+ (propTime - stopTime)); + (propTime - stopTime));
if (completionNode != null)
System.out.print(" - tokens: " + completionNode.count);
else
System.out.print(" - no completion node");
System.out.println();
System.out.flush(); System.out.flush();
} }