Unnamed: 0 int64 0 305k | body stringlengths 7 52.9k | name stringlengths 1 185 |
|---|---|---|
64,100 | boolean () { return getElement().canNavigateToSource(); } | canNavigateToSource |
64,101 | boolean (@Nullable Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; StoredData<?> data = (StoredData<?>)o; return Objects.equals(getElement(), data.getElement()) && Objects.equals(getDetails(), data.getDetails()); } | equals |
64,102 | int () { return Objects.hash(getElement(), getDetails()); } | hashCode |
64,103 | StructureViewModel (@Nullable Editor editor) { return new StructureViewModelBase(psiFile, editor, new YAMLStructureViewFile((YAMLFile)psiFile)){ @Override public @NotNull Collection<NodeProvider<?>> getNodeProviders() { return Collections.singleton(new YAMLAliasResolveNodeProvider()); } } .withSorters(Sorter.ALPHA_SORT... | createStructureViewModel |
64,104 | String (@NotNull YAMLAlias alias) { return "*" + alias.getAliasName(); } | getAliasPresentableText |
64,105 | Collection<StructureViewTreeElement> (@Nullable YAMLPsiElement element, @Nullable String path) { if (element == null) { return Collections.emptyList(); } Ref<Collection<StructureViewTreeElement>> result = Ref.create(Collections.emptyList()); element.accept(new YamlPsiElementVisitor() { @Override public void visitSequen... | createChildrenViewTreeElements |
64,106 | void (@NotNull YAMLSequence sequence) { result.set(ContainerUtil.map(sequence.getItems(), i -> path == null ? new YAMLStructureViewSequenceItemOriginal(i) : new YAMLStructureViewSequenceItemDuplicated(i, path))); } | visitSequence |
64,107 | void (@NotNull YAMLMapping mapping) { result.set(ContainerUtil.map(mapping.getKeyValues(), kv -> path == null ? new YAMLStructureViewKeyValueOriginal(kv) : new YAMLStructureViewKeyValueDuplicated(kv, path))); } | visitMapping |
64,108 | Collection<StructureViewTreeElement> () { YAMLDocument document = Objects.requireNonNull(getElement()); return YAMLStructureViewFactory.createChildrenViewTreeElements(document.getTopLevelValue(), null); } | getChildrenBase |
64,109 | String () { return YAMLBundle.message("YAMLStructureViewDocument.element.name"); } | getPresentableText |
64,110 | Icon (boolean open) { return PlatformIcons.XML_TAG_ICON; } | getIcon |
64,111 | String (@NotNull YAMLKeyValue kv) { YAMLValue value = kv.getValue(); if (value instanceof YAMLScalar) { return kv.getValueText(); } else if (value instanceof YAMLAlias) { return YAMLStructureViewFactory.getAliasPresentableText((YAMLAlias)value); } else { return null; } } | getKeyValueLocationString |
64,112 | Icon (@NotNull YAMLKeyValue kv) { YAMLValue value = kv.getValue(); if (value instanceof YAMLScalar) { return kv.getIcon(0); } else if (value instanceof YAMLAlias) { return ALIAS_ICON; } else { return PlatformIcons.XML_TAG_ICON; } } | getKeyValueIcon |
64,113 | String (@Nullable YAMLValue itemValue) { if (itemValue instanceof YAMLScalar) { return ((YAMLScalar)itemValue).getTextValue(); } else if (itemValue instanceof YAMLAlias) { return YAMLStructureViewFactory.getAliasPresentableText((YAMLAlias)itemValue); } else { return YAMLBundle.message("YAMLStructureViewSequenceItem.ele... | getSeqItemPresentableText |
64,114 | Icon (@Nullable YAMLValue itemValue) { if (itemValue instanceof YAMLScalar) { return PlatformIcons.PROPERTY_ICON; } else if (itemValue instanceof YAMLAlias) { return ALIAS_ICON; } else { return PlatformIcons.XML_TAG_ICON; } } | getSeqItemIcon |
64,115 | Collection<StructureViewTreeElement> () { return YAMLStructureViewFactory.createChildrenViewTreeElements(getKeyValue().getValue(), getDetails()); } | getChildrenBase |
64,116 | String () { return YAMLStructureViewUtil.getKeyValueLocationString(getKeyValue()); } | getLocationString |
64,117 | String () { return getKeyValue().getKeyText(); } | getPresentableText |
64,118 | Icon (boolean open) { return YAMLStructureViewUtil.getKeyValueIcon(getKeyValue()); } | getIcon |
64,119 | YAMLKeyValue () { return Objects.requireNonNull(getElement()); } | getKeyValue |
64,120 | String () { return YAMLBundle.message("YAMLAliasResolveNodeProvider.action.name"); } | getCheckBoxText |
64,121 | String () { return "FileStructurePopup"; } | getActionIdForShortcut |
64,122 | Collection<StructureViewTreeElement> (@NotNull TreeElement node) { PsiElement psiElem; String details; if (node instanceof DuplicatedPsiTreeElementBase) { DuplicatedPsiTreeElementBase yamlNode = (DuplicatedPsiTreeElementBase)node; psiElem = yamlNode.getElement(); details = yamlNode.getDetails(); } else if (node instanc... | provideNodes |
64,123 | ActionPresentation () { return new ActionPresentationData(YAMLBundle.message("YAMLAliasResolveNodeProvider.action.name"), YAMLBundle.message("YAMLAliasResolveNodeProvider.action.description"), YAMLStructureViewFactory.ALIAS_ICON); } | getPresentation |
64,124 | String () { return ID; } | getName |
64,125 | YAMLValue (@NotNull YAMLAlias alias) { YAMLAliasReference ref = alias.getReference(); YAMLAnchor anchor = ref == null ? null : ref.resolve(); return anchor != null ? anchor.getMarkedValue() : null; } | resolveAlias |
64,126 | YAMLValue (@Nullable YAMLPsiElement element) { if (element == null) { return null; } Ref<YAMLValue> result = Ref.create(); element.accept(new YamlPsiElementVisitor() { @Override public void visitKeyValue(@NotNull YAMLKeyValue keyValue) { result.set(keyValue.getValue()); } @Override public void visitSequenceItem(@NotNul... | getContainedValue |
64,127 | void (@NotNull YAMLKeyValue keyValue) { result.set(keyValue.getValue()); } | visitKeyValue |
64,128 | void (@NotNull YAMLSequenceItem sequenceItem) { result.set(sequenceItem.getValue()); } | visitSequenceItem |
64,129 | String (@NotNull PsiElement psiElem) { if (!(psiElem instanceof YAMLPsiElement)) { return ""; } return YAMLUtil.getConfigFullName((YAMLPsiElement)psiElem); } | calculateStartPath |
64,130 | Collection<StructureViewTreeElement> () { YAMLFile file = Objects.requireNonNull(getElement()); return ContainerUtil.map(file.getDocuments(), YAMLStructureViewDocument::new); } | getChildrenBase |
64,131 | String () { return getFilePresentation().getPresentableText(); } | getPresentableText |
64,132 | String () { return getFilePresentation().getLocationString(); } | getLocationString |
64,133 | Icon (boolean unused) { return getFilePresentation().getIcon(unused); } | getIcon |
64,134 | ItemPresentation () { YAMLFile file = Objects.requireNonNull(getElement()); return Objects.requireNonNull(file.getPresentation()); } | getFilePresentation |
64,135 | Collection<StructureViewTreeElement> () { return YAMLStructureViewFactory.createChildrenViewTreeElements(getKeyValue().getValue(), null); } | getChildrenBase |
64,136 | String () { return YAMLStructureViewUtil.getKeyValueLocationString(getKeyValue()); } | getLocationString |
64,137 | String () { return getKeyValue().getKeyText(); } | getPresentableText |
64,138 | Icon (boolean open) { return YAMLStructureViewUtil.getKeyValueIcon(getKeyValue()); } | getIcon |
64,139 | YAMLKeyValue () { return Objects.requireNonNull(getElement()); } | getKeyValue |
64,140 | Result (@NotNull PsiFile file, @NotNull Editor editor, @NotNull Ref<Integer> caretOffset, @NotNull Ref<Integer> caretAdvance, @NotNull DataContext dataContext, EditorActionHandler originalHandler) { // this call is not related to YAMLEnterAtIndentHandler, but is needed for `YAMLInjectedElementEnterHandler` // this call... | preprocessEnter |
64,141 | Result (@NotNull PsiFile file, @NotNull Editor editor, @NotNull DataContext dataContext) { if (!(file instanceof YAMLFile) || !file.isValid()) { return Result.Continue; } if (!shouldInsertAutomaticHyphen(file)) { return Result.Continue; } int caretOffset = editor.getCaretModel().getOffset(); if (caretOffset <= 0) { // ... | postProcessEnter |
64,142 | boolean (@Nullable PsiElement prevSibling) { return prevSibling instanceof YAMLSequenceItem && "-".equals(prevSibling.getText()); } | isEmptySequenceItem |
64,143 | boolean (@NotNull PsiFile file) { return CodeStyle.getCustomSettings(file, YAMLCodeStyleSettings.class).AUTOINSERT_SEQUENCE_MARKER; } | shouldInsertAutomaticHyphen |
64,144 | YAMLEditorOptions () { return this; } | getState |
64,145 | void (@NotNull final YAMLEditorOptions state) { XmlSerializerUtil.copyBean(state, this); } | loadState |
64,146 | boolean () { return myUseSmartPaste; } | isUseSmartPaste |
64,147 | void (boolean useSmartPaste) { this.myUseSmartPaste = useSmartPaste; } | setUseSmartPaste |
64,148 | YAMLEditorOptions () { return ApplicationManager.getApplication().getService(YAMLEditorOptions.class); } | getInstance |
64,149 | String (PsiFile file, int[] startOffsets, int[] endOffsets, String text) { if (startOffsets.length != 1 || endOffsets.length != 1) { return null; } Document document = PsiDocumentManager.getInstance(file.getProject()).getDocument(file); if (document == null) { return null; } int caretOffset = startOffsets[0]; PsiElemen... | preprocessOnCopy |
64,150 | boolean (PsiElement element) { return PsiUtilCore.getElementType(element) instanceof YAMLElementType; } | isYamlElementType |
64,151 | String (Project project, PsiFile file, Editor editor, String text, RawText rawText) { if (!file.getViewProvider().hasLanguage(YAMLLanguage.INSTANCE)) return text; CaretModel caretModel = editor.getCaretModel(); SelectionModel selectionModel = editor.getSelectionModel(); int caretOffset = selectionModel.getSelectionStar... | preprocessOnPaste |
64,152 | boolean (@Nullable PsiElement element) { return element != null && isCommentNode(element.getNode()); } | isCommentElement |
64,153 | boolean (@Nullable ASTNode node) { return node != null && YAMLTokenTypes.COMMENT == PsiUtilCore.getElementType(node.getElementType() == YAMLTokenTypes.EOL ? node.getTreePrev() : node); } | isCommentNode |
64,154 | boolean (int caretOffset, Document document) { for (int i = caretOffset; i < document.getTextLength(); i++) { char c = document.getCharsSequence().charAt(i); if (c == '\n') return false; if (!Character.isWhitespace(c)) return true; } return false; // insert at the end of the document } | shouldInsertIndentAtTheEnd |
64,155 | boolean (PsiFile file, int caretOffset) { PsiElement element = file.findElementAt(caretOffset); if (element != null) { if (PsiUtilCore.getElementType(element) == YAMLTokenTypes.SCALAR_LIST || PsiUtilCore.getElementType(element.getParent()) == YAMLElementTypes.SCALAR_LIST_VALUE) { return false; } TokenSet ends = TokenSe... | canBeInsertedWithIndentAdjusted |
64,156 | String (@NotNull String text, @NotNull String curLineIndent, boolean shouldInsertIndentInTheEnd) { List<String> lines = LineTokenizer.tokenizeIntoList(text, false, false); if (lines.isEmpty()) { // Such situation sometimes happens but I don't know how it is possible return text; } int minIndent = calculateMinBlockInden... | indentText |
64,157 | int (@NotNull List<String> list) { Iterator<String> it = list.iterator(); String str = ""; while (it.hasNext()) { str = it.next(); if (!isEmptyLine(str)) { break; } } if (!it.hasNext()) { return 0; } int minIndent = YAMLTextUtil.getStartIndentSize(str); while (it.hasNext()) { str = it.next(); if (!isEmptyLine(str)) { m... | calculateMinBlockIndent |
64,158 | boolean (@NotNull String str) { return YAMLTextUtil.getStartIndentSize(str) == str.length(); } | isEmptyLine |
64,159 | String (@NotNull String text, @NotNull PsiFile file, @NotNull Editor editor, int caretOffset, int indent) { if (!text.matches(CONFIG_KEY_SEQUENCE_PATTERN)) { return null; } List<String> keys = separateCompositeKey(text); assert !keys.isEmpty(); for (String key: keys) { if (!YamlKeyValueRenameInputValidator.IDENTIFIER_P... | tryToPasteAsKeySequence |
64,160 | YAMLKeyValue (@NotNull PsiElement element) { if (PsiUtilCore.getElementType(element.getParent()) != YAMLElementTypes.MAPPING) { // TODO: RUBY-22437 support JSON-like mappings return null; } boolean eolMet = false; PsiElement cur; for (cur = element; cur != null; cur = cur.getPrevSibling()) { if (!YAMLElementTypes.BLANK... | getPreviousKeyValuePairBeforeEOL |
64,161 | String (@NotNull Editor editor, @NotNull List<String> keys, @NotNull PsiElement element, int caretOffset, int indent) { while (true) { // TODO: RUBY-22437 support JSON-like mappings YAMLBlockMappingImpl blockMapping; if (element.getParent() instanceof YAMLFile) { // We are at the end of the file PsiElement prev = eleme... | tryToPasteAsKeySequenceAtMapping |
64,162 | List<String> (@NotNull String text) { text = text.trim(); text = StringUtil.trimEnd(text, ':'); int leadingDotsNumber = StringUtil.countChars(text, '.', 0, true); String dotPrefix = text.substring(0, leadingDotsNumber); text = text.substring(leadingDotsNumber); List<String> sequence = new ArrayList<>(StringUtil.split(t... | separateCompositeKey |
64,163 | boolean (@NotNull Editor editor, @NotNull Project project) { return false; } | requiresAllDocumentsToBeCommitted |
64,164 | void (@NotNull List<FoldingDescriptor> descriptors, @NotNull PsiElement root, @NotNull Document document, boolean quick) { collectDescriptors(root, descriptors); } | buildLanguageFoldRegions |
64,165 | void (@NotNull final PsiElement element, @NotNull final List<? super FoldingDescriptor> descriptors) { TextRange nodeTextRange = element.getTextRange(); if (nodeTextRange.getLength() < 2) { return; } if (element instanceof YAMLDocument) { if (PsiTreeUtil.findChildrenOfAnyType(element.getParent(), YAMLDocument.class).si... | collectDescriptors |
64,166 | PsiElement (PsiElement child, @NotNull List<? super FoldingDescriptor> descriptors) { PsiComment startComment = null; PsiComment endComment = null; int commentsCount = 0; while (child instanceof PsiComment) { commentsCount++; if (startComment == null) { startComment = (PsiComment)child; } endComment = (PsiComment)child... | foldComments |
64,167 | PsiElement (PsiElement element) { int eol = 0; while (element != null) { IElementType elementType = PsiUtilCore.getElementType(element); if (YAMLElementTypes.EOL_ELEMENTS.contains(elementType)) { if (eol > 0) break; eol++; } if (!YAMLElementTypes.SPACE_ELEMENTS.contains(elementType)) break; element = element.getNextSib... | skipSpaceElementsUpToLine |
64,168 | String (@NotNull ASTNode node, @NotNull TextRange range) { return getPlaceholderText(SourceTreeToPsiMap.treeElementToPsi(node)); } | getLanguagePlaceholderText |
64,169 | String (@Nullable PsiElement psiElement) { if (psiElement instanceof YAMLDocument) { return "---"; } else if (psiElement instanceof PsiComment) { return "# ..."; } else if (psiElement instanceof YAMLScalar) { return normalizePlaceHolderText(((YAMLScalar)psiElement).getTextValue()); } else if (psiElement instanceof YAML... | getPlaceholderText |
64,170 | boolean (@NotNull ASTNode node) { return false; } | isRegionCollapsedByDefault |
64,171 | String (@Nullable String text) { if (text == null) { return null; } if (text.length() <= PLACEHOLDER_LEN) { return text; } return StringUtil.trimMiddle(text, PLACEHOLDER_LEN); } | normalizePlaceHolderText |
64,172 | String (PsiElement element, final boolean preferShort) { final JsonSchemaService jsonSchemaService = JsonSchemaService.Impl.get(element.getProject()); PsiFile containingFile = element.getContainingFile(); if (containingFile == null) return null; JsonSchemaObject schemaObject = jsonSchemaService.getSchemaObject(containi... | findSchemaAndGenerateDoc |
64,173 | PsiElement (@NotNull Editor editor, @NotNull PsiFile file, @Nullable PsiElement contextElement, int targetOffset) { JsonSchemaService service = JsonSchemaService.Impl.get(file.getProject()); if (service == null || service.getSchemaObject(file) == null) return null; return contextElement; } | getCustomDocumentationElement |
64,174 | List<JsonValueAdapter> () { return myChildAdapters.getValue(); } | getElements |
64,175 | boolean () { return false; } | isObject |
64,176 | boolean () { PsiElement tag = myArray.getTag(); return tag == null || "!!seq".equals(tag.getText()); } | isArray |
64,177 | boolean () { return false; } | isStringLiteral |
64,178 | boolean () { return false; } | isNumberLiteral |
64,179 | boolean () { return false; } | isBooleanLiteral |
64,180 | PsiElement () { return myArray; } | getDelegate |
64,181 | JsonObjectValueAdapter () { return null; } | getAsObject |
64,182 | JsonArrayValueAdapter () { return this; } | getAsArray |
64,183 | List<JsonValueAdapter> () { List<YAMLSequenceItem> items = myArray.getItems(); List<JsonValueAdapter> adapters = new ArrayList<>(items.size()); for (YAMLSequenceItem item: items) { YAMLValue value = item.getValue(); if (value == null) { JsonValueAdapter emptyAdapter = YamlPropertyAdapter.createEmptyValueAdapter(item.ge... | computeChildAdapters |
64,184 | String () { return myProperty instanceof YAMLKeyValue ? ((YAMLKeyValue)myProperty).getKeyText() : myProperty.getText(); } | getName |
64,185 | JsonValueAdapter () { if (!(myProperty instanceof YAMLKeyValue)) return null; PsiElement key = ((YAMLKeyValue)myProperty).getKey(); if (key == null) return null; return new YamlPropertyKeyAdapter(key); } | getNameValueAdapter |
64,186 | Collection<JsonValueAdapter> () { YAMLValue value = myProperty instanceof YAMLKeyValue ? ((YAMLKeyValue)myProperty).getValue() : null; return value != null ? Collections.singletonList(createValueAdapterByType(value)) : ContainerUtil.createMaybeSingletonList(createEmptyValueAdapter(myProperty, false)); } | getValues |
64,187 | PsiElement () { return myProperty; } | getDelegate |
64,188 | JsonObjectValueAdapter () { YAMLMapping parentMapping = myProperty instanceof YAMLKeyValue ? ((YAMLKeyValue)myProperty).getParentMapping() : ObjectUtils.tryCast(myProperty.getParent(), YAMLMapping.class); return parentMapping != null ? new YamlObjectAdapter(parentMapping) : null; } | getParentObject |
64,189 | JsonValueAdapter (@NotNull YAMLValue value) { if (value instanceof YAMLAlias) { PsiElement result = YamlObjectAdapter.resolveYamlAlias(value); if (result instanceof YAMLValue) { JsonValueAdapter adapter = RecursionManager.doPreventingRecursion(value, false, () -> createValueAdapterByType((YAMLValue)result)); if (adapte... | createValueAdapterByType |
64,190 | JsonValueAdapter (@NotNull PsiElement context, boolean pinSelf) { if (context instanceof YAMLKeyValue && ((YAMLKeyValue)context).getValue() == null) { PsiElement next = PsiTreeUtil.skipWhitespacesAndCommentsForward(context); if (PsiUtilCore.getElementType(next) == YAMLTokenTypes.EOL) { next = PsiTreeUtil.skipWhitespace... | createEmptyValueAdapter |
64,191 | boolean (@NotNull PsiElement element) { return element.getContainingFile() instanceof YAMLFile; } | handles |
64,192 | JsonLikePsiWalker (@NotNull JsonSchemaObject schemaObject) { return YamlJsonPsiWalker.INSTANCE; } | create |
64,193 | ThreeState (PsiElement element) { PsiElement parent = element.getParent(); if (parent instanceof YAMLDocument || parent instanceof YAMLMapping) { return ThreeState.YES; } if (parent instanceof YAMLKeyValue && isFirstChild(element, parent)) { ASTNode prev = element.getNode().getTreePrev(); return prev.getElementType() =... | isName |
64,194 | boolean (PsiElement element, PsiElement parent) { PsiElement[] children = parent.getChildren(); return children.length != 0 && children[0] == element; } | isFirstChild |
64,195 | boolean (@NotNull PsiElement element) { return element instanceof YAMLKeyValue && ((YAMLKeyValue)element).getValue() != null; } | isPropertyWithValue |
64,196 | boolean (@NotNull PsiElement element) { return element instanceof YAMLFile || element instanceof YAMLDocument; } | isTopJsonElement |
64,197 | boolean () { return true; } | acceptsEmptyRoot |
64,198 | PsiElement (@NotNull PsiElement element) { PsiElement current = element; while (current != null && !(current instanceof PsiFile)) { if (current instanceof YAMLValue || current instanceof YAMLKeyValue) { return current; } current = current.getParent(); } return null; } | findElementToCheck |
64,199 | boolean () { return false; } | requiresNameQuotes |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.