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

Cosmetics.

This commit is contained in:
Sergey Prigogin 2016-03-02 17:46:00 -08:00
parent bc14c5b1cc
commit 028f8545ca

View file

@ -190,10 +190,10 @@ public class DOMCompletionProposalComputer extends ParsingBasedProposalComputer
} }
/** /**
* Test whether the invocation offset is inside or before the preprocessor directive keyword. * Checks whether the invocation offset is inside or before the preprocessor directive keyword.
* *
* @param context the invocation context * @param context the invocation context
* @return <code>true</code> if the invocation offset is inside or before the directive keyword * @return {@code true} if the invocation offset is inside or before the directive keyword
*/ */
private boolean inPreprocessorKeyword(CContentAssistInvocationContext context) { private boolean inPreprocessorKeyword(CContentAssistInvocationContext context) {
IDocument doc = context.getDocument(); IDocument doc = context.getDocument();
@ -216,10 +216,10 @@ public class DOMCompletionProposalComputer extends ParsingBasedProposalComputer
} }
/** /**
* Check if the invocation offset is inside a preprocessor directive. * Checks if the invocation offset is inside a preprocessor directive.
* *
* @param context the content assist invocation context * @param context the content assist invocation context
* @return <code>true</code> if invocation offset is inside a preprocessor directive * @return {@code true} if invocation offset is inside a preprocessor directive
*/ */
private boolean inPreprocessorDirective(CContentAssistInvocationContext context) { private boolean inPreprocessorDirective(CContentAssistInvocationContext context) {
IDocument doc = context.getDocument(); IDocument doc = context.getDocument();
@ -512,8 +512,8 @@ public class DOMCompletionProposalComputer extends ParsingBasedProposalComputer
repStringBuff.append('('); repStringBuff.append('(');
StringBuilder dispArgs = new StringBuilder(); // for the dispargString StringBuilder dispArgs = new StringBuilder(); // For the dispArgString
StringBuilder idArgs = new StringBuilder(); // for the idargString StringBuilder idArgs = new StringBuilder(); // For the idArgString
boolean hasArgs = true; boolean hasArgs = true;
String returnTypeStr = null; String returnTypeStr = null;
IParameter[] params = function.getParameters(); IParameter[] params = function.getParameters();
@ -616,11 +616,9 @@ public class DOMCompletionProposalComputer extends ParsingBasedProposalComputer
proposal.setContextInformation(info); proposal.setContextInformation(info);
} }
/* // The ParameterGuessingProposal will be active if the function accepts parameters and the content
* The ParameterGuessingProposal will be active if the function accepts parameters and the content // assist is invoked before typing any parameters. Otherwise, the normal parameter hint proposal will
* assist is invoked before typing any parameters. Otherwise, the normal parameter hint proposal will // be added.
* be added.
*/
if (function.getParameters() != null && function.getParameters().length != 0 if (function.getParameters() != null && function.getParameters().length != 0
&& isBeforeParameters(context)) { && isBeforeParameters(context)) {
proposals.add(ParameterGuessingProposal.createProposal(context, fAvailableElements, proposal, proposals.add(ParameterGuessingProposal.createProposal(context, fAvailableElements, proposal,
@ -634,11 +632,9 @@ public class DOMCompletionProposalComputer extends ParsingBasedProposalComputer
* Returns true if the invocation is at the function name or before typing any parameters. * Returns true if the invocation is at the function name or before typing any parameters.
*/ */
private boolean isBeforeParameters(CContentAssistInvocationContext context) { private boolean isBeforeParameters(CContentAssistInvocationContext context) {
/* // Invocation offset and parse offset are the same if content assist is invoked while in the function
* Invocation offset and parse offset are the same if content assist is invoked while in the function // name (i.e. before the '('). After that, the parse offset will indicate the end of the name part.
* name (i.e. before the '('). After that, the parse offset will indicate the end of the name part. If // If there is no difference between them, then we're still inside the function name part.
* the diff. between them is zero, then we're still inside the function name part.
*/
int relativeOffset = context.getInvocationOffset() - context.getParseOffset(); int relativeOffset = context.getInvocationOffset() - context.getParseOffset();
if (relativeOffset == 0) if (relativeOffset == 0)
return true; return true;