mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EA-52644 - assert: PsiUtilBase.reallyEvaluateLanguageInRange
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -142,7 +142,10 @@ public class PsiUtilBase extends PsiUtilCore {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static Language reallyEvaluateLanguageInRange(final int start, final int end, final PsiFile file) {
|
||||
public static Language reallyEvaluateLanguageInRange(final int start, final int end, @NotNull PsiFile file) {
|
||||
if (file instanceof PsiBinaryFile) {
|
||||
return file.getLanguage();
|
||||
}
|
||||
Language lang = null;
|
||||
int curOffset = start;
|
||||
do {
|
||||
@@ -170,7 +173,7 @@ public class PsiUtilBase extends PsiUtilCore {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static Language evaluateLanguageInRange(final int start, final int end, final PsiFile file) {
|
||||
public static Language evaluateLanguageInRange(final int start, final int end, @NotNull PsiFile file) {
|
||||
PsiElement elt = getElementAtOffset(file, start);
|
||||
|
||||
TextRange selectionRange = new TextRange(start, end);
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -123,7 +123,7 @@ public class BraceHighlightingHandler {
|
||||
public void run() {
|
||||
final PsiFile injected;
|
||||
try {
|
||||
injected = psiFile == null || psiFile instanceof PsiCompiledElement || isReallyDisposed(editor, project)
|
||||
injected = psiFile == null || psiFile instanceof PsiCompiledElement || psiFile instanceof PsiBinaryFile || isReallyDisposed(editor, project)
|
||||
? null : getInjectedFileIfAny(editor, project, offset, psiFile, alarm);
|
||||
}
|
||||
catch (RuntimeException e) {
|
||||
|
||||
Reference in New Issue
Block a user