Skip to content

Commit

Permalink
Enable completion tests
Browse files Browse the repository at this point in the history
- Fix some low hanging completion test errors

Signed-off-by: David Thompson <[email protected]>
  • Loading branch information
datho7561 committed Oct 4, 2024
1 parent f1c2571 commit 84c7fb8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
1 change: 1 addition & 0 deletions org.eclipse.jdt.core.tests.javac/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
<configuration>
<includes>
<include>org/eclipse/jdt/core/tests/javac/RunConverterTestsJavac.class</include>
<include>org/eclipse/jdt/core/tests/javac/RunCompletionTestsJavac.class</include>
</includes>
<argLine>${tycho.surefire.argLine}</argLine>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*******************************************************************************
* Copyright (c) 2024, Red Hat, Inc. and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
package org.eclipse.jdt.core.tests.javac;

public class RunCompletionTestsJavac extends org.eclipse.jdt.core.tests.model.RunCompletionModelTests {

public RunCompletionTestsJavac(String name) {
super(name);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -699,8 +699,6 @@ private CompletionProposal toProposal(IBinding binding, String completion) {
this.toComplete.getAST().resolveWellKnownType(Object.class.getName())) +
CompletionEngine.computeRelevanceForRestrictions(IAccessRule.K_ACCESSIBLE) + //no access restriction for class field
CompletionEngine.R_NON_INHERITED);
// set defaults for now to avoid error downstream
res.setRequiredProposals(new CompletionProposal[0]);
return res;
}

Expand Down Expand Up @@ -764,7 +762,6 @@ private CompletionProposal toImportProposal(char[] simpleName, char[] signature)
res.setSignature(signature);
res.completionEngine = this.nestedEngine;
res.nameLookup = this.nameEnvironment.nameLookup;
res.setRequiredProposals(new CompletionProposal[0]);
return res;
}

Expand Down Expand Up @@ -888,8 +885,6 @@ private CompletionProposal toModuleCompletion(String moduleName, char[] prefix)
proposal.completionEngine = this.nestedEngine;
proposal.nameLookup = this.nameEnvironment.nameLookup;

// set defaults for now to avoid error downstream
proposal.setRequiredProposals(new CompletionProposal[0]);
return proposal;
}

Expand Down Expand Up @@ -959,6 +954,7 @@ private CompletionProposal createKeywordProposal(char[] keyword, int startPos, i
}
CompletionProposal keywordProposal = createProposal(CompletionProposal.KEYWORD);
keywordProposal.setCompletion(keyword);
keywordProposal.setName(keyword);
keywordProposal.setReplaceRange(startPos, endPos);
keywordProposal.setRelevance(relevance);
return keywordProposal;
Expand Down

0 comments on commit 84c7fb8

Please sign in to comment.