Unnamed: 0
int64 0
305k
| body
stringlengths 7
52.9k
| name
stringlengths 1
185
|
---|---|---|
303,400 | DomExtension (final DomExtender extender) { if (myUserMap == null || !myUserMap.containsKey(DOM_EXTENDER_KEY)) { putUserData(DOM_EXTENDER_KEY, new SmartList<>()); } //noinspection unchecked ((List<DomExtender<?>>)myUserMap.get(DOM_EXTENDER_KEY)).add(extender); return this; } | addExtender |
303,401 | DomExtensionImpl (int count) { myCount = count; return this; } | setCount |
303,402 | int () { return myCount; } | getCount |
303,403 | void (@NotNull PluginDescriptor pluginDescriptor) { this.pluginDescriptor = pluginDescriptor; } | setPluginDescriptor |
303,404 | List<DomExtensionImpl> () { return myAttributes; } | getAttributes |
303,405 | List<DomExtensionImpl> () { return myFixeds; } | getFixeds |
303,406 | List<DomExtensionImpl> () { return myCollections; } | getCollections |
303,407 | List<DomExtensionImpl> () { return myCustoms; } | getCustoms |
303,408 | DomExtension (final @NotNull XmlName name, final @NotNull Type type, final int count) { assert count > 0; return addExtension(myFixeds, name, type).setCount(count); } | registerFixedNumberChildrenExtension |
303,409 | DomExtension (final @NotNull XmlName name, final @NotNull Type type) { return registerFixedNumberChildrenExtension(name, type, 1); } | registerFixedNumberChildExtension |
303,410 | DomExtension (final @NotNull XmlName name, final @NotNull Type type) { return addExtension(myCollections, name, type); } | registerCollectionChildrenExtension |
303,411 | DomExtension (final @NotNull XmlName name, final Type parameterType) { return addExtension(myAttributes, name, new ParameterizedTypeImpl(GenericAttributeValue.class, parameterType)); } | registerGenericAttributeValueChildExtension |
303,412 | DomExtension (final @NotNull XmlName name, final @NotNull Type type) { assert GenericAttributeValue.class.isAssignableFrom(ClassUtil.getRawType(type)); return addExtension(myAttributes, name, type); } | registerAttributeChildExtension |
303,413 | DomExtension (final @NotNull Type type) { return registerCustomChildrenExtension(type, CustomDomChildrenDescription.AttributeDescriptor.EMPTY); } | registerCustomChildrenExtension |
303,414 | DomExtension (@NotNull Type type, @NotNull CustomDomChildrenDescription.TagNameDescriptor descriptor) { DomExtensionImpl extension = addExtension(myCustoms, null, type); extension.setTagNameDescriptor(descriptor); return extension; } | registerCustomChildrenExtension |
303,415 | DomExtension (@NotNull Type type, @NotNull CustomDomChildrenDescription.AttributeDescriptor attributeDescriptor) { DomExtensionImpl extension = addExtension(myCustoms, null, type); extension.setAttributesDescriptor(attributeDescriptor); return extension; } | registerCustomChildrenExtension |
303,416 | DomExtensionImpl (final List<? super DomExtensionImpl> list, final @Nullable XmlName name, final Type type) { final DomExtensionImpl extension = new DomExtensionImpl(type, name); list.add(extension); return extension; } | addExtension |
303,417 | void (Object[] deps) { ContainerUtil.addAll(myDependencies, deps); } | addDependencies |
303,418 | Object[] () { return myDependencies.toArray(); } | getDependencies |
303,419 | void (@NotNull PluginDescriptor pluginDescriptor) { this.pluginDescriptor = pluginDescriptor; } | setPluginDescriptor |
303,420 | boolean () { return stubVersion != null; } | hasStubs |
303,421 | void (final @NotNull PsiReferenceRegistrar registrar) { GenericValueReferenceProvider provider = new GenericValueReferenceProvider(); registrar.registerReferenceProvider(XmlPatterns.xmlTag(), provider); registrar.registerReferenceProvider(XmlPatterns.xmlAttributeValue(), provider); } | registerReferenceProviders |
303,422 | void (@NotNull DomImplementationClassEP ep, @NotNull PluginDescriptor pluginDescriptor) { myImplementationClasses.putValue(ep.interfaceName, ep); clearCache(); } | extensionAdded |
303,423 | void (@NotNull DomImplementationClassEP ep, @NotNull PluginDescriptor pluginDescriptor) { myImplementationClasses.remove(ep.interfaceName, ep); clearCache(); } | extensionRemoved |
303,424 | void (@NotNull Class<?> concreteInterface, SortedSet<? super Class<?>> results) { Collection<DomImplementationClassEP> values = myImplementationClasses.get(concreteInterface.getName()); for (DomImplementationClassEP value : values) { if (value.getInterfaceClass() == concreteInterface) { results.add(value.getImplementationClass()); return; } } for (Class<?> aClass1 : concreteInterface.getInterfaces()) { findImplementationClassDFS(aClass1, results); } } | findImplementationClassDFS |
303,425 | void () { myImplementationClasses.remove(domElementClass.getName()); } | dispose |
303,426 | void () { final T t = myProvider.create(); if (!isNotValid(t) && !t.equals(myCachedValue)) { myCachedValue = t; } } | revalidate |
303,427 | void () { if (!isNotValid(myCachedValue)) { myCachedValue = null; } } | invalidate |
303,428 | T () { if (isNotValid(myCachedValue)) { myCachedValue = myProvider.create(); } return myCachedValue; } | getWrappedElement |
303,429 | T () { return myOldValue; } | getOldValue |
303,430 | boolean (final T t) { if (t == null || !myValidator.value(t)) return true; for (final Class<?> aClass : myClasses) { if (!aClass.isInstance(t)) return true; } return false; } | isNotValid |
303,431 | DomInvocationHandler () { final XmlTag parentTag = getParentTag(myElement); assert parentTag != null; return myDomManager.getDomHandler(parentTag); } | getParentHandler |
303,432 | XmlElement () { return myElement; } | getXmlElement |
303,433 | DomParentStrategy (final DomInvocationHandler handler) { return this; } | refreshStrategy |
303,434 | DomParentStrategy (final @NotNull XmlElement element) { myElement = element; return this; } | setXmlElement |
303,435 | String () { return "Physical:" + myElement; } | toString |
303,436 | DomParentStrategy () { final DomInvocationHandler parent = getParentHandler(); assert parent != null : "write operations should be performed on the DOM having a parent, your DOM may be not very fresh"; return new VirtualDomParentStrategy(parent); } | clearXmlElement |
303,437 | String () { return myElement.isValid() ? null : "Invalid PSI"; } | checkValidity |
303,438 | XmlFile (DomInvocationHandler handler) { return DomImplUtil.getFile(handler); } | getContainingFile |
303,439 | boolean () { return true; } | isPhysical |
303,440 | boolean (final Object o) { return strategyEquals(this, o); } | equals |
303,441 | boolean (DomParentStrategy strategy, final Object o) { if (strategy == o) return true; if (!(o instanceof DomParentStrategy)) return false; final XmlElement thatElement = ((DomParentStrategy)o).getXmlElement(); if (thatElement == null) return false; XmlElement element = strategy.getXmlElement(); if (element == null) return false; if (xmlElementsEqual(element, thatElement)) { if (element != thatElement) { final PsiElement nav1 = element.getNavigationElement(); final PsiElement nav2 = thatElement.getNavigationElement(); if (nav1 != nav2) { PsiElement curContext = findIncluder(element); PsiElement navContext = findIncluder(nav1); LOG.error( "x:include processing error\n" + "nav1,nav2=" + nav1 + "," + nav2 + ";\n" + nav1.getContainingFile() + ":" + nav1.getTextRange().getStartOffset() + "!=" + nav2.getContainingFile() + ":" + nav2.getTextRange().getStartOffset() + ";\n" + (nav1 == element) + ";" + (nav2 == thatElement) + ";\n" + "contexts equal: " + (curContext == navContext) + ";\n" + "curContext?.physical=" + (curContext != null && curContext.isPhysical()) + ";\n" + "navContext?.physical=" + (navContext != null && navContext.isPhysical()) + ";\n" + "myElement.physical=" + element.isPhysical() + ";\n" + "thatElement.physical=" + thatElement.isPhysical(), new Throwable(), new Attachment("Including tag text 1.xml", curContext == null ? "null" : curContext.getText()), new Attachment("Including tag text 2.xml", navContext == null ? "null" : navContext.getText())); throw new AssertionError(); } } return true; } return false; } | strategyEquals |
303,442 | boolean (final @NotNull PsiElement fst, final @NotNull PsiElement snd) { if (fst.equals(snd)) return true; if (fst.isValid() && fst.isPhysical() || snd.isValid() && snd.isPhysical()) return false; if (fst.getTextLength() != snd.getTextLength()) return false; if (fst.getStartOffsetInParent() != snd.getStartOffsetInParent()) return false; PsiElement nav1 = fst.getNavigationElement(); PsiElement nav2 = snd.getNavigationElement(); return nav1 != null && nav1.equals(nav2); } | xmlElementsEqual |
303,443 | int () { if (!myElement.isPhysical()) { return myElement.getNavigationElement().hashCode(); } return myElement.hashCode(); } | hashCode |
303,444 | void (@NotNull PomModelEvent event) { if (myChanging) return; TreeChangeEvent changeSet = (TreeChangeEvent)event.getChangeSet(pomModel.getModelAspect(TreeAspect.class)); if (changeSet != null) { PsiFile file = changeSet.getRootElement().getPsi().getContainingFile(); if (file instanceof XmlFile) { DomFileElementImpl<DomElement> element = getCachedFileElement((XmlFile)file); if (element != null) { fireEvent(new DomEvent(element, false)); } } } } | modelChanged |
303,445 | boolean (@NotNull PomModelAspect aspect) { return aspect instanceof TreeAspect; } | isAspectChangeInteresting |
303,446 | void () { fireEvents(domEvents); } | afterVfsChange |
303,447 | boolean (VFileEvent event) { if (event instanceof VFileContentChangeEvent) return !event.isFromSave(); if (event instanceof VFilePropertyChangeEvent) { return VirtualFile.PROP_NAME.equals(((VFilePropertyChangeEvent)event).getPropertyName()) && !((VFilePropertyChangeEvent)event).getFile().isDirectory(); } return event instanceof VFileMoveEvent || event instanceof VFileDeleteEvent; } | shouldFireDomEvents |
303,448 | void (@NotNull IdeaPluginDescriptor pluginDescriptor, boolean isUpdate) { DomUtil.clearCaches(); } | beforePluginUnload |
303,449 | void () { } | dispose |
303,450 | long () { return PsiManager.getInstance(getProject()).getModificationTracker().getModificationCount(); } | getPsiModificationCount |
303,451 | List<DomEvent> (final VirtualFile file) { if (!(file instanceof NewVirtualFile) || myProject.isDisposed()) { return Collections.emptyList(); } FileManager fileManager = PsiManagerEx.getInstanceEx(myProject).getFileManager(); final List<DomEvent> events = new ArrayList<>(); VfsUtilCore.visitChildrenRecursively(file, new VirtualFileVisitor<Void>() { @Override public boolean visitFile(@NotNull VirtualFile file) { if (!file.isDirectory() && FileTypeRegistry.getInstance().isFileOfType(file, XmlFileType.INSTANCE)) { PsiFile psiFile = fileManager.getCachedPsiFile(file); DomFileElementImpl<?> domElement = psiFile instanceof XmlFile ? getCachedFileElement((XmlFile)psiFile) : null; if (domElement != null) { events.add(new DomEvent(domElement, false)); } } return true; } @Override public Iterable<VirtualFile> getChildrenIterable(@NotNull VirtualFile file) { return ((NewVirtualFile)file).getCachedChildren(); } }); return events; } | calcDomChangeEvents |
303,452 | boolean (@NotNull VirtualFile file) { if (!file.isDirectory() && FileTypeRegistry.getInstance().isFileOfType(file, XmlFileType.INSTANCE)) { PsiFile psiFile = fileManager.getCachedPsiFile(file); DomFileElementImpl<?> domElement = psiFile instanceof XmlFile ? getCachedFileElement((XmlFile)psiFile) : null; if (domElement != null) { events.add(new DomEvent(domElement, false)); } } return true; } | visitFile |
303,453 | Iterable<VirtualFile> (@NotNull VirtualFile file) { return ((NewVirtualFile)file).getCachedChildren(); } | getChildrenIterable |
303,454 | DomManagerImpl (Project project) { return (DomManagerImpl)DomManager.getDomManager(project); } | getDomManager |
303,455 | void (DomEventListener listener, Disposable parentDisposable) { myListeners.addListener(listener, parentDisposable); } | addDomEventListener |
303,456 | ConverterManager () { return ApplicationManager.getApplication().getService(ConverterManager.class); } | getConverterManager |
303,457 | ModelMerger () { return new ModelMergerImpl(); } | createModelMerger |
303,458 | void (@NotNull Collection<? extends DomEvent> events) { for (DomEvent event : events) { fireEvent(event); } } | fireEvents |
303,459 | DomGenericInfo (final Type type) { return myApplicationComponent.getStaticGenericInfo(type); } | getGenericInfo |
303,460 | DomInvocationHandler (DomElement proxy) { DomInvocationHandler handler = getDomInvocationHandler(proxy); if (handler == null) { throw new AssertionError("null handler for " + proxy); } return handler; } | getNotNullHandler |
303,461 | DomApplicationComponent () { return myApplicationComponent; } | getApplicationComponent |
303,462 | Project () { return myProject; } | getProject |
303,463 | boolean (@Nullable PsiFile file) { return file instanceof XmlFile && getFileElement((XmlFile)file) != null; } | isDomFile |
303,464 | boolean (DomElement element) { return DomUtil.getFile(element).getUserData(MOCK) != null; } | isMockElement |
303,465 | DomElement (GenericDomValue<?> element) { final DomFileDescription<?> description = DomUtil.getFileElement(element).getFileDescription(); return description.getResolveScope(element); } | getResolvingScope |
303,466 | DomElement (DomElement element) { DomFileDescription<?> description = DomUtil.getFileElement(element).getFileDescription(); return description.getIdentityScope(element); } | getIdentityScope |
303,467 | TypeChooserManager () { return myApplicationComponent.getTypeChooserManager(); } | getTypeChooserManager |
303,468 | void () { incModificationCount(); } | clearCache |
303,469 | void () { //noinspection deprecation for (DomFileDescription<?> description : DomFileDescription.EP_NAME.getExtensionList()) { registerFileDescription(description); } for (DomFileMetaData meta : DomFileMetaData.EP_NAME.getExtensionList()) { registerFileDescription(meta); } } | registerDescriptions |
303,470 | DomApplicationComponent () { return ApplicationManager.getApplication().getService(DomApplicationComponent.class); } | getInstance |
303,471 | Stream<DomFileMetaData> () { return Stream.concat(myRootTagName2FileDescription.values().stream(), myAcceptingOtherRootTagNamesDescriptions.stream()); } | allMetas |
303,472 | DomElementsAnnotator (@NotNull Class<?> rootElementClass) { return classToAnnotator.computeIfAbsent(rootElementClass, key -> { DomFileDescription<?> desc = findFileDescription(key); return desc == null ? null : desc.createAnnotator(); }); } | getAnnotator |
303,473 | void (Class<? extends DomElement> domElementClass, Class<? extends DomElement> implementationClass, final @Nullable Disposable parentDisposable) { myCachedImplementationClasses.registerImplementation(domElementClass, implementationClass, parentDisposable); } | registerImplementation |
303,474 | StaticGenericInfo (final Type type) { return getInvocationCache(ClassUtil.getRawType(type)).genericInfo; } | getStaticGenericInfo |
303,475 | VisitorDescription (Class<? extends DomElementVisitor> aClass) { return myVisitorDescriptions.computeIfAbsent(aClass, VisitorDescription::new); } | getVisitorDescription |
303,476 | void (DomElementVisitor visitor) { } | acceptChildren |
303,477 | XmlTag () { return ensureTagExists(); } | setEmptyXmlTag |
303,478 | boolean () { return true; } | isAttribute |
303,479 | XmlElement (final @NotNull DomInvocationHandler parent) { if (!parent.isValid()) return null; final XmlTag tag = parent.getXmlTag(); if (tag == null) return null; return tag.getAttribute(getXmlElementName(), getXmlApiCompatibleNamespace(parent)); } | recomputeXmlElement |
303,480 | XmlAttribute () { XmlAttribute attribute = (XmlAttribute)getXmlElement(); if (attribute != null) return attribute; final DomManagerImpl manager = getManager(); final boolean b = manager.setChanging(true); try { attribute = ensureTagExists().setAttribute(getXmlElementName(), getXmlApiCompatibleNamespace(getParentHandler()), ""); setXmlElement(attribute); final DomElement element = getProxy(); manager.fireEvent(new DomEvent(element, true)); return attribute; } catch (IncorrectOperationException e) { LOG.error(e); return null; } finally { manager.setChanging(b); } } | ensureXmlElementExists |
303,481 | void () { final XmlTag tag = getXmlTag(); if (tag != null) { getManager().runChange(() -> { try { setXmlElement(null); tag.setAttribute(getXmlElementName(), getXmlApiCompatibleNamespace(getParentHandler()), null); } catch (IncorrectOperationException e) { LOG.error(e); } }); fireUndefinedEvent(); } } | undefineInternal |
303,482 | XmlTag () { final DomInvocationHandler parent = getParentHandler(); assert parent != null : "write operations should be performed on the DOM having a parent, your DOM may be not very fresh"; return parent.ensureTagExists(); } | ensureTagExists |
303,483 | void (final @Nullable String value) { final XmlTag tag = ensureTagExists(); final String attributeName = getXmlElementName(); final String namespace = getXmlApiCompatibleNamespace(getParentHandler()); String tagValue = tag.getAttributeValue(attributeName, namespace); final String oldValue = tagValue == null ? null : StringUtil.unescapeXmlEntities(tagValue); final String newValue = XmlStringUtil.escapeString(value); if (Comparing.equal(oldValue, newValue, true)) return; getManager().runChange(() -> { try { setXmlElement(tag.setAttribute(attributeName, namespace, newValue)); } catch (IncorrectOperationException e) { LOG.error(e); } }); final DomElement proxy = getProxy(); getManager().fireEvent(oldValue != null ? new DomEvent(proxy, false) : new DomEvent(proxy, true)); } | setValue |
303,484 | void (final DomElement other) { setValue(((GenericAttributeValue<?>) other).getStringValue()); } | copyFrom |
303,485 | Set<DomElementNavigationProvider> (DomElement domElement) { Set<DomElementNavigationProvider> result = new HashSet<>(); for (DomElementNavigationProvider navigateProvider : myProviders.values()) { if (navigateProvider.canNavigate(domElement)) result.add(navigateProvider) ; } return result; } | getDomElementsNavigateProviders |
303,486 | DomElementNavigationProvider (String providerName) { return myProviders.get(providerName); } | getDomElementsNavigateProvider |
303,487 | void (DomElementNavigationProvider provider) { myProviders.put(provider.getProviderName(), provider); } | registerDomElementsNavigateProvider |
303,488 | String () { return DEFAULT_PROVIDER_NAME; } | getProviderName |
303,489 | void (DomElement domElement, boolean requestFocus) { if (!domElement.isValid()) return; final DomFileElement<DomElement> fileElement = DomUtil.getFileElement(domElement); if (fileElement == null) return; VirtualFile file = fileElement.getFile().getVirtualFile(); if (file == null) return; XmlElement xmlElement = domElement.getXmlElement(); if (xmlElement instanceof XmlAttribute) xmlElement = ((XmlAttribute)xmlElement).getValueElement(); final OpenFileDescriptor fileDescriptor = xmlElement != null ? new OpenFileDescriptor(myProject, file, xmlElement.getTextOffset()) : new OpenFileDescriptor(myProject, file); FileEditorManagerEx.getInstanceEx(myProject).openTextEditor(fileDescriptor, requestFocus); } | navigate |
303,490 | boolean (DomElement domElement) { return domElement != null && domElement.isValid(); } | canNavigate |
303,491 | boolean () { if (myInitialized) return true; myStaticGenericInfo.buildMethodMaps(); if (!myInvocationHandler.exists()) return true; boolean fromIndexing = FileBasedIndex.getInstance().getFileBeingCurrentlyIndexed() != null; return RecursionManager.doPreventingRecursion(Pair.create(myInvocationHandler, fromIndexing), false, () -> { DomExtensionsRegistrarImpl registrar = runDomExtenders(); synchronized (myInvocationHandler) { if (!myInitialized) { if (registrar != null) { applyExtensions(registrar); } myInitialized = true; } } return Boolean.TRUE; }) == Boolean.TRUE; } | checkInitialized |
303,492 | void (DomExtensionsRegistrarImpl registrar) { XmlFile file = myInvocationHandler.getFile(); final List<DomExtensionImpl> fixeds = registrar.getFixeds(); final List<DomExtensionImpl> collections = registrar.getCollections(); final List<DomExtensionImpl> attributes = registrar.getAttributes(); if (!attributes.isEmpty()) { ChildrenDescriptionsHolder<AttributeChildDescriptionImpl> newAttributes = new ChildrenDescriptionsHolder<>(myStaticGenericInfo.getAttributes()); for (final DomExtensionImpl extension : attributes) { newAttributes.addDescription(extension.addAnnotations(new AttributeChildDescriptionImpl(extension.getXmlName(), extension.getType()))); } myAttributes = internChildrenHolder(file, newAttributes); } if (!fixeds.isEmpty()) { ChildrenDescriptionsHolder<FixedChildDescriptionImpl> newFixeds = new ChildrenDescriptionsHolder<>(myStaticGenericInfo.getFixed()); for (final DomExtensionImpl extension : fixeds) { //noinspection unchecked newFixeds.addDescription(extension.addAnnotations(new FixedChildDescriptionImpl(extension.getXmlName(), extension.getType(), extension.getCount(), ArrayUtilRt.EMPTY_COLLECTION_ARRAY))); } myFixeds = internChildrenHolder(file, newFixeds); } if (!collections.isEmpty()) { ChildrenDescriptionsHolder<CollectionChildDescriptionImpl> newCollections = new ChildrenDescriptionsHolder<>(myStaticGenericInfo.getCollections()); for (final DomExtensionImpl extension : collections) { newCollections.addDescription(extension.addAnnotations(new CollectionChildDescriptionImpl(extension.getXmlName(), extension.getType(), Collections.emptyList() ))); } myCollections = internChildrenHolder(file, newCollections); } final List<DomExtensionImpl> customs = registrar.getCustoms(); myCustomChildren = customs.isEmpty() ? null : ContainerUtil.map(customs, CustomDomChildrenDescriptionImpl::new); } | applyExtensions |
303,493 | String (DomElement element) { return myStaticGenericInfo.getElementName(element); } | getElementName |
303,494 | List<AbstractDomChildDescriptionImpl> () { checkInitialized(); final List<AbstractDomChildDescriptionImpl> list = new ArrayList<>(); myAttributes.dumpDescriptions(list); myFixeds.dumpDescriptions(list); myCollections.dumpDescriptions(list); list.addAll(myStaticGenericInfo.getCustomNameChildrenDescription()); return list; } | getChildrenDescriptions |
303,495 | List<FixedChildDescriptionImpl> () { checkInitialized(); return myFixeds.getDescriptions(); } | getFixedChildrenDescriptions |
303,496 | List<CollectionChildDescriptionImpl> () { checkInitialized(); return myCollections.getDescriptions(); } | getCollectionChildrenDescriptions |
303,497 | FixedChildDescriptionImpl (String tagName) { checkInitialized(); return myFixeds.findDescription(tagName); } | getFixedChildDescription |
303,498 | DomFixedChildDescription (@NonNls String tagName, @NonNls String namespace) { checkInitialized(); return myFixeds.getDescription(tagName, namespace); } | getFixedChildDescription |
303,499 | CollectionChildDescriptionImpl (String tagName) { checkInitialized(); return myCollections.findDescription(tagName); } | getCollectionChildDescription |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.