Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
63,800
JBInsets (int b) {return null;}
insetsBottom
63,801
JBInsets (int r) {return new JBInsets(0, 0, 0, r);}
insetsRight
63,802
JBInsets (Insets insets) {return null;}
insets
63,803
JBEmptyBorder () {return null;}
empty
63,804
Border (int offsets) {return null;}
empty
63,805
JBEmptyBorder (int topAndBottom, int leftAndRight) {return null;}
empty
63,806
JBEmptyBorder (int top, int left, int bottom, int right) {return null;}
empty
63,807
Border (Insets insets) {return null;}
empty
63,808
void () { myFixture.testHighlighting(getTestName(false) + '.' + getFileExtension()); }
doTest
63,809
void () { myFixture.testHighlighting(getTestName(false) + '.' + getFileExtension()); }
doTest
63,810
void () { myFixture.testHighlighting(getTestName(false) + '.' + getFileExtension()); }
doTest
63,811
void () { doTest(false); }
doTest
63,812
void (boolean disablePropertyMappingClass) { if (!disablePropertyMappingClass) { addPropertyMappingClass(); } myFixture.testHighlighting(getTestName(false) + '.' + getFileExtension()); }
doTest
63,813
void () { myFixture.addClass("package com.intellij.serialization;\n" + "public @interface PropertyMapping { String[] value(); }"); }
addPropertyMappingClass
63,814
void () { myFixture.testHighlighting(getTestName(false) + '.' + getFileExtension()); }
doTest
63,815
void (String fixName) { DevKitInspectionFixTestBase.doTest(myFixture, fixName, getFileExtension(), getTestName(false)); }
doTest
63,816
void () { myFixture.testHighlighting(getTestName(false) + '.' + getFileExtension()); }
doTest
63,817
PluginId (String idString) {return null;}
getId
63,818
void (String fixName, String before, String after) { myFixture.configureByText("TestClass." + getFileExtension(), before); myFixture.checkHighlighting(); IntentionAction intention = myFixture.findSingleIntention(fixName); myFixture.checkPreviewAndLaunchAction(intention); myFixture.checkResult(after, true); }
doTest
63,819
void (String fixName) { doTest(myFixture, fixName, getFileExtension(), getTestName(false)); }
doTest
63,820
void (JavaCodeInsightTestFixture fixture, String fixName, String fileExtension, String testName) { String fileNameBefore = testName + '.' + fileExtension; String fileNameAfter = testName + "_after." + fileExtension; fixture.testHighlighting(fileNameBefore); IntentionAction intention = fixture.findSingleIntention(fixNam...
doTest
63,821
void () { myFixture.testHighlighting(getTestName(false) + '.' + getFileExtension()); }
doTest
63,822
void (String fixName, String before, String after) { myFixture.configureByText("TestClass." + getFileExtension(), before); myFixture.checkHighlighting(); IntentionAction intention = myFixture.findSingleIntention(fixName); myFixture.checkPreviewAndLaunchAction(intention); myFixture.checkResult(after, true); }
doTest
63,823
void (PsiClass aClass) {}
visitClass
63,824
void (PsiReturnStatement statement) {}
visitReturnStatement
63,825
void (PsiLambdaExpression expression) {}
visitLambdaExpression
63,826
PsiElement () { final PsiFile containingFile = getElement().getContainingFile(); if (!(containingFile instanceof JsonFile)) return null; final List<JsonProperty> namedColors = ThemeJsonUtil.getNamedColors((JsonFile)containingFile); return ContainerUtil.find(namedColors, property -> property.getName().equals(myName)); }
resolveInner
63,827
void (HtmlBuilder builder, @Nls String sectionName, @Nls String sectionContent) { appendSection(builder, sectionName, () -> sectionContent); }
appendSection
63,828
void (HtmlBuilder builder, @Nls String sectionName, Supplier<@Nls String> content) { HtmlChunk headerCell = DocumentationMarkup.SECTION_HEADER_CELL.child(HtmlChunk.text(sectionName).wrapWith("p")); HtmlChunk contentCell = DocumentationMarkup.SECTION_CONTENT_CELL.addText(content.get()); builder.append(HtmlChunk.tag("tr"...
appendSection
63,829
boolean (@NotNull JsonProperty property) { PsiElement parent = property; while ((parent = parent.getParent()) != null) { if (!(parent instanceof JsonProperty)) continue; if (UI_PROPERTY_NAME.equals(((JsonProperty)parent).getName())) return true; } return false; }
isInsideUiProperty
63,830
String (@NotNull JsonProperty property) { List<JsonProperty> parentProperties = PsiTreeUtil.collectParents(property, JsonProperty.class, false, e -> { //TODO check that it is TOP-LEVEL 'ui' property return e instanceof JsonProperty && UI_PROPERTY_NAME.equals(((JsonProperty)e).getName()); }); return Lists.reverse(parent...
getParentNames
63,831
boolean (@NotNull String fileName) { return StringUtil.endsWithIgnoreCase(fileName, ".theme.json"); }
isThemeFilename
63,832
List<JsonProperty> (@NotNull JsonFile themeFile) { JsonValue topLevelValue = themeFile.getTopLevelValue(); if (!(topLevelValue instanceof JsonObject)) return Collections.emptyList(); JsonProperty colorsProperty = ((JsonObject)topLevelValue).findProperty(COLORS_PROPERTY_NAME); if (colorsProperty == null) return Collecti...
getNamedColors
63,833
Tokenizer (PsiElement element) { return SpellcheckingStrategy.EMPTY_TOKENIZER; }
getTokenizer
63,834
boolean (@NotNull PsiElement element) { return ThemeColorAnnotator.isTargetElement(element); }
isMyContext
63,835
void (@NotNull PsiElement element, @NotNull AnnotationHolder holder) { if (!isColorLineMarkerProviderEnabled() || !isTargetElement(element, holder.getCurrentAnnotationSession().getFile())) return; JsonStringLiteral literal = (JsonStringLiteral)element; holder.newSilentAnnotation(HighlightSeverity.INFORMATION) .gutterIc...
annotate
63,836
boolean () { return LineMarkerSettings.getSettings().isEnabled(ColorLineMarkerProvider.INSTANCE); }
isColorLineMarkerProviderEnabled
63,837
boolean (@NotNull PsiElement element) { return isTargetElement(element, element.getContainingFile()); }
isTargetElement
63,838
boolean (@NotNull PsiElement element, @NotNull PsiFile containingFile) { if (!(element instanceof JsonStringLiteral)) return false; if (!ThemeJsonUtil.isThemeFilename(containingFile.getName())) return false; if (JsonPsiImplUtils.isPropertyName((JsonStringLiteral)element)) return false; String text = ((JsonStringLiteral...
isTargetElement
63,839
boolean (String text) { return StringUtil.isLatinAlphanumeric(text); }
isNamedColor
63,840
boolean (@Nullable String text) { if (!StringUtil.startsWithChar(text, '#')) return false; //noinspection ConstantConditions - StringUtil#startsWithChar checks for null if (text.length() != HEX_COLOR_LENGTH_RGB && text.length() != HEX_COLOR_LENGTH_RGBA) return false; return COLOR_HEX_PATTERN_RGB.matcher(text).matches()...
isColorCode
63,841
Icon () { Color color = getColor(myColorText); if (color != null) { return JBUIScale.scaleIcon(new ColorIcon(ICON_SIZE, color)); } return JBUIScale.scaleIcon(EmptyIcon.create(ICON_SIZE)); }
getIcon
63,842
boolean () { return canChooseColor(); }
isNavigateAction
63,843
String () { return canChooseColor() ? DevKitThemesBundle.message("theme.choose.color.tooltip") : null; }
getTooltipText
63,844
AnAction () { if (!canChooseColor()) return null; return new AnAction(DevKitThemesBundle.messagePointer("action.Anonymous.text.choose.color")) { @Override public void actionPerformed(@NotNull AnActionEvent e) { Editor editor = e.getData(CommonDataKeys.EDITOR); if (editor == null) return; Color currentColor = getColor(m...
getClickAction
63,845
void (@NotNull AnActionEvent e) { Editor editor = e.getData(CommonDataKeys.EDITOR); if (editor == null) return; Color currentColor = getColor(myColorText); if (currentColor == null) return; boolean withAlpha = isRgbaColorHex(myColorText); if (Registry.is("ide.new.color.picker")) { ColorChooserService.getInstance().show...
actionPerformed
63,846
void (Color currentColor, boolean withAlpha, Color newColor) { if (newColor == null || newColor.equals(currentColor)) return; String newColorHex = "#" + ColorUtil.toHex(newColor, withAlpha); Project project = myLiteral.getProject(); JsonStringLiteral newLiteral = new JsonElementGenerator(project).createStringLiteral(ne...
applyColor
63,847
boolean () { return isColorCode(myColorText); }
canChooseColor
63,848
Color (@NotNull String colorText) { if (!isColorCode(colorText)) { return findNamedColor(colorText); } return parseColor(colorText); }
getColor
63,849
Color (@NotNull String colorHex) { boolean isRgba = isRgbaColorHex(colorHex); if (!isRgba && !isRgbColorHex(colorHex)) return null; try { String alpha = isRgba ? colorHex.substring(HEX_COLOR_LENGTH_RGB) : null; String colorHexWithoutAlpha = isRgba ? colorHex.substring(0, HEX_COLOR_LENGTH_RGB) : colorHex; Color color = ...
parseColor
63,850
Color (String colorText) { final PsiFile file = myLiteral.getContainingFile(); if (!(file instanceof JsonFile)) return null; final List<JsonProperty> colors = ThemeJsonUtil.getNamedColors((JsonFile)file); final JsonProperty namedColor = ContainerUtil.find(colors, property -> property.getName().equals(colorText)); if (n...
findNamedColor
63,851
boolean (@NotNull String colorHex) { return colorHex.length() == HEX_COLOR_LENGTH_RGBA; }
isRgbaColorHex
63,852
boolean (@NotNull String colorHex) { return colorHex.length() == HEX_COLOR_LENGTH_RGB; }
isRgbColorHex
63,853
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; MyRenderer renderer = (MyRenderer)o; return myColorText.equals(renderer.myColorText) && myLiteral.equals(renderer.myLiteral); }
equals
63,854
int () { return Objects.hash(myColorText, myLiteral); }
hashCode
63,855
PsiElementVisitor (@NotNull ProblemsHolder holder, boolean isOnTheFly) { return UastHintedVisitorAdapter.create(holder.getFile().getLanguage(), new AbstractUastNonRecursiveVisitor() { @Override public boolean visitExpression(@NotNull UExpression node) { if (node instanceof UCallExpression) { handleCallExpression(holder...
buildInternalVisitor
63,856
boolean (@NotNull UExpression node) { if (node instanceof UCallExpression) { handleCallExpression(holder, (UCallExpression)node); } else if (node instanceof UQualifiedReferenceExpression) { UElement parent = node.getUastParent(); if (parent instanceof UCallExpression) { handleCallExpression(holder, (UCallExpression)par...
visitExpression
63,857
void (@NotNull ProblemsHolder holder, @NotNull UCallExpression expression) { if (!isNamedColorCall(expression)) return; String key = getKey(expression); if (key == null) return; if (!isRegisteredNamedColor(key)) { registerProblem(key, holder, expression); } }
handleCallExpression
63,858
boolean (@NotNull UCallExpression expression) { if (expression.getKind() != UastCallKind.METHOD_CALL) return false; if (!NAMED_COLOR_METHOD_NAME.equals(expression.getMethodName())) return false; PsiMethod resolved = expression.resolve(); if (resolved == null) return false; PsiClass containingClass = resolved.getContain...
isNamedColorCall
63,859
String (@NotNull UCallExpression expression) { List<UExpression> arguments = expression.getValueArguments(); if (arguments.isEmpty()) return null; UExpression firstArgument = arguments.get(0); Object evaluated = firstArgument.evaluate(); if (!(evaluated instanceof String)) return null; return (String)evaluated; }
getKey
63,860
boolean (@NotNull String key) { return UIThemeMetadataService.getInstance().findByKey(key) != null; }
isRegisteredNamedColor
63,861
void (@NotNull String key, @NotNull ProblemsHolder holder, @NotNull UCallExpression expression) { ProblemHolderUtilKt.registerUProblem(holder, expression, DevKitThemesBundle.message("inspections.unregistered.named.color", key), new LocalQuickFix() { @Nls(capitalization = Nls.Capitalization.Sentence) @NotNull @Override ...
registerProblem
63,862
String () { return DevKitThemesBundle.message("inspections.unregistered.named.color.fix.navigate.theme.metadata.file"); }
getFamilyName
63,863
boolean () { return false; }
startInWriteAction
63,864
void (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { final Collection<VirtualFile> metadataFiles = FilenameIndex.getAllFilesByExt(project, ThemeMetadataJsonSchemaProviderFactoryKt.THEME_METADATA_JSON_EXTENSION); if (metadataFiles.isEmpty()) return; final PsiFile[] psiFiles = PsiUtilCore.toPsiFiles(P...
applyFix
63,865
IntentionPreviewInfo (@NotNull Project project, @NotNull ProblemDescriptor previewDescriptor) { return IntentionPreviewInfo.EMPTY; }
generatePreview
63,866
void (@NotNull PsiElement element, @NotNull AnnotationHolder holder) { if (!(element instanceof JsonProperty property)) return; if (!ThemeJsonUtil.isThemeFilename(holder.getCurrentAnnotationSession().getFile().getName())) return; if (property.getValue() instanceof JsonObject) return; // do not check intermediary keys i...
annotate
63,867
List<JsonSchemaFileProvider> (@NotNull Project project) { return Collections.singletonList(new JsonSchemaFileProvider() { @Override public boolean isAvailable(@NotNull VirtualFile file) { return ThemeJsonUtil.isThemeFilename(file.getName()); } @NotNull @Override public String getName() { return DevKitThemesBundle.messa...
getProviders
63,868
boolean (@NotNull VirtualFile file) { return ThemeJsonUtil.isThemeFilename(file.getName()); }
isAvailable
63,869
String () { return DevKitThemesBundle.message("theme.json.display.name"); }
getName
63,870
VirtualFile () { return JsonSchemaProviderFactory.getResourceFile(getClass(), THEME_SCHEMA); }
getSchemaFile
63,871
SchemaType () { return SchemaType.embeddedSchema; }
getSchemaType
63,872
void (@NotNull PsiReferenceRegistrar registrar) { registrar.registerReferenceProvider(XmlPatterns.xmlAttributeValue().withLocalName("path"), new PsiReferenceProvider() { @Override public PsiReference @NotNull [] getReferencesByElement(@NotNull PsiElement element, @NotNull ProcessingContext context) { if (!PsiUtil.isPlu...
registerReferenceProviders
63,873
void (@NotNull CompletionParameters parameters, @NotNull CompletionResultSet result) { PsiElement position = parameters.getPosition(); if (!(position instanceof LeafPsiElement)) return; if (!isThemeJsonFile(parameters.getOriginalFile())) return; PsiElement parent = position.getParent(); if (parent instanceof JsonString...
fillCompletionVariants
63,874
boolean (@Nullable PsiFile file) { return file instanceof JsonFile && ThemeJsonUtil.isThemeFilename(file.getName()); }
isThemeJsonFile
63,875
void (@NotNull PsiElement element, @NotNull JsonProperty property, @NotNull CompletionParameters parameters, @NotNull CompletionResultSet result) { if (parameters.getCompletionType() != CompletionType.BASIC) return; if (!ThemeJsonUtil.isInsideUiProperty(property)) return; if (!isPropertyKey(element)) return; String pre...
handleJsonProperty
63,876
boolean (@NotNull PsiElement element) { PsiElement sibling = element.getParent(); // element is leaf, parent is reference expression while ((sibling = sibling.getPrevSibling()) != null) { if (":".equals(sibling.getText())) return false; // no completion for values } return true; }
isPropertyKey
63,877
Iterable<LookupElement> (@NotNull String presentNamePart, boolean shouldSurroundWithQuotes) { Predicate<String> conditionFilter; Function<String, String> mapFunction; if (presentNamePart.startsWith("*")) { //TODO darcula etc. should be proposed after *? String tail = presentNamePart.substring(1); conditionFilter = key ...
getLookupElements
63,878
void (@NotNull InsertionContext context, @NotNull LookupElement item) { if (mySurroundWithQuotes) { String quoted = "\"" + item.getLookupString() + "\""; context.getDocument().replaceString(context.getStartOffset(), context.getTailOffset(), quoted); } }
handleInsert
63,879
void (@NotNull PsiReferenceRegistrar registrar) { registrar.registerReferenceProvider( PlatformPatterns.psiElement(JsonStringLiteral.class) .inVirtualFile(PlatformPatterns.virtualFile().with(new PatternCondition<>("theme.json") { @Override public boolean accepts(@NotNull VirtualFile file, ProcessingContext context) { r...
registerReferenceProviders
63,880
boolean (@NotNull VirtualFile file, ProcessingContext context) { return ThemeJsonUtil.isThemeFilename(file.getName()); }
accepts
63,881
void (@NotNull AnActionEvent e) { BrowserUtil.browse("https://plugins.jetbrains.com/docs/intellij/themes-getting-started.html?from=DevkitOpenThemeReference"); }
actionPerformed
63,882
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
63,883
void (@NotNull AnActionEvent e) { EditorColorsManagerImpl colorsManager = (EditorColorsManagerImpl)EditorColorsManager.getInstance(); EditorColorsScheme scheme = colorsManager.getGlobalScheme(); if (EditorColorsManagerImpl.Companion.isTempScheme(scheme)) { colorsManager.getSchemeManager().removeScheme(scheme); colorsMa...
actionPerformed
63,884
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
63,885
void (@NotNull AnActionEvent e) { UIThemeLookAndFeelInfo feel = LafManager.getInstance().getCurrentUIThemeLookAndFeel(); EditorColorsScheme scheme = EditorColorsManager.getInstance().getGlobalScheme(); e.getPresentation().setEnabled(feel instanceof TempUIThemeLookAndFeelInfo || EditorColorsManagerImpl.Companion.isTempS...
update
63,886
void (@NotNull AnActionEvent e) { if (ApplyThemeAction.applyTempTheme(e)) { EditorColorsScheme scheme = EditorColorsManager.getInstance().getGlobalScheme(); if (EditorColorsManagerImpl.Companion.isTempScheme(scheme)) { Configurable[] configurables = new ColorAndFontOptions().getConfigurables(); ApplicationManager.getAp...
actionPerformed
63,887
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
63,888
void (@NotNull AnActionEvent e) { applyTempTheme(e); }
actionPerformed
63,889
void (@NotNull AnActionEvent e) { if (LafManager.getInstance().getCurrentUIThemeLookAndFeel() instanceof TempUIThemeLookAndFeelInfo) { e.getPresentation().setIcon(AllIcons.Actions.Rerun); } }
update
63,890
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
63,891
boolean (@Nullable VirtualFile file) { return file != null && StringUtilRt.endsWithIgnoreCase(file.getNameSequence(), UITheme.FILE_EXT_ENDING); }
isThemeFile
63,892
boolean (@NotNull AnActionEvent e) { Project project = e.getProject(); if (project == null) return false; VirtualFile file = e.getData(CommonDataKeys.VIRTUAL_FILE); if (!isThemeFile(file)) { file = null; } if (file == null) { for (VirtualFile virtualFile : FileEditorManager.getInstance(project).getOpenFiles()) { if (is...
applyTempTheme
63,893
boolean (@NotNull VirtualFile json, @NotNull Project project) { try { FileDocumentManager.getInstance().saveAllDocuments(); Module module = ModuleUtilCore.findModuleForFile(json, project); UITheme theme = TempUIThemeLookAndFeelInfo.loadTempTheme(json.getInputStream(), new IconPathPatcher() { @Override public @NotNull S...
applyTempTheme
63,894
String (@NotNull String path, @Nullable ClassLoader classLoader) { String result = module == null ? null : findAbsoluteFilePathByRelativePath(module, path); return result == null ? path : result; }
patchPath
63,895
void (@NotNull ModuleRootManager moduleRootManager, @NotNull Map<String, Object> background) { if (!background.isEmpty()) { VirtualFile pathToBg = findThemeFile(moduleRootManager, background.get("image").toString()); if (pathToBg != null) { background.put("image", pathToBg.getPath()); } } }
patchBackgroundImagePath
63,896
UIThemeMetadataService () { return ApplicationManager.getApplication().getService(UIThemeMetadataService.class); }
getInstance
63,897
void () { myCache.clear(); loadMetadata(); }
extensionListChanged
63,898
void () { final List<UIThemeMetadata> themeMetadata = ContainerUtil.mapNotNull(EP_NAME.getExtensionList(), UIThemeMetadataProvider::loadMetadata); for (UIThemeMetadata metadata : themeMetadata) { myCache.put(metadata, ContainerUtil.newMapFromValues(metadata.getUiKeyMetadata().iterator(), o -> o.getKey())); } }
loadMetadata
63,899
boolean (PairProcessor<? super UIThemeMetadata, ? super UIThemeMetadata.UIKeyMetadata> processor) { for (Map.Entry<UIThemeMetadata, Map<String, UIThemeMetadata.UIKeyMetadata>> entry : myCache.entrySet()) { for (Map.Entry<String, UIThemeMetadata.UIKeyMetadata> uiKeyMetadataEntry : entry.getValue().entrySet()) { if (!pro...
processAllKeys