private IDEResourcesManager() { this.registryListenerIntialized = false; this.resourceParticipants = new ArrayList<>(); this.listeners = new ArrayList<ITypeScriptElementChangedListener>(); updateUseJsAsJsx(Platform.getContentTypeManager().getContentType(JSX_CONTENT_TYPE_ID)); Platform.getContentTypeManager().addContentTypeChangeListener(new IContentTypeChangeListener() { @Override public void contentTypeChanged(ContentTypeChangeEvent event) { IContentType contentType = event.getContentType(); if (contentType != null && JSX_CONTENT_TYPE_ID.equals(contentType.getId())) { updateUseJsAsJsx(contentType); } } }); }
public void contentTypeChanged(ContentTypeChangeEvent event) { Util.resetJavaLikeExtensions(); // Walk through projects to reset their secondary types cache IJavaProject[] projects; try { projects = JavaModelManager.getJavaModelManager().getJavaModel().getJavaProjects(); } catch (JavaModelException e) { return; } for (int i = 0, length = projects.length; i < length; i++) { IJavaProject project = projects[i]; final PerProjectInfo projectInfo = getPerProjectInfo(project.getProject(), false /* don't create info */); if (projectInfo != null) { projectInfo.secondaryTypes = null; } } }