Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
249,200
void (@NotNull PsiElement element, @NotNull TextAttributesKey attributesKey) { TextRange range = getRange(element); if (range != null) { highlight(range, attributesKey); } }
highlight
249,201
void (@NotNull TextRange range, @NotNull TextAttributesKey attributesKey) { range = mapRange(range); myHighlightInfos.add(new ModHighlight.HighlightInfo(range, attributesKey, true)); }
highlight
249,202
ModTemplateBuilder () { if (!myTemplateFields.isEmpty()) { throw new IllegalStateException("Template was already created"); } return new ModTemplateBuilder() { @Override public @NotNull ModTemplateBuilder field(@NotNull PsiElement element, @NotNull Expression expression) { TextRange elementRange = getRange(element); if...
templateBuilder
249,203
ModTemplateBuilder (@NotNull PsiElement element, @NotNull Expression expression) { TextRange elementRange = getRange(element); if (elementRange == null) { throw new IllegalStateException("Unable to restore element for template"); } TextRange range = mapRange(elementRange); Result result = expression.calculateResult(new...
field
249,204
ModTemplateBuilder (@NotNull PsiElement element, @NotNull String varName, @NotNull String dependantVariableName, boolean alwaysStopAt) { TextRange elementRange = getRange(element); if (elementRange == null) { throw new IllegalStateException("Unable to restore element for template"); } TextRange range = mapRange(element...
field
249,205
void (int offset) { myPositionUpdated = true; PsiLanguageInjectionHost host = myTracker.myHostCopy; if (host != null) { InjectedLanguageManager instance = InjectedLanguageManager.getInstance(myTracker.myProject); PsiFile file = findInjectedFile(instance, host); offset = instance.mapUnescapedOffsetToInjected(file, offse...
moveTo
249,206
void (@NotNull PsiElement element) { TextRange range = getRange(element); if (range != null) { moveTo(range.getStartOffset()); } }
moveTo
249,207
void (char ch) { myPositionUpdated = true; myTracker.unblock(); String text = myTracker.myPositionDocument.getText(); int idx = text.lastIndexOf(ch, myCaretOffset); if (idx == -1) return; myCaretOffset = idx; }
moveToPrevious
249,208
void (@NotNull PsiNameIdentifierOwner element, @NotNull List<@NotNull String> suggestedNames) { if (myRenameSymbol != null) { throw new IllegalStateException("One element is already registered for rename"); } TextRange range = getRange(element); if (range == null) { throw new IllegalArgumentException("Element disappear...
rename
249,209
void (@NotNull PsiElement declaration) { TextRange range = getRange(declaration); if (range == null) { throw new IllegalArgumentException("Element disappeared after postponed operations: " + declaration); } String oldText = myTracker.myCopyFile.getText(); myTrackedDeclarations.add(new ModUpdateReferences(myNavigationFi...
trackDeclaration
249,210
void (@NotNull @NlsContexts.Tooltip String errorMessage) { if (myErrorMessage != null) { throw new IllegalStateException("Update is already cancelled"); } myErrorMessage = errorMessage; }
cancel
249,211
void (@NotNull String message) { if (myInfoMessage != null) { throw new IllegalStateException("Message display was already requested; cannot show two messages"); } myInfoMessage = message; }
message
249,212
int () { return myCaretOffset; }
getCaretOffset
249,213
TextRange (@NotNull TextRange range) { PsiLanguageInjectionHost host = myTracker.myHostCopy; if (host != null) { InjectedLanguageManager instance = InjectedLanguageManager.getInstance(myTracker.myProject); PsiFile file = findInjectedFile(instance, host); int start = instance.mapUnescapedOffsetToInjected(file, range.get...
mapRange
249,214
PsiFile (InjectedLanguageManager instance, PsiLanguageInjectionHost host) { Language language = myTracker.myCopyFile.getLanguage(); var visitor = new PsiLanguageInjectionHost.InjectedPsiVisitor() { PsiFile myFile = null; @Override public void visit(@NotNull PsiFile injectedPsi, @NotNull List<? extends PsiLanguageInject...
findInjectedFile
249,215
void (@NotNull PsiFile injectedPsi, @NotNull List<? extends PsiLanguageInjectionHost.Shred> places) { if (injectedPsi.getLanguage() == language) { myFile = injectedPsi; } }
visit
249,216
void (@NotNull DocumentEvent event) { myCaretOffset = updateOffset(event, myCaretOffset, myCaretOffset == mySelection.getStartOffset() && mySelection.getLength() > 0); mySelection = updateRange(event, mySelection); myHighlightInfos.replaceAll(info -> info.withRange(updateRange(event, info.range()))); myTemplateFields.r...
documentChanged
249,217
TextRange (@NotNull DocumentEvent event, @NotNull TextRange range) { if (range.isEmpty()) { int newPos = updateOffset(event, range.getEndOffset(), false); return newPos == range.getEndOffset() ? range : TextRange.from(newPos, 0); } int newStart = updateOffset(event, range.getStartOffset(), true); int newEnd = updateOff...
updateRange
249,218
int (DocumentEvent event, int pos, boolean leanRight) { int offset = event.getOffset(); int oldLength = event.getOldLength(); int newLength = event.getNewLength(); if (pos < offset || (pos == offset && (!leanRight || oldLength > 0))) return pos; if (pos >= offset + oldLength) return pos + newLength - oldLength; return ...
updateOffset
249,219
ModCommand () { if (myRenameSymbol != null && !myTemplateFields.isEmpty()) { throw new IllegalStateException("Cannot have both rename and template commands"); } if (myErrorMessage != null) { return error(myErrorMessage); } return myChangedFiles.values().stream() .map(fileTracker -> fileTracker.getUpdateCommand()).reduc...
getCommand
249,220
ModCommand () { if (!myPositionUpdated || myRenameSymbol != null) return nop(); int length = myTracker.myTargetFile.getTextLength(); int start = -1, end = -1, caret = -1; if (mySelection.getEndOffset() <= length) { start = mySelection.getStartOffset(); end = mySelection.getEndOffset(); } if (this.myCaretOffset <= lengt...
getNavigateCommand
249,221
ModCommand () { if (myHighlightInfos.isEmpty()) return nop(); return new ModHighlight(myNavigationFile, myHighlightInfos); }
getHighlightCommand
249,222
ModCommand () { if (myTemplateFields.isEmpty()) return nop(); return new ModStartTemplate(myNavigationFile, myTemplateFields, f -> nop()); }
getTemplateCommand
249,223
Project () { return myTracker.myProject; }
getProject
249,224
int () { return myRange.getStartOffset(); }
getStartOffset
249,225
int () { return myRange.getStartOffset(); }
getTemplateStartOffset
249,226
int () { return myRange.getEndOffset(); }
getTemplateEndOffset
249,227
String () { return myAction.getFamilyName(); }
getFamilyName
249,228
String () { Presentation presentation = getPresentation(); if (presentation != null) { return presentation.name(); } return getFamilyName(); }
getText
249,229
boolean (@NotNull Project project, @NotNull PsiFile file, @Nullable Editor editor, @NotNull PsiElement startElement, @NotNull PsiElement endElement) { ActionContext context = ActionContext.from(editor, file).withElement(startElement); myPresentation = myAction.getPresentation(context); return myPresentation != null; }
isAvailable
249,230
void (@NotNull Project project, @NotNull PsiFile file, @Nullable Editor editor, @NotNull PsiElement startElement, @NotNull PsiElement endElement) { ActionContext context = ActionContext.from(editor, file).withElement(startElement); ModCommand command = myAction.perform(context); ModCommandExecutor.getInstance().execute...
invoke
249,231
IntentionPreviewInfo (@NotNull Project project, @NotNull ProblemDescriptor previewDescriptor) { return myAction.generatePreview(ActionContext.from(previewDescriptor)); }
generatePreview
249,232
IntentionPreviewInfo (@NotNull Project project, @NotNull Editor editor, @NotNull PsiFile file) { return myAction.generatePreview(ActionContext.from(editor, file)); }
generatePreview
249,233
Icon (int flags) { if (NewUiValue.isEnabled()) return null; Presentation presentation = getPresentation(); return presentation == null ? null : presentation.icon(); }
getIcon
249,234
List<IntentionAction> () { Presentation presentation = getPresentation(); return presentation != null && presentation.fixAllOption() != null ? IntentionActionWithFixAllOption.super.getOptions() : List.of(); }
getOptions
249,235
boolean (@NotNull IntentionActionWithFixAllOption action) { Presentation presentation = getPresentation(); ModCommandAction unwrapped = action.asModCommandAction(); if (unwrapped == null || presentation == null || presentation.fixAllOption() == null) return false; return presentation.fixAllOption().belongsToMyFamily()....
belongsToMyFamily
249,236
String () { Presentation presentation = getPresentation(); return presentation != null && presentation.fixAllOption() != null ? presentation.fixAllOption().name() : ""; }
getFixAllText
249,237
String () { return "[LocalQuickFixAndIntentionActionOnPsiElement] " + myAction; }
toString
249,238
ModCommand (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { return myAction.perform(ActionContext.from(descriptor)); }
perform
249,239
IntentionPreviewInfo (@NotNull Project project, @NotNull ProblemDescriptor previewDescriptor) { return myAction.generatePreview(ActionContext.from(previewDescriptor)); }
generatePreview
249,240
String () { return myAction.getFamilyName(); }
getFamilyName
249,241
String () { if (myPresentation == null) { // Should not arrive here; for debug purposes only return "(not initialized) " + myAction.getClass(); //NON-NLS } return myPresentation.name(); }
getText
249,242
String () { return myAction.getFamilyName(); }
getFamilyName
249,243
boolean (@NotNull Project project, Editor editor, PsiFile file) { Presentation presentation = myAction.getPresentation(ActionContext.from(editor, file)); if (presentation == null) return false; myPresentation = presentation; return true; }
isAvailable
249,244
boolean () { return false; }
startInWriteAction
249,245
IntentionPreviewInfo (@NotNull Project project, @NotNull Editor editor, @NotNull PsiFile file) { return myAction.generatePreview(ActionContext.from(editor, file)); }
generatePreview
249,246
Priority () { return myPresentation == null ? Priority.NORMAL : myPresentation.priority(); }
getPriority
249,247
Icon (int flags) { return NewUiValue.isEnabled() || myPresentation == null ? null : myPresentation.icon(); }
getIcon
249,248
ModCommandAction () { return myAction; }
action
249,249
List<IntentionAction> () { return myPresentation != null && myPresentation.fixAllOption() != null ? IntentionActionWithFixAllOption.super.getOptions() : List.of(); }
getOptions
249,250
List<RangeToHighlight> (@NotNull Editor editor, @NotNull PsiFile file) { if (myPresentation == null) return List.of(); return ContainerUtil.map(myPresentation.rangesToHighlight(), range -> new RangeToHighlight(file, range.range(), range.highlightKey())); }
getRangesToHighlight
249,251
boolean (@NotNull IntentionActionWithFixAllOption action) { ModCommandAction unwrapped = action.asModCommandAction(); if (unwrapped == null || myPresentation == null || myPresentation.fixAllOption() == null) return false; return myPresentation.fixAllOption().belongsToMyFamily().test(unwrapped); }
belongsToMyFamily
249,252
String () { return myPresentation != null && myPresentation.fixAllOption() != null ? myPresentation.fixAllOption().name() : ""; }
getFixAllText
249,253
boolean (Object obj) { if (obj == this) return true; if (obj == null || obj.getClass() != this.getClass()) return false; var that = (ModCommandActionWrapper)obj; return Objects.equals(this.myAction, that.myAction); }
equals
249,254
int () { return Objects.hash(myAction); }
hashCode
249,255
String () { return "ModCommandActionWrapper[" + "action=" + myAction + ']'; }
toString
249,256
ModCommandAction () { return myAction; }
asModCommandAction
249,257
void (VirtualFile originalFile) { throw new UnsupportedOperationException(); }
setOriginalFile
249,258
boolean () { return true; }
isDirectory
249,259
VirtualFile () { return getOriginalFile().getParent(); }
getParent
249,260
boolean () { return true; }
shouldSkipEventSystem
249,261
VirtualFile[] () { return Stream.concat(Stream.of(getOriginalFile()), myAddedChildren.values().stream()) .toArray(VirtualFile[]::new); }
getChildren
249,262
VirtualFile (Object requestor, @NotNull String name) { if (findChild(name) != null) { throw new IllegalArgumentException("Child exists: " + name); } LightVirtualFile file = new AddedVirtualFile(name); myAddedChildren.put(name, file); return file; }
createChildData
249,263
VirtualFile (Object requestor, @NotNull String name) { throw new UnsupportedOperationException(); }
createChildDirectory
249,264
void (Object requestor) { ChangedVirtualDirectory.this.myAddedChildren.remove(getName()); }
delete
249,265
boolean () { return true; }
shouldSkipEventSystem
249,266
VirtualFile () { return ChangedVirtualDirectory.this; }
getParent
249,267
IntentionAction (@NotNull ModCommandAction action) { return new ModCommandActionWrapper(action); }
wrap
249,268
LocalQuickFixAndIntentionActionOnPsiElement (@NotNull ModCommandAction action, @NotNull PsiElement psiElement) { return new ModCommandActionQuickFixUberWrapper(action, psiElement); }
wrapToLocalQuickFixAndIntentionActionOnPsiElement
249,269
LocalQuickFix (@NotNull ModCommandAction action) { return new ModCommandActionQuickFixWrapper(action); }
wrapToQuickFix
249,270
ModCommand (@NotNull ActionContext context, @NotNull Consumer<@NotNull ModPsiUpdater> updater) { return PsiUpdateImpl.psiUpdate(context, updater); }
psiUpdate
249,271
IntentionPreviewInfo (@NotNull ModCommand modCommand, @NotNull ActionContext context) { Project project = context.project(); PsiFile file = context.file(); List<IntentionPreviewInfo.CustomDiff> customDiffList = new ArrayList<>(); IntentionPreviewInfo navigateInfo = IntentionPreviewInfo.EMPTY; for (ModCommand command : ...
getPreview
249,272
IntentionPreviewInfo (@NotNull ActionContext context, @NotNull ModChooseAction target) { return target.actions().stream() .filter(action -> action.getPresentation(context) != null) .findFirst() .map(action -> action.generatePreview(context)) .orElse(IntentionPreviewInfo.EMPTY); }
getChoosePreview
249,273
HtmlChunk (@NotNull ActionContext context, @NotNull ModUpdateInspectionOptions options) { InspectionToolWrapper<?, ?> tool = InspectionProfileManager.getInstance(context.project()).getCurrentProfile().getInspectionTool(options.inspectionShortName(), context.file()); if (tool == null) { return HtmlChunk.empty(); } HtmlB...
createOptionsPreview
249,274
HtmlChunk (@NotNull InspectionProfileEntry inspection, ModUpdateInspectionOptions.@NotNull ModifiedInspectionOption option) { OptPane pane = inspection.getOptionsPane(); Object newValue = option.newValue(); if (newValue instanceof Boolean value) { OptCheckbox control = ObjectUtils.tryCast(pane.findControl(option.bindId...
createOptionPreview
249,275
boolean () { return myFix.startInWriteAction(); }
startInWriteAction
249,276
SuppressIntentionAction (final @NotNull SuppressQuickFix fix) { return new SuppressIntentionActionFromFix(fix); }
convertBatchToSuppressIntentionAction
249,277
ThreeState () { return myFix instanceof InjectionAwareSuppressQuickFix ? ((InjectionAwareSuppressQuickFix)myFix).isShouldBeAppliedToInjectionHost() : ThreeState.UNSURE; }
isShouldBeAppliedToInjectionHost
249,278
PsiElement (PsiElement element) { return myFix instanceof ContainerBasedSuppressQuickFix ? ((ContainerBasedSuppressQuickFix)myFix).getContainer(element) : null; }
getContainer
249,279
boolean (@NotNull Project project, Editor editor, @NotNull PsiElement element) { return myFix.isAvailable(project, element); }
isAvailable
249,280
String () { return myFix.getFamilyName(); }
getFamilyName
249,281
boolean () { return myFix.isSuppressAll(); }
isSuppressAll
249,282
ModCommand (@NotNull ActionContext context) { PsiElement element = Objects.requireNonNull(context.findLeaf()); InspectionManager inspectionManager = InspectionManager.getInstance(context.project()); PsiElement container = getContainer(element); boolean caretWasBeforeStatement = container != null && context.offset() == ...
perform
249,283
String () { return mcFix.getFamilyName(); }
getFamilyName
249,284
boolean (@NotNull InspectionProfile profile, @NotNull String shortName) { if (profile instanceof InspectionProfileImpl) { ToolsImpl tools = ((InspectionProfileImpl)profile).getToolsOrNull(shortName, null); if (tools != null) { return tools.isEnabled(); } } return profile.isToolEnabled(HighlightDisplayKey.find(shortName...
isToolEnabled
249,285
Path (@NotNull Path outputDir, @NotNull String shortName) { return outputDir.resolve(shortName + XML_EXTENSION); }
getInspectionResultPath
249,286
String () { return AnalysisBundle.message("set.inspection.option.fix"); }
getFamilyName
249,287
ModCommand (@NotNull ActionContext context) { return ModCommand.updateOption(context.file(), myInspection, tool -> { tool.getOptionController().setOption(myProperty, myValue); }); }
perform
249,288
boolean (@NotNull LocalInspectionTool tool, @NotNull ProblemsHolder holder, boolean isOnTheFly, @NotNull LocalInspectionToolSession session, @NotNull List<? extends PsiElement> elements, Map<Class<?>, Collection<Class<?>>> targetPsiClasses) { PsiElementVisitor visitor = createVisitor(tool, holder, isOnTheFly, session);...
createVisitorAndAcceptElements
249,289
PsiElementVisitor (@NotNull LocalInspectionTool tool, @NotNull ProblemsHolder holder, boolean isOnTheFly, @NotNull LocalInspectionToolSession session) { PsiElementVisitor visitor = tool.buildVisitor(holder, isOnTheFly, session); //noinspection ConstantConditions if (visitor == null) { LOG.error("Tool " + tool + " (" + ...
createVisitor
249,290
void (@NotNull List<? extends PsiElement> elements, @NotNull PsiElementVisitor elementVisitor, Map<Class<?>, Collection<Class<?>>> targetPsiClasses, List<Class<?>> acceptingPsiTypes) { if (acceptingPsiTypes == InspectionVisitorsOptimizer.ALL_ELEMENTS_VISIT_LIST) { for (int i = 0, elementsSize = elements.size(); i < ele...
acceptElements
249,291
void (@NotNull PsiFile psiFile, @NotNull List<? super PsiElement> outElements, @NotNull Set<? super String> outDialects) { FileViewProvider viewProvider = psiFile.getViewProvider(); Set<Language> processedLanguages = new SmartHashSet<>(); // we hope that injected file here is small enough for PsiRecursiveElementVisitor...
getAllElementsAndDialectsFrom
249,292
void (@NotNull PsiElement element) { ProgressManager.checkCanceled(); PsiElement child = element.getFirstChild(); while (child != null) { outElements.add(child); child.accept(this); appendDialects(child, processedLanguages, outDialects); child = child.getNextSibling(); } }
visitElement
249,293
void (@NotNull PsiElement element, @NotNull Set<? super Language> outProcessedLanguages, @NotNull Set<? super String> outDialectIds) { Language language = element.getLanguage(); outDialectIds.add(language.getID()); if (outProcessedLanguages.add(language)) { for (Language dialect : language.getDialects()) { outDialectId...
appendDialects
249,294
void (@NotNull PsiFile psiFile, @NotNull TextRange restrictRange, @NotNull TextRange priorityRange, @Nullable HighlightSeverity minimumSeverity, boolean isOnTheFly, @NotNull Consumer<? super LocalInspectionToolSession> runnable) { LocalInspectionToolSession session = new LocalInspectionToolSession(psiFile, priorityRang...
withSession
249,295
boolean (@NotNull ProblemHighlightType highlightType, @NotNull LocalInspectionToolWrapper toolWrapper, @NotNull PsiFile psiFile) { if (highlightType == ProblemHighlightType.INFORMATION) { String shortName = toolWrapper.getShortName(); if (ourToolsWithInformationProblems.add(shortName)) { String message = "Tool #" + sho...
warnAboutInformationLevelInBatchMode
249,296
void (@NotNull ProblemDescriptor descriptor) { if (!isOnTheFly) { ProblemHighlightType highlightType = descriptor.getHighlightType(); if (warnAboutInformationLevelInBatchMode(highlightType, toolWrapper, psiFile)) { return; } if (highlightType == ProblemHighlightType.POSSIBLE_PROBLEM) { return; } } if (foundDescriptorCa...
registerProblem
249,297
CommonProblemDescriptor[] (@NotNull RefEntity refEntity) { return result.toArray(CommonProblemDescriptor.EMPTY_ARRAY); }
getDescriptions
249,298
void (@NotNull RefEntity refEntity) { throw new UnsupportedOperationException(); }
ignoreElement
249,299
void (@NotNull CommonProblemDescriptor descriptor) { throw new UnsupportedOperationException(); }
resolveProblem