1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 18:26:01 +02:00

Bug fixes

This commit is contained in:
Hoda Amer 2004-04-16 20:29:07 +00:00
parent 8a496f8607
commit 1be0c22c6a
3 changed files with 31 additions and 9 deletions

View file

@ -1,3 +1,7 @@
2004-04-16 Hoda Amer
Fix for bug#44364 : [Content Assist] case sensitivity option
Fix for bug#53446 : [New Class Wizard] Be able to configure new class wizard to not open source
2004-04-16 David Inglis
Work in Progress - CPath ui stuff

View file

@ -364,16 +364,16 @@ public class CompletionEngine implements RelevanceConstants {
log("No of Keywords = " + numOfKeywords); //$NON-NLS-1$
}
private void addMacroToCompletions (String macroName){
int relevance = MACRO_TYPE_RELEVANCE;
private void addMacroToCompletions (String prefix, String macroName){
int relevance = computeRelevance(ICElement.C_MACRO, prefix, macroName);
requestor.acceptMacro(macroName, completionStart, completionLength, relevance);
}
private void addMacrosToCompletions(Iterator macros){
private void addMacrosToCompletions(String prefix, Iterator macros){
int numOfMacros = 0;
while (macros.hasNext()){
String macro = (String) macros.next();
addMacroToCompletions(macro);
addMacroToCompletions(prefix, macro);
numOfMacros++;
}
log("No of Macros = " + numOfMacros); //$NON-NLS-1$
@ -547,7 +547,7 @@ public class CompletionEngine implements RelevanceConstants {
addToCompletions(result);
List macros = lookupMacros(completionNode.getCompletionPrefix());
addMacrosToCompletions(macros.iterator());
addMacrosToCompletions(prefix, macros.iterator());
}
else // prefix is empty
{
@ -602,7 +602,7 @@ public class CompletionEngine implements RelevanceConstants {
IASTScope searchNode = completionNode.getCompletionScope();
// only look for macros
List result = lookupMacros(completionNode.getCompletionPrefix());
addMacrosToCompletions(result.iterator());
addMacrosToCompletions(completionNode.getCompletionPrefix(), result.iterator());
}
private void completionOnNewTypeReference(IASTCompletionNode completionNode){
// 1. Get the search scope node
@ -643,7 +643,7 @@ public class CompletionEngine implements RelevanceConstants {
addToCompletions(result);
List macros = lookupMacros(completionNode.getCompletionPrefix());
addMacrosToCompletions(macros.iterator());
addMacrosToCompletions(prefix, macros.iterator());
}

View file

@ -30,6 +30,8 @@ import org.eclipse.ui.wizards.newresource.BasicNewResourceWizard;
public class NewClassWizard extends BasicNewResourceWizard implements INewWizard {
private NewClassWizardPage fPage;
private String wz_title;
// a boolean to programatically control opening the sources in the editor
private boolean openInEditor = true;
private static final String WZ_TITLE = "NewClassWizard.title"; //$NON-NLS-1$
private static final String WZ_DESC = "NewClassWizard.description"; //$NON-NLS-1$
@ -58,15 +60,19 @@ public class NewClassWizard extends BasicNewResourceWizard implements INewWizard
if (headerTU != null) {
IResource resource= headerTU.getResource();
selectAndReveal(resource);
if(doOpenInEditor()){
openResource((IFile) resource);
}
}
if (bodyTU != null) {
IResource resource= bodyTU.getResource();
selectAndReveal(resource);
if(doOpenInEditor()){
openResource((IFile) resource);
}
}
}
}
/**
* @see Wizard#performFinish
*/
@ -128,4 +134,16 @@ public class NewClassWizard extends BasicNewResourceWizard implements INewWizard
public ICElement getCreatedClassElement(){
return fPage.getCreatedClassElement();
}
/**
* @return Returns the openInEditor.
*/
public boolean doOpenInEditor() {
return openInEditor;
}
/**
* @param openInEditor The openInEditor to set.
*/
public void setOpenInEditor(boolean openInEditor) {
this.openInEditor = openInEditor;
}
}