mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-10 09:45:39 +02:00
Cosmetics.
This commit is contained in:
parent
7f4a8de499
commit
b1d0e96fc1
1 changed files with 11 additions and 11 deletions
|
@ -113,9 +113,9 @@ public abstract class AbstractContentAssistTest extends BaseUITestCase {
|
||||||
CContentAssistProcessor processor = new CContentAssistProcessor(fEditor, assistant, contentType);
|
CContentAssistProcessor processor = new CContentAssistProcessor(fEditor, assistant, contentType);
|
||||||
long startTime= System.currentTimeMillis();
|
long startTime= System.currentTimeMillis();
|
||||||
sourceViewer.setSelectedRange(offset, length);
|
sourceViewer.setSelectedRange(offset, length);
|
||||||
Object[] results = isCompletion
|
Object[] results = isCompletion ?
|
||||||
? (Object[]) processor.computeCompletionProposals(sourceViewer, offset)
|
(Object[]) processor.computeCompletionProposals(sourceViewer, offset) :
|
||||||
: (Object[]) processor.computeContextInformation(sourceViewer, offset);
|
(Object[]) processor.computeContextInformation(sourceViewer, offset);
|
||||||
long endTime= System.currentTimeMillis();
|
long endTime= System.currentTimeMillis();
|
||||||
assertTrue(results != null);
|
assertTrue(results != null);
|
||||||
|
|
||||||
|
@ -131,13 +131,13 @@ public abstract class AbstractContentAssistTest extends BaseUITestCase {
|
||||||
Arrays.sort(resultStrings);
|
Arrays.sort(resultStrings);
|
||||||
|
|
||||||
if (CTestPlugin.getDefault().isDebugging()) {
|
if (CTestPlugin.getDefault().isDebugging()) {
|
||||||
System.out.println("Time (ms): " + (endTime-startTime));
|
System.out.println("Time: " + (endTime - startTime) + " ms");
|
||||||
for (String proposal : resultStrings) {
|
for (String proposal : resultStrings) {
|
||||||
System.out.println("Result: " + proposal);
|
System.out.println("Result: " + proposal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean allFound = true; // for the time being, let's be optimistic
|
boolean allFound = true; // For the time being, let's be optimistic.
|
||||||
|
|
||||||
for (String element : expected) {
|
for (String element : expected) {
|
||||||
boolean found = false;
|
boolean found = false;
|
||||||
|
@ -180,14 +180,14 @@ public abstract class AbstractContentAssistTest extends BaseUITestCase {
|
||||||
* @return filtered proposals
|
* @return filtered proposals
|
||||||
*/
|
*/
|
||||||
private Object[] filterResults(Object[] results, boolean isCodeCompletion) {
|
private Object[] filterResults(Object[] results, boolean isCodeCompletion) {
|
||||||
List<Object> filtered= new ArrayList<Object>();
|
List<Object> filtered= new ArrayList<>();
|
||||||
for (Object result : results) {
|
for (Object result : results) {
|
||||||
if (result instanceof TemplateProposal) {
|
if (result instanceof TemplateProposal) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (result instanceof ICCompletionProposal) {
|
if (result instanceof ICCompletionProposal) {
|
||||||
if (isCodeCompletion) {
|
if (isCodeCompletion) {
|
||||||
// check for keywords proposal
|
// Check for keywords proposal.
|
||||||
int relevance = ((ICCompletionProposal)result).getRelevance();
|
int relevance = ((ICCompletionProposal)result).getRelevance();
|
||||||
if (relevance >= RelevanceConstants.CASE_MATCH_RELEVANCE) {
|
if (relevance >= RelevanceConstants.CASE_MATCH_RELEVANCE) {
|
||||||
relevance -= RelevanceConstants.CASE_MATCH_RELEVANCE;
|
relevance -= RelevanceConstants.CASE_MATCH_RELEVANCE;
|
||||||
|
@ -208,7 +208,7 @@ public abstract class AbstractContentAssistTest extends BaseUITestCase {
|
||||||
* Filter out proposals, keep only templates
|
* Filter out proposals, keep only templates
|
||||||
*/
|
*/
|
||||||
private Object[] filterResultsKeepTemplates(Object[] results) {
|
private Object[] filterResultsKeepTemplates(Object[] results) {
|
||||||
List<Object> filtered= new ArrayList<Object>();
|
List<Object> filtered= new ArrayList<>();
|
||||||
for (Object result : results) {
|
for (Object result : results) {
|
||||||
if (result instanceof TemplateProposal) {
|
if (result instanceof TemplateProposal) {
|
||||||
filtered.add(result);
|
filtered.add(result);
|
||||||
|
@ -263,7 +263,7 @@ public abstract class AbstractContentAssistTest extends BaseUITestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
private String toString(String[] strings) {
|
private String toString(String[] strings) {
|
||||||
StringBuffer buf= new StringBuffer();
|
StringBuilder buf= new StringBuilder();
|
||||||
for (String string : strings) {
|
for (String string : strings) {
|
||||||
buf.append(string).append('\n');
|
buf.append(string).append('\n');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue