@Override public void acceptContext(CompletionContext context) { originalRequestor.acceptContext(context); }
@Override public void setAllowsRequiredProposals(int mainKind, int requiredKind, boolean allow) { originalRequestor.setAllowsRequiredProposals(mainKind, requiredKind, allow); } };
@Override public void setIgnored(int completionProposalKind, boolean ignore) { originalRequestor.setIgnored(completionProposalKind, ignore); }
private boolean isIgnored(int kind, int requiredProposalKind) { return this.requestor.isIgnored(kind) || !this.requestor.isAllowingRequiredProposals(kind, requiredProposalKind); } private boolean isValidParent(ASTNode parent, ASTNode node, Scope scope){
public void complete(IType type, char[] snippet, int position, char[][] localVariableTypeNames, char[][] localVariableNames, int[] localVariableModifiers, boolean isStatic){ if(this.requestor != null){ this.requestor.beginReporting(); contextAccepted = true; InternalCompletionContext context = new InternalCompletionContext(); if (this.requestor.isExtendedContextRequired()) context.setExtended(); this.requestor.acceptContext(context); this.requestor.completionFailure(this.problem); if(DEBUG) { this.printDebug(this.problem); contextAccepted = true; InternalCompletionContext context = new InternalCompletionContext(); if (this.requestor.isExtendedContextRequired()) context.setExtended(); this.requestor.acceptContext(context); this.requestor.endReporting();
CompletionRequestor requestor= new CompletionRequestor(true) { @Override public void accept(CompletionProposal proposal) { requestor.setIgnored(CompletionProposal.METHOD_REF, false); requestor.setAllowsRequiredProposals(CompletionProposal.METHOD_REF, CompletionProposal.METHOD_IMPORT, true); } else { requestor.setIgnored(CompletionProposal.FIELD_REF, false); requestor.setAllowsRequiredProposals(CompletionProposal.FIELD_REF, CompletionProposal.FIELD_IMPORT, true); requestor.setFavoriteReferences(favorites);
private void findJavadocBlockTags(CompletionOnJavadocTag javadocTag) { char[][] possibleTags = javadocTag.getPossibleBlockTags(); if (possibleTags == null) return; int length = possibleTags.length; for (int i=0; i<length; i++) { int relevance = computeBaseRelevance(); relevance += computeRelevanceForInterestingProposal(); relevance += computeRelevanceForRestrictions(IAccessRule.K_ACCESSIBLE); // no access restriction for keywors this.noProposal = false; if (!this.requestor.isIgnored(CompletionProposal.JAVADOC_BLOCK_TAG)) { char[] possibleTag = possibleTags[i]; InternalCompletionProposal proposal = createProposal(CompletionProposal.JAVADOC_BLOCK_TAG, this.actualCompletionPosition); proposal.setName(possibleTag); int tagLength = possibleTag.length; char[] completion = new char[1+tagLength]; completion[0] = '@'; System.arraycopy(possibleTag, 0, completion, 1, tagLength); proposal.setCompletion(completion); proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset); proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); proposal.setRelevance(relevance); this.requestor.accept(proposal); if (DEBUG) { this.printDebug(proposal); } } } }
Scope scope) { InternalCompletionContext context = new InternalCompletionContext(); if (this.requestor.isExtendedContextRequired()) { context.setExtendedData( this.typeRoot, System.out.println(context.toString()); this.requestor.acceptContext(context);
private void debugPrintf() { if(this.noProposal && this.problem != null) { this.requestor.completionFailure(this.problem); if(DEBUG) { this.printDebug(this.problem); } } }
@Override public void beginReporting() { originalRequestor.beginReporting(); }
@Override public void endReporting() { originalRequestor.endReporting(); }
new LookupEnvironment(this, this.compilerOptions, this.problemReporter, nameEnvironment); this.parser = new CompletionParser(this.problemReporter, this.requestor.isExtendedContextRequired()); this.owner = owner; this.monitor = monitor;
private ImportBinding[] getFavoriteReferenceBindings(Scope scope) { if (this.favoriteReferenceBindings != null) return this.favoriteReferenceBindings; String[] favoriteReferences = this.requestor.getFavoriteReferences();
@Override public boolean isAllowingRequiredProposals(int mainKind, int requiredKind) { return originalRequestor.isAllowingRequiredProposals(mainKind, requiredKind); }
private void proposeModuleName(CompilationUnitDeclaration parsedUnit) { String projectName = this.javaProject.getElementName(); char[] moduleName = projectName.toCharArray(); if (moduleName.length > 0) {// do not propose invalid names if (!Character.isJavaIdentifierStart(moduleName[0])) return; for (char c : moduleName) { if (!Character.isJavaIdentifierPart(c) && c != '.') return; } } this.completionToken = CharOperation.concatWith(this.moduleDeclaration.tokens, '.'); setSourceRange(this.moduleDeclaration.sourceStart, this.moduleDeclaration.bodyStart); if (this.completionToken.length > 0 && !CharOperation.prefixEquals(this.completionToken, moduleName)) return; InternalCompletionProposal proposal = createProposal(CompletionProposal.MODULE_DECLARATION, this.actualCompletionPosition); proposal.setName(moduleName); proposal.setDeclarationSignature(moduleName); proposal.setCompletion(moduleName); proposal.setReplaceRange((this.startPosition < 0) ? 0 : this.startPosition - this.offset, this.endPosition - this.offset); proposal.setTokenRange((this.tokenStart < 0) ? 0 : this.tokenStart - this.offset, this.tokenEnd - this.offset); proposal.setRelevance(R_MODULE_DECLARATION); this.requestor.accept(proposal); if(DEBUG) { this.printDebug(proposal); } }
public void complete(IType type, char[] snippet, int position, char[][] localVariableTypeNames, char[][] localVariableNames, int[] localVariableModifiers, boolean isStatic){ if(this.requestor != null){ this.requestor.beginReporting(); contextAccepted = true; InternalCompletionContext context = new InternalCompletionContext(); if (this.requestor.isExtendedContextRequired()) context.setExtended(); this.requestor.acceptContext(context); this.requestor.completionFailure(this.problem); if(DEBUG) { this.printDebug(this.problem); contextAccepted = true; InternalCompletionContext context = new InternalCompletionContext(); if (this.requestor.isExtendedContextRequired()) context.setExtended(); this.requestor.acceptContext(context); this.requestor.endReporting();
CompletionRequestor requestor= new CompletionRequestor(true) { @Override public void accept(CompletionProposal proposal) { requestor.setIgnored(CompletionProposal.METHOD_REF, false); requestor.setAllowsRequiredProposals(CompletionProposal.METHOD_REF, CompletionProposal.METHOD_IMPORT, true); } else { requestor.setIgnored(CompletionProposal.FIELD_REF, false); requestor.setAllowsRequiredProposals(CompletionProposal.FIELD_REF, CompletionProposal.FIELD_IMPORT, true); requestor.setFavoriteReferences(favorites);
private void findJavadocBlockTags(CompletionOnJavadocTag javadocTag) { char[][] possibleTags = javadocTag.getPossibleBlockTags(); if (possibleTags == null) return; int length = possibleTags.length; for (int i=0; i<length; i++) { int relevance = computeBaseRelevance(); relevance += computeRelevanceForInterestingProposal(); relevance += computeRelevanceForRestrictions(IAccessRule.K_ACCESSIBLE); // no access restriction for keywors this.noProposal = false; if (!this.requestor.isIgnored(CompletionProposal.JAVADOC_BLOCK_TAG)) { char[] possibleTag = possibleTags[i]; InternalCompletionProposal proposal = createProposal(CompletionProposal.JAVADOC_BLOCK_TAG, this.actualCompletionPosition); proposal.setName(possibleTag); int tagLength = possibleTag.length; char[] completion = new char[1+tagLength]; completion[0] = '@'; System.arraycopy(possibleTag, 0, completion, 1, tagLength); proposal.setCompletion(completion); proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset); proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); proposal.setRelevance(relevance); this.requestor.accept(proposal); if (DEBUG) { this.printDebug(proposal); } } } }
private boolean isIgnored(int kind, int requiredProposalKind) { return this.requestor.isIgnored(kind) || !this.requestor.isAllowingRequiredProposals(kind, requiredProposalKind); }
Scope scope) { InternalCompletionContext context = new InternalCompletionContext(); if (this.requestor.isExtendedContextRequired()) { context.setExtendedData( this.typeRoot, System.out.println(context.toString()); this.requestor.acceptContext(context);