mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-05 07:15:39 +02:00
update type cache before first use
This commit is contained in:
parent
575ca0759a
commit
662668a4ba
1 changed files with 19 additions and 4 deletions
|
@ -994,7 +994,9 @@ public class NewClassCreationWizardPage extends NewElementWizardPage {
|
||||||
|
|
||||||
IProject project = getCurrentProject();
|
IProject project = getCurrentProject();
|
||||||
if (project != null) {
|
if (project != null) {
|
||||||
if (typeName.isQualified()) {
|
prepareTypeCache();
|
||||||
|
|
||||||
|
if (typeName.isQualified()) {
|
||||||
// make sure enclosing namespace exists
|
// make sure enclosing namespace exists
|
||||||
ITypeInfo parentNamespace = AllTypesCache.getType(project, ICElement.C_NAMESPACE, typeName.getEnclosingTypeName());
|
ITypeInfo parentNamespace = AllTypesCache.getType(project, ICElement.C_NAMESPACE, typeName.getEnclosingTypeName());
|
||||||
if (parentNamespace == null) {
|
if (parentNamespace == null) {
|
||||||
|
@ -1081,6 +1083,8 @@ public class NewClassCreationWizardPage extends NewElementWizardPage {
|
||||||
|
|
||||||
IProject project = getCurrentProject();
|
IProject project = getCurrentProject();
|
||||||
if (project != null) {
|
if (project != null) {
|
||||||
|
prepareTypeCache();
|
||||||
|
|
||||||
ITypeInfo[] types = AllTypesCache.getTypes(project, typeName, false, true);
|
ITypeInfo[] types = AllTypesCache.getTypes(project, typeName, false, true);
|
||||||
if (types.length > 0) {
|
if (types.length > 0) {
|
||||||
// look for class
|
// look for class
|
||||||
|
@ -1145,7 +1149,9 @@ public class NewClassCreationWizardPage extends NewElementWizardPage {
|
||||||
|
|
||||||
IProject project = getCurrentProject();
|
IProject project = getCurrentProject();
|
||||||
if (project != null) {
|
if (project != null) {
|
||||||
IQualifiedTypeName fullyQualifiedName = className;
|
prepareTypeCache();
|
||||||
|
|
||||||
|
IQualifiedTypeName fullyQualifiedName = className;
|
||||||
if (isEnclosingTypeSelected()) {
|
if (isEnclosingTypeSelected()) {
|
||||||
IQualifiedTypeName enclosing = getEnclosingTypeName();
|
IQualifiedTypeName enclosing = getEnclosingTypeName();
|
||||||
if (enclosing != null) {
|
if (enclosing != null) {
|
||||||
|
@ -1796,7 +1802,6 @@ public class NewClassCreationWizardPage extends NewElementWizardPage {
|
||||||
public void setVisible(boolean visible) {
|
public void setVisible(boolean visible) {
|
||||||
super.setVisible(visible);
|
super.setVisible(visible);
|
||||||
if (visible) {
|
if (visible) {
|
||||||
prepareTypeCache();
|
|
||||||
setFocus();
|
setFocus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1821,6 +1826,8 @@ public class NewClassCreationWizardPage extends NewElementWizardPage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!classExists) {
|
if (!classExists) {
|
||||||
|
prepareTypeCache();
|
||||||
|
|
||||||
// resolve location of base class
|
// resolve location of base class
|
||||||
if (newBaseClass.getResolvedReference() == null) {
|
if (newBaseClass.getResolvedReference() == null) {
|
||||||
final ITypeInfo[] typesToResolve = new ITypeInfo[] { newBaseClass };
|
final ITypeInfo[] typesToResolve = new ITypeInfo[] { newBaseClass };
|
||||||
|
@ -1960,6 +1967,8 @@ public class NewClassCreationWizardPage extends NewElementWizardPage {
|
||||||
scope = new TypeSearchScope(true);
|
scope = new TypeSearchScope(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
prepareTypeCache();
|
||||||
|
|
||||||
ITypeInfo[] elements = AllTypesCache.getNamespaces(scope, false);
|
ITypeInfo[] elements = AllTypesCache.getNamespaces(scope, false);
|
||||||
if (elements == null || elements.length == 0) {
|
if (elements == null || elements.length == 0) {
|
||||||
String title = NewClassWizardMessages.getString("NewClassCreationWizardPage.getClasses.noclasses.title"); //$NON-NLS-1$
|
String title = NewClassWizardMessages.getString("NewClassCreationWizardPage.getClasses.noclasses.title"); //$NON-NLS-1$
|
||||||
|
@ -2016,7 +2025,9 @@ public class NewClassCreationWizardPage extends NewElementWizardPage {
|
||||||
scope = new TypeSearchScope(true);
|
scope = new TypeSearchScope(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
ITypeInfo[] elements = AllTypesCache.getTypes(scope, ENCLOSING_CLASS_TYPES);
|
prepareTypeCache();
|
||||||
|
|
||||||
|
ITypeInfo[] elements = AllTypesCache.getTypes(scope, ENCLOSING_CLASS_TYPES);
|
||||||
if (elements == null || elements.length == 0) {
|
if (elements == null || elements.length == 0) {
|
||||||
String title = NewClassWizardMessages.getString("NewClassCreationWizardPage.getClasses.noclasses.title"); //$NON-NLS-1$
|
String title = NewClassWizardMessages.getString("NewClassCreationWizardPage.getClasses.noclasses.title"); //$NON-NLS-1$
|
||||||
String message = NewClassWizardMessages.getString("NewClassCreationWizardPage.getClasses.noclasses.message"); //$NON-NLS-1$
|
String message = NewClassWizardMessages.getString("NewClassCreationWizardPage.getClasses.noclasses.message"); //$NON-NLS-1$
|
||||||
|
@ -2032,6 +2043,8 @@ public class NewClassCreationWizardPage extends NewElementWizardPage {
|
||||||
if (enclosingClass != null) {
|
if (enclosingClass != null) {
|
||||||
// resolve location of class
|
// resolve location of class
|
||||||
if (enclosingClass.getResolvedReference() == null) {
|
if (enclosingClass.getResolvedReference() == null) {
|
||||||
|
prepareTypeCache();
|
||||||
|
|
||||||
final ITypeInfo[] typesToResolve = new ITypeInfo[] { enclosingClass };
|
final ITypeInfo[] typesToResolve = new ITypeInfo[] { enclosingClass };
|
||||||
IRunnableWithProgress runnable = new IRunnableWithProgress() {
|
IRunnableWithProgress runnable = new IRunnableWithProgress() {
|
||||||
public void run(IProgressMonitor progressMonitor) throws InvocationTargetException, InterruptedException {
|
public void run(IProgressMonitor progressMonitor) throws InvocationTargetException, InterruptedException {
|
||||||
|
@ -2064,6 +2077,8 @@ public class NewClassCreationWizardPage extends NewElementWizardPage {
|
||||||
private final int[] CLASS_TYPES = { ICElement.C_CLASS, ICElement.C_STRUCT };
|
private final int[] CLASS_TYPES = { ICElement.C_CLASS, ICElement.C_STRUCT };
|
||||||
|
|
||||||
void chooseBaseClasses() {
|
void chooseBaseClasses() {
|
||||||
|
prepareTypeCache();
|
||||||
|
|
||||||
ITypeInfo[] elements = AllTypesCache.getTypes(new TypeSearchScope(true), CLASS_TYPES);
|
ITypeInfo[] elements = AllTypesCache.getTypes(new TypeSearchScope(true), CLASS_TYPES);
|
||||||
if (elements == null || elements.length == 0) {
|
if (elements == null || elements.length == 0) {
|
||||||
String title = NewClassWizardMessages.getString("NewClassCreationWizardPage.getClasses.noclasses.title"); //$NON-NLS-1$
|
String title = NewClassWizardMessages.getString("NewClassCreationWizardPage.getClasses.noclasses.title"); //$NON-NLS-1$
|
||||||
|
|
Loading…
Add table
Reference in a new issue