GitOrigin-RevId: a4cb35f8f813f3246a5dbeab2d8f02929ea53461
This commit is contained in:
Alexey Kudravtsev
2023-03-20 17:33:21 +01:00
committed by intellij-monorepo-bot
parent 12406bf159
commit 3719a6a241
3 changed files with 16 additions and 19 deletions

View File

@@ -40,24 +40,24 @@ public interface CompileScope extends ExportableUserDataHolder {
*
* @param fileType the type of the files. Null should be passed if all available files are needed.
* @param inSourceOnly if true, files are searched only in directories within the scope that are marked as "sources" or "test sources" in module settings.
* Otherwise files are searched in all directories that belong to the scope.
* @return a array of files of given type that belong to this scope.
* Otherwise, files are searched in all directories that belong to the scope.
* @return an array of files of the given type that belong to this scope.
*/
VirtualFile @NotNull [] getFiles(@Nullable FileType fileType, boolean inSourceOnly);
/**
* Checks if the file with the specified URL belongs to the scope.
*
* @param url an VFS url. Note that actual file may not exist on the disk.
* @return true if the url specified belongs to the scope, false otherwise.
* @param url a VFS url. Note that the actual file may not exist on the disk.
* @return true, if the url specified belongs to the scope, false otherwise.
* Note: the method may be time-consuming.
*/
boolean belongs(@NotNull String url);
/**
* Returns the list of modules files in which belong to the scope.
* Returns the list of module files in which belong to the scope.
*
* @return a array of modules this scope affects.
* @return an array of modules this scope affects.
*/
Module @NotNull [] getAffectedModules();

View File

@@ -284,8 +284,8 @@ public final class UpdateHighlightersUtil {
RangeHighlighter highlighter = info.getHighlighter();
int hiStart = highlighter.getStartOffset();
int hiEnd = highlighter.getEndOffset();
boolean willBeRemoved = hiEnd == document.getTextLength() && range.getEndOffset() == document.getTextLength()
/*|| range.intersectsStrict(hiStart, hiEnd)*/ || range.containsRange(hiStart, hiEnd) /*|| hiStart <= range.getStartOffset() && hiEnd >= range.getEndOffset()*/;
boolean willBeRemoved = range.containsRange(hiStart, hiEnd)
|| hiEnd == document.getTextLength() && range.getEndOffset() == hiEnd;
if (willBeRemoved) {
infosToRemove.recycleHighlighter(highlighter);
info.setHighlighter(null);
@@ -300,7 +300,7 @@ public final class UpdateHighlightersUtil {
DaemonCodeAnalyzerEx codeAnalyzer = DaemonCodeAnalyzerEx.getInstanceEx(project);
boolean[] changed = {false};
SweepProcessor.Generator<HighlightInfo> generator = processor -> ContainerUtil.process(filteredInfos, processor);
SweepProcessor.sweep(generator, (offset, info, atStart, overlappingIntervals) -> {
SweepProcessor.sweep(generator, (__, info, atStart, overlappingIntervals) -> {
if (!atStart) {
return true;
}

View File

@@ -45,6 +45,7 @@ class RangeHighlighterImpl extends RangeMarkerImpl implements RangeHighlighterEx
private CustomHighlighterRenderer myCustomRenderer;
private LineSeparatorRenderer myLineSeparatorRenderer;
@Flags
private byte myFlags;
private static final byte AFTER_END_OF_LINE_MASK = 1;
@@ -60,8 +61,9 @@ class RangeHighlighterImpl extends RangeMarkerImpl implements RangeHighlighterEx
CHANGED_MASK, RENDERERS_CHANGED_MASK, FONT_STYLE_CHANGED_MASK, FOREGROUND_COLOR_CHANGED_MASK})
private @interface FlagConstant {}
@MagicConstant(flags = {CHANGED_MASK, RENDERERS_CHANGED_MASK, FONT_STYLE_CHANGED_MASK, FOREGROUND_COLOR_CHANGED_MASK})
private @interface ChangeStatus {}
@MagicConstant(flags = {AFTER_END_OF_LINE_MASK, ERROR_STRIPE_IS_THIN_MASK, TARGET_AREA_IS_EXACT_MASK, IN_BATCH_CHANGE_MASK,
CHANGED_MASK, RENDERERS_CHANGED_MASK, FONT_STYLE_CHANGED_MASK, FOREGROUND_COLOR_CHANGED_MASK})
private @interface Flags {}
RangeHighlighterImpl(@NotNull MarkupModelImpl model,
int start,
@@ -390,7 +392,7 @@ class RangeHighlighterImpl extends RangeMarkerImpl implements RangeHighlighterEx
};
}
@ChangeStatus
@Flags
byte changeAttributesNoEvents(@NotNull Consumer<? super RangeHighlighterEx> change) {
assert !isFlagSet(IN_BATCH_CHANGE_MASK);
assert !isFlagSet(CHANGED_MASK);
@@ -398,18 +400,13 @@ class RangeHighlighterImpl extends RangeMarkerImpl implements RangeHighlighterEx
setFlag(RENDERERS_CHANGED_MASK, false);
setFlag(FONT_STYLE_CHANGED_MASK, false);
setFlag(FOREGROUND_COLOR_CHANGED_MASK, false);
byte result = 0;
byte result;
try {
change.consume(this);
}
finally {
result = myFlags;
setFlag(IN_BATCH_CHANGE_MASK, false);
if (isFlagSet(CHANGED_MASK)) {
result |= CHANGED_MASK;
if (isFlagSet(RENDERERS_CHANGED_MASK)) result |= RENDERERS_CHANGED_MASK;
if (isFlagSet(FONT_STYLE_CHANGED_MASK)) result |= FONT_STYLE_CHANGED_MASK;
if (isFlagSet(FOREGROUND_COLOR_CHANGED_MASK)) result |= FOREGROUND_COLOR_CHANGED_MASK;
}
setFlag(CHANGED_MASK, false);
setFlag(RENDERERS_CHANGED_MASK, false);
setFlag(FONT_STYLE_CHANGED_MASK, false);