1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-12 02:35:37 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2015-12-14 15:48:50 -08:00
parent 84b5f4bfd2
commit 01589f6297
2 changed files with 5 additions and 13 deletions

View file

@ -19,41 +19,34 @@ import org.eclipse.cdt.core.parser.IToken;
* @author Doug Schaefer
*/
public class ASTCompletionNode implements IASTCompletionNode {
private final IToken completionToken;
private final List<IASTName> names = new ArrayList<IASTName>();
private final List<IASTName> names = new ArrayList<>();
private final IASTTranslationUnit translationUnit;
public ASTCompletionNode(IToken completionToken, IASTTranslationUnit translationUnit) {
this.completionToken = completionToken;
this.translationUnit = translationUnit;
}
public void addName(IASTName name) {
names.add(name);
}
@Override
public String getPrefix() {
return completionToken.getType() == IToken.tEOC ? "" : completionToken.getImage(); //$NON-NLS-1$
}
@Override
public int getLength() {
return completionToken.getLength();
}
@Override
public IASTName[] getNames() {
return names.toArray(new IASTName[names.size()]);
}
@Override
public IASTTranslationUnit getTranslationUnit() {
return translationUnit;

View file

@ -14,7 +14,7 @@ package org.eclipse.cdt.core.dom.ast;
* This represents the node that would occur at the point of a context
* completion.
*
* This node may contain the prefix text of an identifer up to the point. If
* This node may contain the prefix text of an identifier up to the point. If
* there is no prefix, the completion occurred at the point where a new token
* would have begun.
*
@ -25,7 +25,6 @@ package org.eclipse.cdt.core.dom.ast;
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IASTCompletionNode {
/**
* If the point of completion was at the end of a potential identifier, this
* string contains the text of that identifier.
@ -35,21 +34,21 @@ public interface IASTCompletionNode {
public String getPrefix();
/**
* Get the length of the completion point.
* Returns the length of the completion point.
*
* @return length of completion token
*/
public int getLength();
/**
* Get a list of names that fit in this context.
* Returns a list of names that fit in this context.
*
* @return array of IASTName's
*/
public IASTName[] getNames();
/**
* Get the translation unit for this completion
* Returns the translation unit for this completion
*
* @return the translation unit
*/