Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
63,900
void (@NotNull BuildScriptDataBuilder buildScriptData, String pluginVersion, String ideVersion) { buildScriptData .addPluginDefinitionInPluginsGroup("id(\"org.jetbrains.intellij\") version \"" + pluginVersion + "\"") .addOther(HELP_COMMENT + "intellij {\n" + " version.set(\"" + ideVersion + "\")\n" + "}\n") .addOther("...
configureBuildScript
63,901
FrameworkTypeEx () { return new FrameworkTypeEx(ID) { @Override public @NotNull FrameworkSupportInModuleProvider createProvider() { return GradleIntellijPluginFrameworkSupportProvider.this; } @Override public @NotNull String getPresentableName() { return DevKitGradleBundle.message("module.wizard.gradle.presentable.name...
getFrameworkType
63,902
FrameworkSupportInModuleProvider () { return GradleIntellijPluginFrameworkSupportProvider.this; }
createProvider
63,903
String () { return DevKitGradleBundle.message("module.wizard.gradle.presentable.name"); }
getPresentableName
63,904
Icon () { return IconManager.getInstance().getPlatformIcon(PlatformIcons.Plugin); }
getIcon
63,905
void (@NotNull ProjectId projectId, @NotNull Module module, @NotNull ModifiableRootModel rootModel, @NotNull ModifiableModelsProvider modifiableModelsProvider, @NotNull BuildScriptDataBuilder buildScriptData) { String pluginVersion = PropertiesComponent.getInstance().getValue(LATEST_GRADLE_VERSION_KEY, FALLBACK_VERSION...
addSupport
63,906
void (@NotNull BuildScriptDataBuilder buildScriptData, @NonNls String pluginVersion, @NonNls String ideVersion) { buildScriptData .addPluginDefinitionInPluginsGroup("id 'org.jetbrains.intellij' version '" + pluginVersion + "'") .addOther(HELP_COMMENT + "intellij {\n version = '" + ideVersion + "'\n}\n") .addOther(""" p...
configureBuildScript
63,907
JComponent () { // checking new gradle version on creating component String latestVersion = PropertiesComponent.getInstance().getValue(LATEST_GRADLE_VERSION_KEY); long timeCheck = PropertiesComponent.getInstance().getLong(LATEST_UPDATING_TIME_KEY, System.currentTimeMillis()); if (latestVersion == null || TimeUnit.MILLI...
createComponent
63,908
boolean (@NotNull ProjectId projectId, @NotNull Module module, @NotNull String contentRootPath) { try { VirtualFile metaInf = VfsUtil.createDirectoryIfMissing(contentRootPath + META_INF_PATH); if (metaInf == null) { return false; } if (metaInf.findChild(PluginManagerCore.PLUGIN_XML) != null) { return true; } Project pr...
createPluginXml
63,909
void (@NotNull Module module, @NotNull String contentRootPath) { RunManager runManager = RunManager.getInstance(module.getProject()); ConfigurationFactory configurationFactory = new GradleExternalTaskConfigurationType().getConfigurationFactories()[0]; String configurationName = DevKitBundle.message("run.configuration.t...
createRunConfiguration
63,910
CodeStyleConfigurable (@NotNull final CodeStyleSettings settings, @NotNull final CodeStyleSettings originalSettings) { return new CodeStyleAbstractConfigurable(settings, originalSettings, YAMLLanguage.INSTANCE.getDisplayName()) { @Override protected @NotNull CodeStyleAbstractPanel createPanel(final @NotNull CodeStyleSe...
createConfigurable
63,911
CodeStyleAbstractPanel (final @NotNull CodeStyleSettings settings) { final CodeStyleSettings currentSettings = getCurrentSettings(); return new TabbedLanguageCodeStylePanel(YAMLLanguage.INSTANCE, currentSettings, settings) { @Override protected void initTabs(final CodeStyleSettings settings) { addIndentOptionsTab(setti...
createPanel
63,912
void (final CodeStyleSettings settings) { addIndentOptionsTab(settings); addSpacesTab(settings); addWrappingAndBracesTab(settings); }
initTabs
63,913
String () { return "reference.settingsdialog.codestyle.yaml"; }
getHelpTopic
63,914
String () { return YAMLLanguage.INSTANCE.getDisplayName(); }
getConfigurableDisplayName
63,915
CustomCodeStyleSettings (@NotNull CodeStyleSettings settings) { return new YAMLCodeStyleSettings(settings); }
createCustomSettings
63,916
void (@NotNull CommonCodeStyleSettings commonSettings, @NotNull CommonCodeStyleSettings.IndentOptions indentOptions) { indentOptions.INDENT_SIZE = 2; indentOptions.CONTINUATION_INDENT_SIZE = 2; indentOptions.USE_TAB_CHARACTER = false; commonSettings.SPACE_WITHIN_BRACES = true; commonSettings.SPACE_WITHIN_BRACKETS = tru...
customizeDefaults
63,917
IndentOptionsEditor () { return new YAMLIndentOptionsEditor(this); }
getIndentOptionsEditor
63,918
Language () { return YAMLLanguage.INSTANCE; }
getLanguage
63,919
void (@NotNull CodeStyleSettingsCustomizable consumer, @NotNull SettingsType settingsType) { if (settingsType == SettingsType.INDENT_SETTINGS) { consumer.showStandardOptions("INDENT_SIZE", "KEEP_INDENTS_ON_EMPTY_LINES"); } else if (settingsType == SettingsType.SPACING_SETTINGS) { consumer.showStandardOptions("SPACE_WIT...
customizeSettings
63,920
String (@NotNull SettingsType settingsType) { return CodeStyleAbstractPanel.readFromFile(YAMLBundle.class, "indents.yml"); }
getCodeSample
63,921
void () { super.addComponents(); myIndentSequence = new JCheckBox(YAMLBundle.message("YAMLLanguageCodeStyleSettingsProvider.indent.sequence.value")); add(myIndentSequence); }
addComponents
63,922
void (boolean enabled) { super.setEnabled(enabled); myIndentSequence.setEnabled(enabled); }
setEnabled
63,923
boolean (@NotNull CodeStyleSettings settings, @NotNull CommonCodeStyleSettings.IndentOptions options) { boolean isModified = super.isModified(settings, options); YAMLCodeStyleSettings yamlSettings = settings.getCustomSettings(YAMLCodeStyleSettings.class); isModified |= isFieldModified(myIndentSequence, yamlSettings.IND...
isModified
63,924
void (@NotNull CodeStyleSettings settings, @NotNull CommonCodeStyleSettings.IndentOptions options) { super.apply(settings, options); YAMLCodeStyleSettings yamlSettings = settings.getCustomSettings(YAMLCodeStyleSettings.class); yamlSettings.INDENT_SEQUENCE_VALUE = myIndentSequence.isSelected(); }
apply
63,925
void (@NotNull CodeStyleSettings settings, @NotNull CommonCodeStyleSettings.IndentOptions options) { super.reset(settings, options); YAMLCodeStyleSettings yamlSettings = settings.getCustomSettings(YAMLCodeStyleSettings.class); myIndentSequence.setSelected(yamlSettings.INDENT_SEQUENCE_VALUE); }
reset
63,926
String () { return "YAML"; }
getDisplayName
63,927
boolean (@NotNull IElementType iElementType, @Nullable IElementType iElementType1) { return true; }
isPairedBracesAllowedBeforeType
63,928
int (final PsiFile file, final int openingBraceOffset) { return openingBraceOffset; }
getCodeConstructStart
63,929
int (@NotNull Document document, int line) { if (line >= document.getLineCount()) return document.getTextLength(); if (line < 0) return 0; return document.getLineStartOffset(line); }
getLineStartSafeOffset
63,930
int (@NotNull CharSequence text) { int stop; for (stop = 0; stop < text.length(); stop++) { final char c = text.charAt(stop); if (!(c == ' ' || c == '\t')) { break; } } return stop; }
getStartIndentSize
63,931
String (@NotNull String text, int indent) { StringBuilder buffer = new StringBuilder(); String indentString = StringUtil.repeatSymbol(' ', indent); buffer.append(indentString); for (int i = 0; i < text.length(); i++) { char c = text.charAt(i); buffer.append(c); if (c == '\n') { buffer.append(indentString); } } return b...
indentText
63,932
Lexer () { return new YAMLFlexLexer(); }
getHighlightingLexer
63,933
String () { return "YAML"; }
getName
63,934
String () { return YAMLBundle.message("filetype.yaml.description"); }
getDescription
63,935
String () { return DEFAULT_EXTENSION; }
getDefaultExtension
63,936
Icon () { return AllIcons.FileTypes.Yaml; }
getIcon
63,937
void (@NotNull PsiReferenceRegistrar registrar) { registrar.registerReferenceProvider( or(psiElement(YAMLQuotedText.class), psiElement(YAMLPlainTextImpl.class)), new PsiReferenceProvider() { @Override public boolean acceptsTarget(@NotNull PsiElement target) { return false; // web references do not point to any real Psi...
registerReferenceProviders
63,938
boolean (@NotNull PsiElement target) { return false; // web references do not point to any real PsiElement }
acceptsTarget
63,939
String () { return YAMLBundle.message("color.settings.yaml.name"); }
getDisplayName
63,940
Icon () { return YAMLFileType.YML.getIcon(); }
getIcon
63,941
SyntaxHighlighter () { return new YAMLSyntaxHighlighter(); }
getHighlighter
63,942
String () { return DEMO_TEXT; }
getDemoText
63,943
String () { return LINE_COMMENT_PREFIX; }
getLineCommentPrefix
63,944
String () { // N/A return null; }
getBlockCommentPrefix
63,945
String () { // N/A return null; }
getBlockCommentSuffix
63,946
String () { return null; }
getCommentedBlockCommentPrefix
63,947
String () { return null; }
getCommentedBlockCommentSuffix
63,948
SyntaxHighlighter (Project project, VirtualFile virtualFile) { return new YAMLSyntaxHighlighter(); }
getSyntaxHighlighter
63,949
Lexer (final Project project) { return new YAMLFlexLexer(); }
createLexer
63,950
PsiParser (final Project project) { return new YAMLParser(); }
createParser
63,951
IFileElementType () { return FILE; }
getFileNodeType
63,952
TokenSet () { return YAMLElementTypes.WHITESPACE_TOKENS; }
getWhitespaceTokens
63,953
TokenSet () { return YAMLElementTypes.YAML_COMMENT_TOKENS; }
getCommentTokens
63,954
TokenSet () { return YAMLElementTypes.TEXT_SCALAR_ITEMS; }
getStringLiteralElements
63,955
PsiElement (final ASTNode node) { final IElementType type = node.getElementType(); if (type == YAMLElementTypes.DOCUMENT){ return new YAMLDocumentImpl(node); } if (type == YAMLElementTypes.KEY_VALUE_PAIR) { return new YAMLKeyValueImpl(node); } if (type == YAMLElementTypes.COMPOUND_VALUE) { return new YAMLCompoundValueI...
createElement
63,956
PsiFile (final @NotNull FileViewProvider viewProvider) { return new YAMLFileImpl(viewProvider); }
createFile
63,957
SpaceRequirements (final ASTNode left, final ASTNode right) { return SpaceRequirements.MAY; }
spaceExistenceTypeBetweenTokens
63,958
YAMLElementGenerator (Project project) { return project.getService(YAMLElementGenerator.class); }
getInstance
63,959
String (@NotNull List<String> keyComponents, int indentAddition) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < keyComponents.size(); ++i) { if (i > 0) { sb.append(StringUtil.repeatSymbol(' ', indentAddition + 2 * i)); } sb.append(keyComponents.get(i)).append(":"); if (i + 1 < keyComponents.size()) { sb....
createChainedKey
63,960
YAMLKeyValue (@NotNull String keyName, @NotNull String valueText) { final PsiFile tempValueFile = createDummyYamlWithText(valueText); Collection<YAMLValue> values = PsiTreeUtil.collectElementsOfType(tempValueFile, YAMLValue.class); String text; if (!values.isEmpty() && values.iterator().next() instanceof YAMLScalar && ...
createYamlKeyValue
63,961
YAMLQuotedTextImpl () { final YAMLFile tempFile = createDummyYamlWithText("\"foo\""); return PsiTreeUtil.collectElementsOfType(tempFile, YAMLQuotedTextImpl.class).iterator().next(); }
createYamlDoubleQuotedString
63,962
YAMLFile (@NotNull String text) { return (YAMLFile) PsiFileFactory.getInstance(myProject) .createFileFromText("temp." + YAMLFileType.YML.getDefaultExtension(), YAMLFileType.YML, text, LocalTimeCounter.currentTime(), false); }
createDummyYamlWithText
63,963
PsiElement () { final YAMLFile file = createDummyYamlWithText("\n"); return PsiTreeUtil.getDeepestFirst(file); }
createEol
63,964
PsiElement () { final YAMLKeyValue keyValue = createYamlKeyValue("foo", "bar"); final ASTNode whitespaceNode = keyValue.getNode().findChildByType(TokenType.WHITE_SPACE); assert whitespaceNode != null; return whitespaceNode.getPsi(); }
createSpace
63,965
PsiElement (int size) { final YAMLFile file = createDummyYamlWithText(StringUtil.repeatSymbol(' ', size)); return PsiTreeUtil.getDeepestFirst(file); }
createIndent
63,966
PsiElement () { final YAMLFile file = createDummyYamlWithText("? foo : bar"); final PsiElement at = file.findElementAt("? foo ".length()); assert at != null && at.getNode().getElementType() == YAMLTokenTypes.COLON; return at; }
createColon
63,967
PsiElement () { final YAMLFile file = createDummyYamlWithText("---"); PsiElement at = file.findElementAt(0); assert at != null && at.getNode().getElementType() == YAMLTokenTypes.DOCUMENT_MARKER; return at; }
createDocumentMarker
63,968
YAMLSequence () { YAMLSequence sequence = PsiTreeUtil.findChildOfType(createDummyYamlWithText("- dummy"), YAMLSequence.class); assert sequence != null; sequence.deleteChildRange(sequence.getFirstChild(), sequence.getLastChild()); return sequence; }
createEmptySequence
63,969
YAMLSequenceItem () { YAMLSequenceItem sequenceItem = PsiTreeUtil.findChildOfType(createDummyYamlWithText("- dummy"), YAMLSequenceItem.class); assert sequenceItem != null; YAMLValue value = sequenceItem.getValue(); assert value != null; value.deleteChildRange(value.getFirstChild(), value.getLastChild()); return sequenc...
createEmptySequenceItem
63,970
WordsScanner () { return new YAMLWordsScanner(); }
getWordsScanner
63,971
boolean (@NotNull PsiElement psiElement) { return psiElement instanceof PsiNamedElement || psiElement instanceof YAMLScalar; }
canFindUsagesFor
63,972
String (@NotNull PsiElement psiElement) { return HelpID.FIND_OTHER_USAGES; }
getHelpId
63,973
String (@NotNull PsiElement element) { if (element instanceof YAMLScalarText) { return YAMLBundle.message("find.usages.scalar"); } else if (element instanceof YAMLSequence) { return YAMLBundle.message("find.usages.sequence"); } else if (element instanceof YAMLMapping) { return YAMLBundle.message("find.usages.mapping");...
getType
63,974
String (@NotNull PsiElement element) { if (element instanceof PsiNamedElement) { return StringUtil.notNullize(((PsiNamedElement)element).getName(), YAMLBundle.message("find.usages.unnamed")); } if (element instanceof YAMLScalar) { return ((YAMLScalar)element).getTextValue(); } return YAMLBundle.message("find.usages.unn...
getDescriptiveName
63,975
String (@NotNull PsiElement element, boolean useFullName) { return getDescriptiveName(element); }
getNodeText
63,976
String (@NotNull YAMLPsiElement target) { return StringUtil.join(getConfigFullNameParts(target), "."); }
getConfigFullName
63,977
List<String> (@NotNull YAMLPsiElement target) { SmartList<String> result = new SmartList<>(); PsiElement element = target; while (element != null) { String elementIndexSuffix = ""; if (element instanceof YAMLSequenceItem) { elementIndexSuffix = "[" + ((YAMLSequenceItem)element).getItemIndex() + "]"; element = PsiTreeUt...
getConfigFullNameParts
63,978
Collection<YAMLKeyValue> (final YAMLFile file) { final YAMLValue topLevelValue = file.getDocuments().get(0).getTopLevelValue(); if (topLevelValue instanceof YAMLMapping) { return ((YAMLMapping)topLevelValue).getKeyValues(); } else { return Collections.emptyList(); } }
getTopLevelKeys
63,979
YAMLKeyValue (final YAMLFile file, List<String> key) { return getQualifiedKeyInDocument(file.getDocuments().get(0), key); }
getQualifiedKeyInFile
63,980
YAMLKeyValue (@NotNull YAMLDocument document, @NotNull List<String> key) { assert key.size() != 0; YAMLMapping mapping = ObjectUtils.tryCast(document.getTopLevelValue(), YAMLMapping.class); for (int i = 0; i < key.size(); i++) { if (mapping == null) { return null; } YAMLKeyValue keyValue = mapping.getKeyValueByKey(Stri...
getQualifiedKeyInDocument
63,981
YAMLKeyValue (final YAMLFile file, String... key) { return getQualifiedKeyInFile(file, Arrays.asList(key)); }
getQualifiedKeyInFile
63,982
YAMLKeyValue (@Nullable YAMLValue node, @NotNull String keyText) { if (!(node instanceof YAMLMapping)) { return null; } return ((YAMLMapping)node).getKeyValueByKey(keyText); }
findKeyInProbablyMapping
63,983
YAMLKeyValue (final YAMLFile file, final String key, final String text) { return createI18nRecord(file, key.split("\\."), text); }
createI18nRecord
63,984
YAMLKeyValue (final YAMLFile file, final String[] key, final String text) { final YAMLDocument root = file.getDocuments().get(0); assert root != null; assert key.length > 0; YAMLMapping rootMapping = PsiTreeUtil.findChildOfType(root, YAMLMapping.class); if (rootMapping == null) { final YAMLFile yamlFile = YAMLElementGe...
createI18nRecord
63,985
PsiElement (final YAMLKeyValue element, final String newName) { if (newName.equals(element.getName())) { throw new IncorrectOperationException(YAMLBundle.message("rename.same.name")); } final YAMLKeyValue topKeyValue = YAMLElementGenerator.getInstance(element.getProject()).createYamlKeyValue(newName, "Foo"); final PsiE...
rename
63,986
int (@NotNull final PsiElement elementInLine) { PsiElement currentElement = elementInLine; while (currentElement != null) { final IElementType type = currentElement.getNode().getElementType(); if (type == YAMLTokenTypes.EOL) { return 0; } if (type == YAMLTokenTypes.INDENT) { return currentElement.getTextLength(); } cur...
getIndentInThisLine
63,987
int (@NotNull PsiElement element) { if (element instanceof YAMLBlockMappingImpl) { try { element = ((YAMLBlockMappingImpl)element).getFirstKeyValue(); } catch (IllegalStateException e) { // Spring Boot plug-in modifies PSI-tree into invalid state // This is workaround over EA-133507 IDEA-210113 if (!e.getMessage().equa...
getIndentToThisElement
63,988
boolean (@NotNull PsiElement psi1, @NotNull PsiElement psi2) { PsiElement leaf = firstLeaf(psi1); PsiElement lastLeaf = firstLeaf(psi2); while (leaf != null) { if (PsiUtilCore.getElementType(leaf) == YAMLTokenTypes.EOL) { return false; } if (leaf == lastLeaf) { return true; } leaf = PsiTreeUtil.nextLeaf(leaf); } // It ...
psiAreAtTheSameLine
63,989
void (@NotNull final PsiElement element) { if (element.getNextSibling() != null) { deleteElementsOfType(element::getNextSibling, BLANK_LINE_ELEMENTS); deleteElementsOfType(element::getNextSibling, YAMLElementTypes.SPACE_ELEMENTS); } else { deleteElementsOfType(element::getPrevSibling, YAMLElementTypes.SPACE_ELEMENTS); ...
deleteSurroundingWhitespace
63,990
void (@NotNull final Supplier<? extends PsiElement> element, @NotNull final TokenSet types) { while (element.get() != null && types.contains(PsiUtilCore.getElementType(element.get()))) { element.get().delete(); } }
deleteElementsOfType
63,991
void (@NotNull YAMLQuotedText element, @NotNull TokenConsumer consumer) { TextRange range = ElementManipulators.getValueTextRange(element); if (!range.isEmpty()) { String text = ElementManipulators.getValueText(element); consumer.consumeToken(element, text, false, range.getStartOffset(), TextRange.allOf(text), PlainTex...
tokenize
63,992
PsiElement () { return element; }
getElement
63,993
boolean (@NotNull JsonSchemaService service, @NotNull JsonSchemaObject rootSchema) { return false; }
isXIntellijInjection
63,994
void (@NotNull InsertionContext context, @NotNull T item) { final PsiElement currentElement = context.getFile().findElementAt(context.getStartOffset()); assert currentElement != null : "no element at " + context.getStartOffset(); YAMLKeyValue parent = PsiTreeUtil.getParentOfType(currentElement, YAMLKeyValue.class); fin...
handleInsert
63,995
YAMLValue (InsertionContext context, @NotNull PsiElement elementAtCaret) { final YAMLValue oldValue; if (elementAtCaret.getNode().getElementType() != YAMLTokenTypes.SCALAR_KEY) { deleteLookupPlain(context); return null; } final YAMLKeyValue keyValue = PsiTreeUtil.getParentOfType(elementAtCaret, YAMLKeyValue.class); ass...
deleteLookupTextAndRetrieveOldValue
63,996
void (InsertionContext context) { final Document document = context.getDocument(); final CharSequence sequence = document.getCharsSequence(); int offset = context.getStartOffset() - 1; while (offset >= 0) { final char c = sequence.charAt(offset); if (c != ' ' && c != '\t') { if (c == '\n') { offset--; } else { offset =...
deleteLookupPlain
63,997
boolean (Editor editor, char ch) { final int startOffset = editor.getCaretModel().getOffset(); final Document document = editor.getDocument(); return document.getTextLength() > startOffset && document.getCharsSequence().charAt(startOffset) == ch; }
isCharAtCaret
63,998
void (YAMLSequence yamlSequence) { List<YAMLSequenceItem> items = yamlSequence.getItems(); if (items.size() > 1) { YAMLElementGenerator elementGenerator = YAMLElementGenerator.getInstance(yamlSequence.getProject()); for (int i = 1; i < items.size(); i++) { PsiElement element = items.get(i).getPrevSibling(); if (element...
trimSequenceItemIndents
63,999
void (@NotNull PsiElement element, int offsetInElement, @NotNull Consumer<? super PomTarget> consumer) { if (element.getLanguage() == YAMLLanguage.INSTANCE && element instanceof YAMLKeyValue) { consumer.consume((YAMLKeyValue)element); } }
findDeclarationsAt