1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-09 10:46:02 +02:00

Fix for Bug 172204 - Extra/missing parameter hint proposals (patch by Bryan Wilkinson)

This commit is contained in:
Anton Leherbauer 2007-01-31 08:51:55 +00:00
parent 062bd88019
commit fd426ee735

View file

@ -7,6 +7,7 @@
* *
* Contributors: * Contributors:
* Anton Leherbauer (Wind River Systems) - initial API and implementation * Anton Leherbauer (Wind River Systems) - initial API and implementation
* Bryan Wilkinson (QNX)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.ui.text.contentassist; package org.eclipse.cdt.internal.ui.text.contentassist;
@ -137,13 +138,17 @@ public class LegacyCompletionProposalComputer implements ICompletionProposalComp
int paren= scanner.findOpeningPeer(pos, bound, '(', ')'); int paren= scanner.findOpeningPeer(pos, bound, '(', ')');
if (paren == CHeuristicScanner.NOT_FOUND) if (paren == CHeuristicScanner.NOT_FOUND)
break; break;
int token= scanner.previousToken(paren - 1, bound); paren= scanner.findNonWhitespaceBackward(paren - 1, bound);
if (paren == CHeuristicScanner.NOT_FOUND) {
break;
}
int token= scanner.previousToken(paren, bound);
// next token must be a method name (identifier) or the closing angle of a // next token must be a method name (identifier) or the closing angle of a
// constructor call of a template type. // constructor call of a template type.
if (token == Symbols.TokenIDENT || token == Symbols.TokenGREATERTHAN) { if (token == Symbols.TokenIDENT || token == Symbols.TokenGREATERTHAN) {
return paren - 1; return paren + 1;
} }
pos= paren - 1; pos= paren;
} while (true); } while (true);
return context.getInvocationOffset(); return context.getInvocationOffset();