mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-15 11:53:49 +07:00
[spelling] Deprecated BaseSplitter.checkCancelled
ProgressManager#checkCanceled() must be used instead GitOrigin-RevId: 5bb2faf5e77b4492a0c43e6409fde48cf712cf44
This commit is contained in:
committed by
intellij-monorepo-bot
parent
ab436d1387
commit
04e9be386c
@@ -78,10 +78,12 @@ public abstract class BaseSplitter implements Splitter {
|
||||
int from = range.getStartOffset();
|
||||
int till;
|
||||
boolean addLast = true;
|
||||
|
||||
try {
|
||||
Matcher matcher = toExclude.matcher(newBombedCharSequence(text, range));
|
||||
while (matcher.find()) {
|
||||
checkCancelled();
|
||||
ProgressManager.checkCanceled();
|
||||
|
||||
TextRange found = matcherRange(range, matcher);
|
||||
till = found.getStartOffset();
|
||||
if (range.getEndOffset() - found.getEndOffset() < MIN_RANGE_LENGTH) {
|
||||
@@ -138,6 +140,10 @@ public abstract class BaseSplitter implements Splitter {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link ProgressManager#checkCanceled()}.
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public static void checkCancelled() {
|
||||
if (ApplicationManager.getApplication() != null) {
|
||||
ProgressIndicatorProvider.checkCanceled();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.spellchecker.inspections;
|
||||
|
||||
import com.intellij.openapi.progress.ProcessCanceledException;
|
||||
import com.intellij.openapi.progress.ProgressManager;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.util.Consumer;
|
||||
@@ -74,7 +74,7 @@ public class PlainTextSplitter extends BaseSplitter {
|
||||
matcher = SPLIT_PATTERN.matcher(newBombedCharSequence(text, range));
|
||||
|
||||
while (true) {
|
||||
checkCancelled();
|
||||
ProgressManager.checkCanceled();
|
||||
|
||||
List<TextRange> toCheck;
|
||||
TextRange wRange;
|
||||
|
||||
Reference in New Issue
Block a user