Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
251,400
void (@NotNull Project project) { setDirtyScope(Pass.UPDATE_ALL, WHOLE_FILE_DIRTY_MARKER); setDirtyScope(Pass.EXTERNAL_TOOLS, WHOLE_FILE_DIRTY_MARKER); setDirtyScope(Pass.LOCAL_INSPECTIONS, WHOLE_FILE_DIRTY_MARKER); setDirtyScope(Pass.LINE_MARKERS, WHOLE_FILE_DIRTY_MARKER); setDirtyScope(Pass.SLOW_LINE_MARKERS, WHOLE_F...
markWholeFileDirty
251,401
boolean () { for (RangeMarker o : dirtyScopes.values()) { if (o != null) return false; } return true; }
allDirtyScopesAreNull
251,402
void (@NotNull TextRange scope, int fileLength, @NotNull Document document) { dirtyScopes.replaceAll((__, oldScope) -> { RangeMarker newScope = combineScopes(oldScope, scope, fileLength, document); if (newScope != oldScope && oldScope != null) { oldScope.dispose(); } return newScope; }); }
combineScopesWith
251,403
RangeMarker (@Nullable RangeMarker old, @NotNull TextRange scope, int textLength, @NotNull Document document) { if (scope.equalsToRange(0, textLength)) return WHOLE_FILE_DIRTY_MARKER; if (old == null) { return document.createRangeMarker(scope); } if (old == WHOLE_FILE_DIRTY_MARKER) return old; TextRange oldRange = old....
combineScopes
251,404
String () { @NonNls StringBuilder s = new StringBuilder(); s.append("defensivelyMarked = ").append(defensivelyMarked); s.append("; wolfPassFinished = ").append(wolfPassFinished); s.append("; errorFound = ").append(errorFound); s.append("; dirtyScopes: ("); dirtyScopes.forEach((passId, rangeMarker) -> s.append(" pass: "...
toString
251,405
void (int passId, @Nullable RangeMarker scope) { RangeMarker marker = dirtyScopes.get(passId); if (marker != scope) { if (marker != null) { marker.dispose(); } dirtyScopes.put(passId, scope); } }
setDirtyScope
251,406
void () { if (!myAllowDirt) { myAllowDirt = true; //give next test a chance throw new AssertionError(CHANGES_NOT_ALLOWED_DURING_HIGHLIGHTING); } }
assertAllowModifications
251,407
void (@NotNull Document document, int passId) { synchronized (myDocumentToStatusMap) { FileStatus status = myDocumentToStatusMap.computeIfAbsent(document, __ -> new FileStatus(myProject)); status.defensivelyMarked = false; if (passId == Pass.WOLF) { status.wolfPassFinished = true; } else if (status.dirtyScopes.contains...
markFileUpToDate
251,408
void (int passId, @NotNull FileStatus status) { if (!status.dirtyScopes.containsKey(passId)) throw new IllegalStateException("Unknown pass " + passId); }
assertRegisteredPass
251,409
boolean (@NotNull Document document) { synchronized (myDocumentToStatusMap) { FileStatus status = myDocumentToStatusMap.get(document); return status != null && !status.defensivelyMarked && status.wolfPassFinished && status.allDirtyScopesAreNull(); } }
allDirtyScopesAreNull
251,410
String (@NotNull Document document) { synchronized (myDocumentToStatusMap) { if (myDocumentToStatusMap.containsKey(document)) { return myDocumentToStatusMap.get(document).toString(); } else { return ""; } } }
toString
251,411
void (@NotNull Document document) { synchronized (myDocumentToStatusMap) { FileStatus status = myDocumentToStatusMap.get(document); assert status != null && !status.defensivelyMarked && status.wolfPassFinished && status.allDirtyScopesAreNull() : status; } }
assertAllDirtyScopesAreNull
251,412
Document () { throw new UnsupportedOperationException(); }
getDocument
251,413
int () { throw new UnsupportedOperationException(); }
getStartOffset
251,414
int () { throw new UnsupportedOperationException(); }
getEndOffset
251,415
boolean () { return false; }
isValid
251,416
void (boolean greedy) { throw new UnsupportedOperationException(); }
setGreedyToLeft
251,417
void (boolean greedy) { throw new UnsupportedOperationException(); }
setGreedyToRight
251,418
boolean () { throw new UnsupportedOperationException(); }
isGreedyToRight
251,419
boolean () { throw new UnsupportedOperationException(); }
isGreedyToLeft
251,420
void () { // ignore }
dispose
251,421
int () { return threads.computeIfAbsent(Thread.currentThread(), thread -> threads.size()); }
getThreadNum
251,422
void (@NonNls Object @NotNull ... info) { if (LOG.isDebugEnabled()) { StringJoiner joiner = new StringJoiner(", ", " ".repeat(getThreadNum() * 4) + "[", "]\n"); for (Object o : info) { joiner.add(String.valueOf(o)); } LOG.debug(joiner.toString()); } }
log
251,423
TextEditorHighlightingPassRegistrarEx (Project project) { return (TextEditorHighlightingPassRegistrarEx)getInstance(project); }
getInstanceEx
251,424
void (@NotNull HighlightingSession session, @Nullable Editor editor, @NotNull List<? extends HighlightInfo> infos, @NotNull TextRange priorityRange, @NotNull TextRange restrictRange, int groupId) {}
highlightsInsideVisiblePartAreProduced
251,425
void (@NotNull HighlightingSession session, @Nullable Editor editor, @NotNull List<? extends HighlightInfo> infos, @NotNull TextRange priorityRange, @NotNull TextRange restrictedRange, int groupId) {}
highlightsOutsideVisiblePartAreProduced
251,426
void (@NotNull HighlightingSession session, @NotNull HighlightInfo info, @NotNull TextRange priorityRange, @NotNull TextRange restrictedRange, int groupId) {}
infoIsAvailable
251,427
void (@NotNull HighlightingSession session, long elementRange, @Nullable List<? extends HighlightInfo> infos) {}
allHighlightsForRangeAreProduced
251,428
void (@NotNull HighlightingSession highlightingSession, @Nullable Editor editor, double progress) { ApplicationManager.getApplication().assertIsNonDispatchThread(); }
progressIsAdvanced
251,429
HighlightInfoProcessor () { return EMPTY; }
getEmpty
251,430
boolean () { return super.isValid() && (myFile == null || myFile.isValid()); }
isValid
251,431
void () { advanceProgress(Math.max(1, myProgressLimit - myProgressCount.get())); }
sessionFinished
251,432
void (@NotNull ProgressIndicator progress) { GlobalInspectionContextBase.assertUnderDaemonProgress(); myFinished = false; if (myFile != null) { myHighlightingSession = HighlightingSessionImpl.getFromCurrentIndicator(myFile); } try { collectInformationWithProgress(progress); } finally { if (myFile != null) { sessionFini...
doCollectInformation
251,433
void () { myFinished = true; applyInformationWithProgress(); DaemonCodeAnalyzerEx daemonCodeAnalyzer = DaemonCodeAnalyzerEx.getInstanceEx(myProject); daemonCodeAnalyzer.getFileStatusMap().markFileUpToDate(myDocument, getId()); }
doApplyInformationToEditor
251,434
double () { long progressLimit = getProgressLimit(); if (progressLimit == 0) return -1; long progressCount = getProgressCount(); return progressCount > progressLimit ? 1 : (double)progressCount / progressLimit; }
getProgress
251,435
long () { return myProgressLimit; }
getProgressLimit
251,436
long () { return myProgressCount.get(); }
getProgressCount
251,437
boolean () { return myFinished; }
isFinished
251,438
Editor () { return myEditor; }
getEditor
251,439
void (long limit) { myProgressLimit = limit; myNextChunkThreshold.set(Math.max(1, limit / 100)); // 1% precision }
setProgressLimit
251,440
void (long delta) { // session can be null in e.g., inspection batch mode if (myHighlightingSession != null) { long current = myProgressCount.addAndGet(delta); if (current >= myNextChunkThreshold.get() && current >= myNextChunkThreshold.updateAndGet(old -> current >= old ? old+Math.max(1, myProgressLimit / 100) : old))...
advanceProgress
251,441
void (@NotNull ProgressIndicator progress) { }
doCollectInformation
251,442
void () { FileStatusMap statusMap = DaemonCodeAnalyzerEx.getInstanceEx(myProject).getFileStatusMap(); statusMap.markFileUpToDate(getDocument(), getId()); }
doApplyInformationToEditor
251,443
boolean (@NotNull PsiFile file) { return true; }
suitableForFile
251,444
boolean (@NotNull PsiFile file, boolean updateWholeFile, @NotNull HighlightInfoHolder holder, @NotNull Runnable action) { myDumb = myDumbService.isDumb(); myHolder = holder; myAnnotationHolder = new AnnotationHolderImpl(holder.getAnnotationSession(), myBatchMode) { @Override void queueToUpdateIncrementally() { if (!isE...
analyze
251,445
void (@NotNull PsiElement element) { if (myRunAnnotators) { runAnnotators(element); } if (element instanceof PsiErrorElement && myHighlightErrorElements) { visitErrorElement((PsiErrorElement)element); } }
visit
251,446
HighlightVisitor () { return new DefaultHighlightVisitor(myProject, myHighlightErrorElements, myRunAnnotators, myBatchMode); }
clone
251,447
void (@NotNull PsiElement element) { List<Annotator> annotators = myAnnotators.get(element.getLanguage()); if (!annotators.isEmpty()) { AnnotationHolderImpl holder = myAnnotationHolder; holder.myCurrentElement = element; for (Annotator annotator : annotators) { if (!myDumb || DumbService.isDumbAware(annotator)) { Progr...
runAnnotators
251,448
void (@NotNull PsiErrorElement element) { if (HighlightErrorFilter.EP_NAME.findFirstSafe(myProject, filter -> !filter.shouldHighlightErrorElement(element)) != null) { return; } myHolder.add(createErrorElementInfo(element)); }
visitErrorElement
251,449
HighlightInfo (@NotNull PsiErrorElement element) { HighlightInfo.Builder builder = createErrorElementInfoWithoutFixes(element); List<ErrorQuickFixProvider> providers = DumbService.getInstance(element.getProject()).filterByDumbAwareness(ErrorQuickFixProvider.EP_NAME.getExtensionList()); for (ErrorQuickFixProvider provid...
createErrorElementInfo
251,450
List<Annotator> (@NotNull Collection<? extends Annotator> templates) { List<Annotator> result = new ArrayList<>(templates.size()); for (Annotator template : templates) { Annotator annotator; try { annotator = ReflectionUtil.newInstance(template.getClass()); } catch (Exception e) { LOG.error(PluginException.createByClas...
cloneTemplates
251,451
List<Annotator> (@NotNull Language language) { return cloneTemplates(LanguageAnnotators.INSTANCE.allForLanguageOrAny(language)); }
createAnnotators
251,452
void (Object o, String description) { if (o != null) { markNotAbandoned(); // it crashed, not abandoned throw new IllegalStateException(description + " was set already"); } }
assertNotSet
251,453
void () { created = true; }
markNotAbandoned
251,454
FixBuilder (@NotNull TextRange range) { assertNotSet(this.range, "range"); this.range = range; return this; }
range
251,455
FixBuilder (@NotNull HighlightDisplayKey key) { assertNotSet(this.key, "key"); this.key = key; return this; }
key
251,456
FixBuilder () { assertNotSet(this.universal, "universal"); assertNotSet(this.batch, "batch"); assertLQF(); this.batch = true; return this; }
batch
251,457
void () { if (!(fix instanceof LocalQuickFix || fix instanceof LocalQuickFixAsIntentionAdapter)) { markNotAbandoned(); throw new IllegalArgumentException("Fix " + fix + " must be instance of LocalQuickFix to be registered as batch"); } }
assertLQF
251,458
FixBuilder () { assertNotSet(this.universal, "universal"); assertNotSet(this.batch, "batch"); assertLQF(); this.universal = true; return this; }
universal
251,459
AnnotationBuilder () { if (fixes == null) { fixes = new ArrayList<>(); } fixes.add(this); return B.this; }
registerFix
251,460
String () { return fix + (range == null ? "" : " at " + range) + (batch == null ? "" : " batch") + (universal == null ? "" : " universal"); }
toString
251,461
AnnotationBuilder (@NotNull IntentionAction fix) { return newFix(fix).registerFix(); }
withFix
251,462
FixBuilder (@NotNull IntentionAction fix) { return new FixB(fix); }
newFix
251,463
FixBuilder (@NotNull LocalQuickFix fix, @NotNull ProblemDescriptor problemDescriptor) { return new FixB(new LocalQuickFixAsIntentionAdapter(fix, problemDescriptor)); }
newLocalQuickFix
251,464
AnnotationBuilder (@NotNull TextRange range) { assertNotSet(this.range, "range"); TextRange currentElementRange = myCurrentElement.getTextRange(); if (!currentElementRange.contains(range)) { markNotAbandoned(); String message = "Range must be inside element being annotated: " + currentElementRange + "; but got: " + ran...
range
251,465
AnnotationBuilder (@NotNull ASTNode element) { return range(element.getTextRange()); }
range
251,466
AnnotationBuilder (@NotNull PsiElement element) { return range(element.getTextRange()); }
range
251,467
AnnotationBuilder () { assertNotSet(afterEndOfLine, "afterEndOfLine"); afterEndOfLine = true; return this; }
afterEndOfLine
251,468
AnnotationBuilder () { assertNotSet(fileLevel, "fileLevel"); fileLevel = true; return this; }
fileLevel
251,469
AnnotationBuilder (@NotNull GutterIconRenderer gutterIconRenderer) { assertNotSet(this.gutterIconRenderer, "gutterIconRenderer"); this.gutterIconRenderer = gutterIconRenderer; return this; }
gutterIconRenderer
251,470
AnnotationBuilder (@NotNull ProblemGroup problemGroup) { assertNotSet(this.problemGroup, "problemGroup"); this.problemGroup = problemGroup; return this; }
problemGroup
251,471
AnnotationBuilder (@NotNull TextAttributes enforcedAttributes) { assertNotSet(this.enforcedAttributes, "enforcedAttributes"); this.enforcedAttributes = enforcedAttributes; return this; }
enforcedTextAttributes
251,472
AnnotationBuilder (@NotNull TextAttributesKey textAttributes) { assertNotSet(this.textAttributesKey, "textAttributes"); this.textAttributesKey = textAttributes; return this; }
textAttributes
251,473
AnnotationBuilder (@NotNull ProblemHighlightType highlightType) { assertNotSet(this.highlightType, "highlightType"); this.highlightType = highlightType; return this; }
highlightType
251,474
AnnotationBuilder () { return needsUpdateOnTyping(true); }
needsUpdateOnTyping
251,475
AnnotationBuilder (boolean value) { assertNotSet(this.needsUpdateOnTyping, "needsUpdateOnTyping"); this.needsUpdateOnTyping = value; return this; }
needsUpdateOnTyping
251,476
AnnotationBuilder (@NotNull String tooltip) { assertNotSet(this.tooltip, "tooltip"); this.tooltip = tooltip; return this; }
tooltip
251,477
void () { if (created) { throw new IllegalStateException("Must not call .create() twice"); } created = true; if (range == null) { range = myCurrentElement.getTextRange(); } if (tooltip == null && message != null) { tooltip = XmlStringUtil.wrapInHtml(XmlStringUtil.escapeString(message)); } Annotation annotation = new An...
create
251,478
String (Object o, String name) { return o == null ? "" : ", " + name + "=" + o; }
omitIfEmpty
251,479
String () { return "Builder{" + "message='" + message + '\'' + ", myCurrentElement=" + myCurrentElement + " (" + myCurrentElement.getClass() + ")" + ", myCurrentAnnotator=" + myCurrentAnnotator + ", severity=" + severity + ", range=" + (range == null ? "(implicit)"+myCurrentElement.getTextRange() : range) + omitIfEmpty...
toString
251,480
Annotation () { PluginException.reportDeprecatedUsage("AnnotationBuilder#createAnnotation", "Use `#create()` instead"); if (range == null) { range = myCurrentElement.getTextRange(); } if (tooltip == null && message != null) { tooltip = XmlStringUtil.wrapInHtml(XmlStringUtil.escapeString(message)); } //noinspection depr...
createAnnotation
251,481
boolean (HighlightSeverity minSeverity) { return minSeverity != HighlightSeverity.INFORMATION; }
isGotoBySeverityEnabled
251,482
Color (@NotNull TextAttributes textAttributes) { return textAttributes.getErrorStripeColor(); }
getTrafficRendererColor
251,483
HighlightingSession (@NotNull PsiFile file) { DaemonProgressIndicator indicator = GlobalInspectionContextBase.assertUnderDaemonProgress(); Map<PsiFile, HighlightingSession> map = indicator.getUserData(HIGHLIGHTING_SESSION); if (map == null) { throw new IllegalStateException("No HighlightingSession stored in "+indicator...
getFromCurrentIndicator
251,484
void (@NotNull PsiFile psiFile, @NotNull DaemonProgressIndicator progressIndicator, @NotNull ProperTextRange visibleRange) { Map<PsiFile, HighlightingSession> map = progressIndicator.getUserData(HIGHLIGHTING_SESSION); HighlightingSession session = map == null ? null : map.get(psiFile); if (session == null) { createHigh...
getOrCreateHighlightingSession
251,485
HighlightingSessionImpl (@NotNull PsiFile psiFile, @Nullable Editor editor, @Nullable EditorColorsScheme editorColorsScheme, @NotNull DaemonProgressIndicator progressIndicator, @NotNull Number daemonCancelEventCount) { ThreadingAssertions.assertEventDispatchThread(); TextRange fileRange = psiFile.getTextRange(); Proper...
createHighlightingSession
251,486
HighlightingSessionImpl (@NotNull PsiFile psiFile, @NotNull DaemonProgressIndicator progressIndicator, @Nullable EditorColorsScheme editorColorsScheme, @NotNull ProperTextRange visibleRange, @NotNull CanISilentlyChange.Result canChangeFileSilently, @NotNull Number daemonCancelEventCount) { // no assertIsDispatchThread(...
createHighlightingSession
251,487
void (@NotNull PsiFile file, @Nullable EditorColorsScheme editorColorsScheme, @NotNull ProperTextRange visibleRange, boolean canChangeFileSilently, @NotNull Consumer<? super @NotNull HighlightingSession> runnable) { ApplicationManager.getApplication().assertIsNonDispatchThread(); ApplicationManager.getApplication().ass...
runInsideHighlightingSession
251,488
void (@NotNull DaemonProgressIndicator progressIndicator) { ConcurrentMap<PsiFile, HighlightingSession> map = progressIndicator.getUserData(HIGHLIGHTING_SESSION); if (map != null) { for (HighlightingSession session : map.values()) { ((HighlightingSessionImpl)session).applyFileLevelHighlightsRequests(); } } }
waitForAllSessionsHighlightInfosApplied
251,489
PsiFile () { return myPsiFile; }
getPsiFile
251,490
Document () { return myDocument; }
getDocument
251,491
ProgressIndicator () { return myProgressIndicator; }
getProgressIndicator
251,492
Project () { return myProject; }
getProject
251,493
EditorColorsScheme () { return myEditorColorsScheme; }
getColorsScheme
251,494
void (@NotNull DaemonProgressIndicator indicator) { indicator.putUserData(HIGHLIGHTING_SESSION, null); }
clearProgressIndicator
251,495
ProperTextRange () { return myVisibleRange; }
getVisibleRange
251,496
boolean () { return myIsEssentialHighlightingOnly; }
isEssentialHighlightingOnly
251,497
String () { return "HighlightingSessionImpl: " + "myVisibleRange:"+myVisibleRange+ "; myPsiFile: "+myPsiFile+ " (" + myPsiFile.getClass() + ")"+ (myIsEssentialHighlightingOnly ? "; essentialHighlightingOnly":""); }
toString
251,498
boolean () { return myDaemonCancelEventCount.intValue() != myDaemonInitialCancelEventCount; }
isCanceled
251,499
void (@NotNull List<? extends HighlightInfo> fileLevelHighlights, int group, boolean cleanOldHighlights) { Project project = getProject(); DaemonCodeAnalyzerEx codeAnalyzer = DaemonCodeAnalyzerEx.getInstanceEx(project); PsiFile psiFile = getPsiFile(); boolean shouldUpdate = !fileLevelHighlights.isEmpty() || codeAnalyze...
updateFileLevelHighlights