1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-12 10:45: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 * @author Doug Schaefer
*/ */
public class ASTCompletionNode implements IASTCompletionNode { public class ASTCompletionNode implements IASTCompletionNode {
private final IToken completionToken; private final IToken completionToken;
private final List<IASTName> names = new ArrayList<IASTName>(); private final List<IASTName> names = new ArrayList<>();
private final IASTTranslationUnit translationUnit; private final IASTTranslationUnit translationUnit;
public ASTCompletionNode(IToken completionToken, IASTTranslationUnit translationUnit) { public ASTCompletionNode(IToken completionToken, IASTTranslationUnit translationUnit) {
this.completionToken = completionToken; this.completionToken = completionToken;
this.translationUnit = translationUnit; this.translationUnit = translationUnit;
} }
public void addName(IASTName name) { public void addName(IASTName name) {
names.add(name); names.add(name);
} }
@Override @Override
public String getPrefix() { public String getPrefix() {
return completionToken.getType() == IToken.tEOC ? "" : completionToken.getImage(); //$NON-NLS-1$ return completionToken.getType() == IToken.tEOC ? "" : completionToken.getImage(); //$NON-NLS-1$
} }
@Override @Override
public int getLength() { public int getLength() {
return completionToken.getLength(); return completionToken.getLength();
} }
@Override @Override
public IASTName[] getNames() { public IASTName[] getNames() {
return names.toArray(new IASTName[names.size()]); return names.toArray(new IASTName[names.size()]);
} }
@Override @Override
public IASTTranslationUnit getTranslationUnit() { public IASTTranslationUnit getTranslationUnit() {
return translationUnit; 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 * This represents the node that would occur at the point of a context
* completion. * 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 * there is no prefix, the completion occurred at the point where a new token
* would have begun. * 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. * @noimplement This interface is not intended to be implemented by clients.
*/ */
public interface IASTCompletionNode { public interface IASTCompletionNode {
/** /**
* If the point of completion was at the end of a potential identifier, this * If the point of completion was at the end of a potential identifier, this
* string contains the text of that identifier. * string contains the text of that identifier.
@ -35,21 +34,21 @@ public interface IASTCompletionNode {
public String getPrefix(); public String getPrefix();
/** /**
* Get the length of the completion point. * Returns the length of the completion point.
* *
* @return length of completion token * @return length of completion token
*/ */
public int getLength(); 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 * @return array of IASTName's
*/ */
public IASTName[] getNames(); public IASTName[] getNames();
/** /**
* Get the translation unit for this completion * Returns the translation unit for this completion
* *
* @return the translation unit * @return the translation unit
*/ */