1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 17:05:26 +02:00

Bug 509191 - Do not create parameter guessing proposal if we know we are not calling the function

Change-Id: I7e45501707e0f58ed6d8745506a3519e29c0763a
This commit is contained in:
Nathan Ridge 2017-01-11 00:54:55 -05:00
parent 9e60a646fd
commit 68e19daf1e
2 changed files with 3 additions and 3 deletions

View file

@ -1478,7 +1478,7 @@ public class CompletionTests extends AbstractContentAssistTest {
// }
// using N::f/*cursor*/
public void testUsingDeclaration_379631() throws Exception {
final String[] expected= { "foo()" };
final String[] expected= { "foo;" };
assertCompletionResults(fCursorOffset, expected, REPLACEMENT);
}
@ -1651,7 +1651,7 @@ public class CompletionTests extends AbstractContentAssistTest {
// }
// using N::fo/*cursor*/;
public void testUsingCompletionWithFollowingSemicolon() throws Exception {
final String[] expected = { "foo()" };
final String[] expected = { "foo" };
assertContentAssistResults(fCursorOffset, expected, true, REPLACEMENT);
final String[] expectedInformation = { "null" };
assertContentAssistResults(fCursorOffset, expectedInformation, true, CONTEXT);

View file

@ -680,7 +680,7 @@ public class DOMCompletionProposalComputer extends ParsingBasedProposalComputer
// 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
// be added.
if (function.getParameters() != null && function.getParameters().length != 0
if (canBeCall && function.getParameters() != null && function.getParameters().length != 0
&& isBeforeParameters(cContext)) {
proposals.add(ParameterGuessingProposal.createProposal(cContext, fAvailableElements, proposal,
function, fPrefix, fGuessArguments));